(a) Experimental timeline. (b) Repeated imaging of the distal portion of apical dendrites (L1, 0 – 50 μm from pia) and perisomatic dendrites (L2/3, 150 – 200 μm) of L2/3 pyramidal cells throughout learning. Filled and open arrows indicate present and absent dynamic spines, respectively. (c) Mean spine density normalized to the initial session (top) and daily spine dynamics (bottom) of distal dendrites (n = 7 mice, 269 spines) and perisomatic dendrites (n = 4 mice, 120 spines) in no training animals. (d) Mean spine density normalized to the initial session (top) and daily spine dynamics (bottom) of distal dendrites (n = 5 mice, 251 spines) and perisomatic dendrites (n = 5 mice, 206 spines) in training animals. Learning transiently increases spine density in distal but not perisomatic dendrites of L2/3 pyramidal cells (Distal: P<0.001, compared to no training; Perisomatic: P=0.246, compared to no training, 2-way ANOVA). (e) Learning increases the spine addition rate in the distal dendrites during the first 3 sessions. (f) Learning increases the elimination rate of pre-existing spines in the distal dendrites (fraction of pre-existing spines that remained until session 7). *P<0.05, ***P<0.001, one-tailed bootstrap test. (g) Spine formation and elimination in the distal dendrites rarely occurred during (0%, 0/25) or within two hours (4%, 1/25) of training sessions (n = 3 mice, 134 spines total). Error bars indicate SEM.