A) Mice acquired within-session freezing during Aversive encoding. Mice that received high shocks (1.5 mA) displayed more freezing than mice that received low shocks (0.25 mA) (low-shock, n = 10 mice; high-shock, n = 12 mice). B) Mice responded robustly to each foot shock. High-shock mice responded more strongly to each shock than low mice did (low-shock, n = 10 mice; high-shock, n = 12 mice). C) Relative to the first calcium imaging recording, mice showed comparable fractions of observed cells across the remaining sessions (low-shock, n = 8 mice; high-shock, n = 10 mice). D) Locomotion across the 1 hr offline period after Neutral encoding (Offline 1) and after Aversive encoding (Offline 2) in low- and high-shock mice (in arbitrary units). Mice showed decreased locomotion across the offline period on both days. Low Shock mice did not locomote differently from high-shock mice during either offline period (low-shock, n = 10 mice; high-shock, n = 12 mice). E) During Offline 1 after Neutral encoding, cells that were active during Neutral encoding (Neutral ensemble) made up ~25-30% of the offline cell population (pie charts) (X2 = 0.122, df = 1, p = 0.73). The Neutral ensemble was more highly active than the Remaining ensemble during the offline period (line graphs; A.U.). There was a main effect of Ensemble (F1,159 = 59.19, p = 1.4e-12), no effect of Amplitude (F1,13 = 0.039, p = 0.85), and an effect of Time (F1,159 = 4.33, p = 0.039), and all interactions p > 0.05 (low-shock, n = 7 mice; high-shock, n = 8 mice; 659 Offline 1 cells recorded per mouse on average). F) During Offline 2 after Aversive encoding, similar proportions of previously active cells were reactivated across low- and high-shock groups (pie charts) (X2 = 0.326, df = 3, p = 0.955). However, ensembles were differentially reactivated based upon the amplitude of the Aversive experience (Ensemble x Amplitude: F3,331 = 5.36, p = 0.0013) (line graphs; A.U.). In low-shock mice, the Neutral, Aversive, and Overlap ensembles were more highly active than the Remaining ensemble (contrast, t18 = 4.22, p = 0.0005). Additionally, these ensembles were differentially active relative to one another (F2,12 = 4.03, p = 0.046). This was driven by the Neutral ensemble being less active. The Neutral ensemble was less active than the Aversive and Overlap ensembles (t12 = 2.83, p = 0.03) while the Aversive ensemble was no differently active than the Overlap ensemble (t12 = 0.19, p = 0.85). In high-shock mice, the Neutral, Aversive, and Overlap ensembles were all more highly active than the Remaining ensemble (t21 = 4.36, p = 0.0003), but these three ensembles were no differently active from each other (F2,14 = 1.52, p = 0.25). In high-shock mice compared to low-shock mice, the Overlap and Aversive ensembles were less active than in high-shock mice (Overlap ensemble: t75.43 = 2.44, p = 0.03; Aversive ensemble: t65.83 = 3.59, p = 0.003). (low-shock, n = 7 mice; high-shock, n = 8 mice; 705 Offline 2 cells recorded per mouse on average). G) Aversive ensemble reactivation compared to Remaining ensemble during Offline 2. Ensemble reactivation here is measured as it is during Offline 1 following Neutral encoding (Extended Data Fig. 4e). There is a significant effect of ensemble (Aversive vs Remaining) (F1,159 = 90.14, p = 0.00). There is a significant effect of time (F1,159 = 4.05, p = 0.046). There is no significant effect of Amplitude (low vs high-shock) (F1,13 = 0.045, p = 0.84) (low-shock, n = 7 mice; high-shock, n = 8 mice). H) During Offline 1, burst event frequency gradually decreased across the hour (F11,143 = 4.43, p = 1.0e-5). No difference across shock amplitudes (F11,13 = 0.31, p = 0.587) (low-shock, n = 7 mice; high-shock, n = 8 mice). Significant interaction between Time and Amplitude (F11,143 = 1.87, p = 0.047). Follow-up repeated measures ANOVAs showed that both low- and high-shock groups showed a significant decrease in event rate across time (low-shock: F11,66 = 4.13, p = 0.0001; high-shock: (F11,77 = 2.43, p = 0.01). I) During Offline 2, burst event frequency decreased across time (F11,143 = 6.69, p = 0.000054). No difference across shock amplitudes (F1,13 = 0.0056, p = 0.94) (low-shock, n = 7 mice; high-shock, n = 8 mice). J) During Offline 2, bursts as defined by each ensemble (rather than by whole population) decreased across the hour, with comparable frequencies across ensembles and amplitudes (low-shock, n = 7 mice; high-shock, n = 8 mice). K) Time-lagged cross correlations between the Overlap ensemble and the Neutral and Aversive ensembles during the offline period. Each of the three ensembles (Overlap, Neutral, and Aversive) were binned into 120 sec bins. Each time bin of Overlap ensemble activity was cross-correlated with the corresponding time bin of Neutral ensemble and Aversive ensemble activity. Cross-correlations were computed with a maximum time lag of 5 frames (or, ~160 ms). For each mouse, the correlations were averaged across all time bins to get an average cross-correlation between the Overlap ensemble and Neutral ensemble (i.e., Overlap x Neutral) and the Overlap ensemble by Aversive ensemble (i.e., Overlap x Aversive). There was a significant interaction between Ensemble Combination and low- vs high-shock group (F1,13 = 6.70, p = 0.02) (low-shock, n = 7 mice; high-shock, n = 8 mice). Post-hoc tests revealed that in high-shock mice, Overlap x Neutral correlations were higher than Overlap x Aversive correlations (t7 = 3.97, p = 0.01) whereas they were no different in low-shock mice (t6 = 0.83, p = 0.44). L) As in Fig. 4d, the whole population was used to define bursts and the z-scored mean population activities were used to define participation of each ensemble. Co-participation was defined as a whole population burst during which multiple ensembles participated simultaneously. There were four possible combinations (from left to right: Overlap x Neutral, Overlap x Aversive, Neutral x Aversive, Overlap x Neutral x Aversive). During burst periods, there was a significant interaction between Ensemble Combination and low- vs high-shock (p = 0.01), suggesting that the patterns of co-bursting varied in low- vs high-shock mice. Post-hoc tests revealed that in low-shock mice, co-participation between all 3 ensembles was less likely to occur than the other combinations (t18 = 4.73, p = 0.0003), while in high-shock mice, co-participation between all 3 ensembles occurred no differently than the other combinations (t21 = 0.358, p = 0.72). Additionally, in the high-shock group, the Overlap ensemble preferentially co-participated with the Neutral ensemble compared to with the Aversive ensemble (t21 = 2.373, p = 0.05), whereas in the low-shock group, the Overlap ensemble participated no differently with the Neutral and Aversive ensembles (t18 = 1.196, p = 0.25) (low-shock, n = 7 mice; high-shock, n = 8 mice). M) During non-burst periods, co-participation between all 3 ensembles was less likely than the other combinations (t39 = 10.92, p = 1.98e-13); however, there was no effect of low- vs high-shock (F1,13 = 0.038, p = 0.847) and no interaction (F3,39 = 0.198, p = 0.897) (low-shock, n = 7 mice; high-shock, n = 8 mice). N) Chance levels of ensemble independent and co-bursting. Left: The chance levels of independent bursting of the Overlap ensemble was higher than Neutral or Aversive independent bursting (F2,26 = 6.61, p = 0.005). There was no difference between low- vs high-shock groups (F1,13 = 0.030, p = 0.87) and no interaction (F2,26 = 0.96, p = 0.40). Right: Chance levels of triple co-bursting was much lower than of any combination of two ensembles (F3,39 = 98.3, p = 3e-18). There was no difference between low- vs high-shock groups (F1,13 = 0.07, p = 0.79) and no interaction (F3,39 = 0.20, p = 0.90) (low-shock, n = 7 mice; high-shock, n = 8 mice). O) Ensemble independent and co-bursting normalized by chance. Left: Overlap independent bursting was higher than Neutral or Aversive independent bursting (F2,26 = 13.82, p = 0.00008). There was no difference between low- vs high-shock groups (F1,13 = 0.69, p = 0.42) and no interaction (F2,26 = 2.2, p = 0.13). Right: Overlap x Neutral co-bursting was more likely to occur than Overlap x Aversive co-bursting in high-shock mice (t7 = 3.06, p = 0.043) but not in low-shock mice (t6 = 1.25, p = 0.26) (low-shock, n = 7 mice; high-shock, n = 8 mice). P) Correlation between Aversive/Novel ensemble overlap with Novel recall freezing. Left: separate regression lines for low- vs high-shock mice. Right: one regression line for all mice. There was no correlation between Aversive/Novel ensemble overlap and Novel recall freezing (R2 = 0.005, p = 0.86) (low-shock, n = 7 mice; high-shock, n = 8 mice). Q) Cells active only during the Neutral experience and not the Aversive experience were more likely to be reactivated when mice were placed back in the Neutral context, compared to when they were placed in a Novel context (F1,12 = 24.44, p = 0.0003). There was no effect of shock amplitude (F1,12 = 3.08, p = 0.10) (low-shock, n = 6 mice; high-shock, n = 8 mice). R) Cells active during the Aversive experience and not the Neutral experience were no differently reactivated in Neutral vs Novel contexts. (Amplitude: F1,12 = 0.029, p = 0.869; Context: F1,12 = 1.39, p = 0.261; Amplitude x Context: F1,12 = 0.14, p = 0.71) (low-shock, n = 6 mice; high-shock, n = 8 mice). S) Cells active during both the initial Neutral and Aversive experiences were subsequently more likely to be reactivated in the Neutral context compared to Novel context in high-shock mice (t7 = 8.53, p = 0.00012), but not low-shock mice (t5 = 0.55, p = 0.61; Context x Amplitude: F1,12 = 10.33, p = 0.007) (low-shock, n = 6 mice; high-shock, n = 8 mice).