A) Schematic of calcium imaging experiment performing retrospective memory-linking with no-shock during Aversive encoding. Mice underwent Neutral encoding followed by Aversive encoding two days later, during which they received 0 mA shocks (i.e., no shocks). In the subsequent three days, mice were tested in the Aversive context, followed by Neutral and Novel recall, counterbalanced. This experiment was run one time. B) Behaviour during Aversive encoding. Left: We measured locomotion at the same timepoints as in Extended Data Fig. 4b, where low- and high-shock mice received footshocks. As expected, mice did not display a change in locomotion during these timepoints, in contrast to low- and high-shock mice in Extended Data Fig. 4b. Right: As expected, mice did not display an increase in freezing across the Aversive encoding session, in contrast to low- and high-shock mice in Extended Data Fig. 4a. C) Locomotion during the offline periods. Locomotion gradually decreased throughout the offline period during both Offline 1 and Offline 2 (n = 6 mice). D) Freezing during recall. Left: Mice froze minimal levels during Aversive recall. Right: Mice froze no differently in Neutral vs Novel recall (t5 = 1.52, p = 0.19) (n = 6 mice). E) SVM performance during encoding. An SVM predicted Neutral vs Aversive encoding context more accurately than shuffled controls, as in Extended Data Fig. 7a (t5 = 4.77, p = 0.005) (n = 6 mice). F) Chance levels of ensemble independent and co-bursting during the offline period. Left: there were no differences in chance levels of ensemble independent participation (F2,10 = 1.07, p = 0.38). Right: there were no differences in chance levels of co-bursting of any two ensembles, and co-bursting of two ensembles was higher than co-bursting of all three (F3,15 = 20.99, p = 0.000013) (n = 6 mice). G) Ensemble independent and co-bursting normalized by chance during the offline period. Left: independent participation of the three ensembles. Overlap ensemble independent participation was higher than either Aversive (t5 = 6.31, p = 0.004) or Neutral (t5 = 3.8, p = 0.019) independent participation. Middle: Ensemble co-bursting of all combinations. Right: Replotting of co-bursting between only two ensembles. There was no difference in co-bursting between the ensemble pairs (F2,10 = 1.29, p = 0.32) (n = 6 mice).