Extended Data Fig. 5: Contingency discriminating and invariant coactivity patterns show distinct relationships to task phase and performance.

a, Time-course of pattern strength changes with mice as Ns. Contingency X-discriminating and contingency Y-discriminating patterns were pooled and the strength of all patterns of a given type in its preferred contingency were averaged per mouse and the mean value quantified in exploration/learning sessions. Dashed lines represent mean pattern strength in Control enclosure. Linear regression of strength against time during Exploration (contingency-invariant: r = 0.27, P = 8.15×10-4; contingency-discriminating: r = 0.20, P = 0.02) and Learning (contingency-invariant: r = 0.19, P = 9.30×10-4; contingency-discriminating: r = 0.21, P = 4.92×10-4). Slopes of contingency invariant patterns showed a trend towards being higher than those of contingency discriminating patterns during exploration (slope = 0.0041 ± 0.0012 and 0.0025 ± 0.0015 units/minute respectively; Mann Whitney U test (two-sided): U = 25.0, P = 0.06) but not during learning (slope = 0.0038 ± 0.0015 and 0.0021 ± 0.0007 units/minute respectively; Mann Whitney U test (two-sided): U = 36.0, P = 0.24). N = 10 animals for contingency invariant patterns but 9 animals for contingency discriminating patterns as no such patterns were detected in one animal. b, Increases in contingency-invariant and contingency-discriminating pattern strengths plotted as a function of learning trials. Contingency X-discriminating and Y-discriminating patterns were pooled, and the coactivity strength of each pattern was quantified in learning trials of its preferred contingency. Linear regression of strength against trials (contingency-invariant: r = 0.04, P = 0.020; contingency-discriminating: r = 0.13, P = 1.05×10-8). Shaded area represents variability (Standard error of the mean) across coactivity patterns. c, No changes in member neuron firing rates (z-scored) across learning trials. Linear regression of firing rate against trials (contingency-invariant: r = 0.0016, P = 0.94; contingency-discriminating: r = 0.0022, P = 0.94). Shaded area represents variability (Standard error of the mean) across coactivity pattern members. d, Temporal correlations (Pearson r values) amongst each member neuron of a pattern and other members in the same pattern between exploration and learning (Mean Pearson correlation: Contingency-invariant members: exploration: 0.037 ± 0.004, learning: 0.098 ± 0.005; contingency-discriminating members: exploration: 0.019 ± 0.003, learning: 0.052 ± 0.003). e, Z-scored contingency discriminating pattern strength in the same contingency and the opposite contingency during tone and drop delivery. This is the point when animals’ behavior is maximally different between contingencies, as animals head towards opposite dispensers (Fig. 1e and Extended Data Fig. 2b). Despite this, the normalized time course of coactivity pattern strength was indistinguishable across contingencies (Two way repeated measures ANOVA: No main effect of contingency: F(1)=1.5×10-26, P = 1.00, η2 = 9.39×10-31, Main effect of time: F(117)=3.41, P = 7.61×10-32, η2 = 0.025, No contingency:time interaction: F(117)=0.76, P = 0.98, η2 = 0.006). f, Pattern strength before the animal’s choice during probe trials, on days where overall probe performance was above chance, averaged per mouse. Contingency discriminating mean strength: correct: 0.14 ± 0.04, incorrect: 0.09 ± 0.05; contingency-invariant: correct: 0.23 ± 0.08, incorrect: 0.23 ± 0.09. N = 7 animals for both contingency-discriminating and contingency-invariant patterns reflecting the number of animals with recording days in which: 1) units were recorded and isolated; 2) animals performed above chance in the probe; 3) coactivity patterns of the indicated type were detected. g, Contingency-discriminating pattern member firing rate is indistinguishable before correct vs incorrect probe trials on days where overall probe performance was above chance. Mean member rate: correct: 2.32 ± 0.26 Hz, incorrect: 2.15 ± 0.26 Hz. h, Mouse running speed before correct and incorrect trials. Mean speed: correct: 6.90 ± 0.28 cm.s-1, incorrect: 6.58 ± 0.43 cm.s-1. i, Contingency-discriminating coactivity patterns are indistinguishable before correct trials compared to incorrect trials on days when the animal’s overall probe performance is not above chance level. Mean strength: correct: 0.086 ± 0.019, incorrect: 0.090 ± 0.023. j, Decoding accuracy using 1000 ms pairwise correlations compared to shuffled controls. (Mean accuracy; Actual: 75.7 ± 2.1%, shuffled: 48.8 ± 0.2%; N = 23 recording days). k, Contingency-discriminating coactivity patterns, detected across 1000 ms windows, are not stronger before correct compared to incorrect choices on memory probe trials, on days where overall probe performance was above chance. Mean strength: correct: 0.017 ± 0.006, incorrect: 0.016 ± 0.004.