Learned odor avoidance loses specificity over time. (A) Top, left: two groups of flies were trained with either paired or unpaired presentations of an odor (black cloud; dashed cloud represents the solvent) and electric shock (lightning bolt). Then, 20 min or 24 h after repetitive training trials interspersed with pauses (pair of vertical lines), associative memory scores were calculated based on the difference between the odor preferences of the two groups, to reflect learned approach (>0) or avoidance (<0). Bottom, left: same as above, except a novel odor (gray cloud) was used for the test. Right: schematic explanation of how learned avoidance can be in part specific to the trained odor and in part generalized to a novel odor. Any difference between the black and gray bars would indicate specificity, while any difference of the gray bar from zero would indicate generalization. (B) Flies were trained with 3-octanol (O) or n-amylacetate (A) and tested with either the trained odor (conditions O–O and A–A) or the respective other odor (conditions O–A and A–O). Left: 20 min after training, memory scores significantly differed across the conditions O–O, O–A, A–O and A–A (KW-test: H=48.76, d.f.=3, P<0.0001, N=32, 40, 34, 46). Pooling the scores across the O–O and A–A as well as O–A and A–O conditions, which pair-wise did not differ (U-tests: O–O versus A–A, U=616.00, P=0.2248; O–A versus A–O, U=652.00, P=0.7655), we obtained two groups for which the training and test odors were either the same or different. In the ‘different’ group, memory scores were weaker than in the ‘same’ group (U-test: U=1002.00, P<0.0001). Significant learned avoidance was, however, detectable in each group (OSS-tests: P<0.0001 each). Right: 24 h after training, memory scores did not differ across the conditions O–O, O–A, A–O and A–A (KW-test: H=4.61, d.f.=3, P=0.2023, N=34, 40, 33, 47). Accordingly, ‘same’ and ‘different’ groups did not statistically differ and each reflected significant learned avoidance (U-test between ‘same’ and ‘different’: U=2546.50, P=0.1384; OSS-tests: P<0.0001 each). Thus, 20 min after training, learned avoidance was partially specific to the trained odor and partially generalized to a novel odor, whereas 24 h after training, no specificity was detected and generalization was full. In B–D: *P<0.05 in KW- or U-tests, *P<0.025 in OSS-tests; NS P>0.05 in KW- or U-tests, NS P>0.025 in OSS-tests. Box plots show the median, 25% and 75% and 10% and 90% quartiles as midline, box boundaries and whiskers, respectively. For the preference values underlying the memory scores, see Fig. S1A. (C) Flies were trained with O and tested with either O or 1-octen-3-ol (Oen). Left: 20 min after training, memory scores differed between O–O and O–Oen conditions (U-test: U=73.00, P=0.0059, N=20, 16) and significant learned avoidance was found in each case (OSS-tests: P<0.0001 for O–O and P=0.0213 for O–Oen). Right: 24 h after training, memory scores were the same under O–O and O–Oen conditions (U-test: U=156.50, P=0.2447, N=20, 20) and reflected significant learned avoidance in each case (OSS-tests: O–O, P=0.0026; O–Oen, P=0.0118). Thus, generalization was only partial 20 min after training, while 24 h after training, it was full. (D) Flies were trained as in A, but solvent and an empty odor container took the place of odor and solvent, respectively. The memory scores did not significantly differ from zero either 20 min or 24 h after training (OSS-tests: P=0.2478 and P=0.8506 for 20 min and 24 h, respectively; N=28, each).