Most excitatory inputs in the mammalian brain are made on dendritic spines, rather than on dendritic shafts. Spines compartmentalize calcium, and this biochemical isolation can underlie input-specific synaptic plasticity, providing a raison d'etre for spines. However, recent results indicate that the spine can experience a membrane potential different from that in the parent dendrite, as though the spine neck electrically isolated the spine. Here we use two-photon calcium imaging of mouse neocortical pyramidal neurons to analyze the correlation between the morphologies of spines activated under minimal synaptic stimulation and the excitatory postsynaptic potentials they generate. We find that excitatory postsynaptic potential amplitudes are inversely correlated with spine neck lengths. Furthermore, a spike timing-dependent plasticity protocol, in which two-photon glutamate uncaging over a spine is paired with postsynaptic spikes, produces rapid shrinkage of the spine neck and concomitant increases in the amplitude of the evoked spine potentials. Using numerical simulations, we explore the parameter regimes for the spine neck resistance and synaptic conductance changes necessary to explain our observations. Our data, directly correlating synaptic and morphological plasticity, imply that long-necked spines have small or negligible somatic voltage contributions, but that, upon synaptic stimulation paired with postsynaptic activity, they can shorten their necks and increase synaptic efficacy, thus changing the input/output gain of pyramidal neurons.STDP | neocortex | basal dendrites D endritic spines are found in neurons throughout the central nervous system (1), and in pyramidal neurons receive the majority of excitatory inputs, whereas dendritic shafts are normally devoid of glutamatergic synapses (2-7). These facts suggest that spines are likely to play an essential role in neural circuits (1), although it is still unclear exactly what this role is (8, 9). Because of their peculiar morphology, hypotheses regarding the specific function of spines have focused on their role in biochemical compartmentalization, whereby a small spine head, where the excitatory synapse is located, is separated from the parent dendrite by a thin neck, isolating the spine cytoplasm from the dendrite (10). Indeed, spines are diffusionally restricted from dendrites (11-13) and compartmentalize calcium after synaptic stimulation (14-16). This local biochemistry and the high calcium accumulations observed following temporal pairing of neuronal input and output (14,17,18) are thought to be responsible for input-specific synaptic plasticity (19-21). However, besides this biochemical role, spines have also been hypothesized to play an electrical role, altering excitatory postsynaptic potentials (EPSPs) (22-30). Consistent with this idea, activating spines with two-photon uncaging of glutamate generates potentials whose amplitudes are inversely proportional to the length of the spine neck (31), and these responses are much larger in spines than...