Skip to main content

Thank you for visiting You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

Experimental psychology

Event timing turns punishment to reward

Linking a smell with an electric shock does not always have an aversive effect in flies.


Can relief from pain be a pleasure? If so, noxious events should — despite their typically aversive effects — also have a ‘rewarding’ after-effect1,2,3. Through training fruitflies by using an electric shock paired with an odour, we show here that the shock can condition either avoidance of this odour or approach to it. These opposing behaviours depend on the relative timing of the shock and odour presentations during training, and indicate that a shock can act as either an aversive reinforcer or an appetitive one.


To measure both aspects of these bidirectional behavioural responses within the same set-up, we used fruitflies (Drosophila melanogaster) that had undergone odour-discrimination learning reinforced by electric shock4 (Fig. 1a). All experimental groups received the same amount of odour–shock training. The only variable was the interstimulus interval (ISI), which was the interval between the onset times of exposure to the odour for association (the ‘trained’ odour) and to the shock (Fig. 1a). Training sessions were repeated four times and were separated by a 20-minute rest in a food vial.

Figure 1: Bidirectional behavioural plasticity in associative learning.

a, Experimental procedure. Odour stimuli for conditioning: benzaldehyde and 3-octanol (ref. 11; presented for 15 s each; green boxes); unconditioned stimulus: electric shock (90 volts, 4 pulses within 16 s; pink lines). The odours are aversive to naive flies. The interstimulus interval (ISI) between the onset of the trained odour B and the shock is varied between groups, whereas the interval between the control odour A and shock is the same for all groups (−150 s). Relative preferences for odours A and B were compared between reciprocally trained groups (that is, the ones for which benzaldehyde was the trained odour were compared with the ones for which 3-octanol was the trained odour); the learning index was calculated as the difference between these preferences divided by two, to yield values between 100 and −100. b, Systematic analysis of conditioned behaviour (learning index, mean±s.e.m.) as a function of the ISI. Pink shading indicates duration of the electric shock. Conditioned behaviour was significant for the groups with ISI of −23 s, +3 s, +32 s and +42 s (P<0.005; one-sample t-test against zero). The significance level of each test was adjusted to 0.005 with a Bonferroni correction to avoid false positives by multiple tests.

The conditioned behaviour was tested 15 min after training in a forced-choice situation, by counting how many animals chose either a control or the trained odour (odour A or B, respectively; Fig. 1a). Positive learning indices indicate conditioned avoidance of the trained odour, whereas negative scores indicate conditioned approach to it.

During testing, flies showed opposite responses to the trained odour (either conditioned avoidance or approach), depending on the temporal sequence of odour and shock that they had experienced during training (Fig. 1b). If the odour preceded the shock, flies showed conditioned avoidance (for ISIs of −23 s and −3 s; P<0.005; Fig. 1b). However, when the shock preceded the odour, flies showed conditioned approach (for ISIs of +32 s and +42s; P<0.005; Fig. 1b). We conclude that flies were able to associate the same odour with either danger or safety. Control groups trained using very long ISIs gave no evidence of learning (for example, for ISIs of −83 s or +187 s, P>0.005 for forward or backward control, respectively; Fig. 1b).

We found that the effect of shock turns from punishing to rewarding in a time window around shock application (pink shading in Fig. 1b). This indicates that odours can act as predictors of danger when they precede shock during training but, owing to a long-lasting after-effect of shock, they can also be used to predict safety when they follow shock during training. Conditioned avoidance was stronger than conditioned approach (P<0.05, t-test: ISI, −23 s compared with +32 s). This quantitative comparison is possible because the two aspects of timing-dependent behavioural plasticity were directly measured within the same set-up, rather than indirectly2,5.

Bidirectional synaptic plasticity has a comparable dependence on timing: the sequence of two inputs determines whether synapses are potentiated or depressed6,7,8. This characteristic would lead to bidirectional associative learning if it occurred during association formation at the neuronal convergence site of odour and shock. Alternatively, the dual and opposing behavioural effects of shock could reflect a bidirectional modulation of internal reinforcement signalling, as found in mammalian dopaminergic neurons9,10. It will be interesting to investigate whether the appetitive effect of shock in flies shares a common neuronal circuitry with reward processing4. The detailed characterization of the rewarding after-effect of negative reinforcement should advance our understanding of the behavioural consequences of traumatic experience.


  1. 1

    Solomon, R. L. & Corbit, J. D. Psychol. Rev. 81, 119–145 (1974).

    CAS  Article  Google Scholar 

  2. 2

    Rescorla, R. A. & LoLordo, V. M. J. Comp. Physiol. Psychol. 59, 406–412 (1965).

    CAS  Article  Google Scholar 

  3. 3

    Wagner, A. R. in Information Processing in Animals: Memory Mechanisms (eds Spear, N. E. & Miller, R. R.) 5–47 (Erlbaum, Hillsdale, New Jersey, 1981).

    Google Scholar 

  4. 4

    Schwaerzel, M. et al. J. Neurosci. 23, 10495–10502 (2003).

    CAS  Article  Google Scholar 

  5. 5

    Hellstern, F., Malaka, R. & Hammer, M. Learn. Mem. 4, 429–444 (1998).

    CAS  Article  Google Scholar 

  6. 6

    Bi, G.-Q. & Poo, M.-M. Annu. Rev. Neurosci. 24, 139–166 (2001).

    CAS  Article  Google Scholar 

  7. 7

    Froemke, R. C. & Dan, Y. Nature 416, 433–438 (2002).

    ADS  CAS  Article  Google Scholar 

  8. 8

    Abbott, L. F. & Nelson, S. B. Nature Neurosci. 3, 1178–1182 (2000).

    CAS  Article  Google Scholar 

  9. 9

    Tobler, P., Dickinson, A. & Schultz, W. J. Neurosci. 23, 10402–10410 (2003).

    CAS  Article  Google Scholar 

  10. 10

    Ungless, M. A., Magill, P. J. & Bolam, J. P. Science 303, 2040–2042 (2004).

    ADS  CAS  Article  Google Scholar 

  11. 11

    Schwaerzel, M., Heisenberg, M. & Zars, T. Neuron 35, 951–960 (2002).

    CAS  Article  Google Scholar 

Download references

Author information



Corresponding author

Correspondence to Hiromu Tanimoto.

Ethics declarations

Competing interests

The authors declare no competing financial interests.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Tanimoto, H., Heisenberg, M. & Gerber, B. Event timing turns punishment to reward. Nature 430, 983 (2004).

Download citation

Further reading


By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.


Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing