{'fraction_non_alphanumeric': 0.044869306418219464, 'fraction_numerical': 0.04318711180124224, 'mean_word_length': 4.541950519899606, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
History information emerges in the cortex during learning

We learn from our experience but the underlying neuronal mechanisms incorporating past information to facilitate learning is relatively unknown. Specifically, which cortical areas encode history-related information and how is this information modulated across learning? To study the relationship between history and learning, we continuously imaged cortex-wide calcium dynamics as mice learn to use their whiskers to discriminate between two different textures. We mainly focused on comparing the same trial type with different history information, i.e., a different preceding trial. We found history information in barrel cortex (BC) during stimulus presentation. Importantly, history information in BC emerged only as the mouse learned the task. Next, we also found learning-dependent history information in rostrolateral (RL) association cortex that emerges before stimulus presentation, preceding activity in BC. History information was also found in other cortical areas and was not related to differences in body movements. Interestingly, a binary classifier could discriminate history information at the single trial level just as well as current information both in BC and RL. These findings suggest that past experience emerges in the cortex around the time of learning, starting from higher-order association area RL and propagating down (i.e., top-down projection) to lower-order BC where it can be integrated with incoming sensory information. This integration between the past and present may facilitate learning.

association cortex that emerges before stimulus presentation, preceding activity in BC. 23 History information was also found in other cortical areas and was not related to 24 differences in body movements. Interestingly, a binary classifier could discriminate 25 history information at the single trial level just as well as current information both in 26 BC and RL. These findings suggest that past experience emerges in the cortex around information with the learning process. Another important aspect of the history-55 learning relationship is the temporal aspect that enables integration of past 56 information with present sensory information. For example, does history information 57 emerges in cortex before present information arrives or do both past and present 58 information maybe emerge simultaneously in a certain cortical area? From the 59 temporal aspect, optogenetic silencing of PPC area during the inter-trial interval 60 affected performance, highlighting that higher-order cortical areas may maintain 61 history information before the incoming current stimulus (Akrami et al., 2018;Hwang 62 et al., 2017). 63 To study the history-learning relationship, we use wide-field cortical imaging 64 of mice learning to discriminate between two textures and focus on the cortex-wide 65 dynamics of history information. In a previous study using the same dataset, we 66 showed that in mice learning a whisker-based texture discrimination task, the activity 67 in task-related areas (e.g., barrel cortex -BC and rostrolateral association cortex -RL) 68 increases as they become experts (Gilad and Helmchen, 2020). RL is part of the PPC and 69 is located within the cluster of higher-order association areas surrounding V1. RL plays 70 pivotal roles in cross-modal sensory integration, learning and history, but the 71 relationship between history and learning in RL is unknown (Akrami et  to the preceding trial, we now demonstrate the emergence of history information as 75 the mouse gains expertise. Specifically, history information emerges in RL, just before 76 the stimulus presentation during the trials, and then is transferred to BC during the 77 texture touch period, which may aid in learning the rewarded stimulus. 78 The performance of all mice increased with training (5-11 days; ~500 112 trials/day) and eventually reached high discrimination levels (quantified by d-prime; d'; 113  Fig. 1e, Fig. s1). The fastest learning 116 mouse reached threshold in slightly less than thousand trials whereas mouse #4 took 117 substantially longer (Fig. s1). In addition, we defined a naïve (1 st day of recording), 118 learning (day of crossing the learning threshold; 2 nd or 3 rd day) and expert (last 119 recording day) phases for each mouse. All mice, after gaining expertise, showed strong 120 activation in the Barrel cortex (Fig 1. d, upper panel). This activation was during 121 stimulus representation, stronger in Hit trials compared to CR trials (Fig. 1d, lower  122 panel), not dependent on the texture type (i.e. if the hit was p100 or p1200). 123 Here, we focus on the history content for each trial type. We sub-grouped all 124 the Hit trials (i.e., the current trial type) based on the previous trial type: CR ("CR-Hit"; 125 n=423±74, mean±SEM), Hit ("Hit-Hit"; n=585±42), FA ("FA-Hit"; n=217±24) or Miss 126 ("Miss-Hit"; n=55±24; Fig.1f, g). "Miss-Hit" were not analyzed due to a small number 127 of trials. Our main analysis will compare "CR-Hit" (orange) and "Hit-Hit" (blue) trial 128 pairs, since they are present in large numbers during all phases in each mouse 129 separately ( Fig. 1g; But see Fig. s3 for a comparison of other trial pairs). We emphasize 130 that in this comparison, the current trial type is identical (i.e., Hit) whereas only the 131 pervious trial (i.e., the history, CR or Hit) differed, therefore eliminating activity 132 differences due to the current stimulus. 133 134 135

History information in BC emerges during learning 136
First, we focused on history-dependent information in BC, specifically during the stim-137 period. BC displayed higher activity during CR-Hit compared to Hit-Hit only during 138 learning and expert phases, but not during the naïve period (Fig. 2a, Fig. s2). This 139 difference was significant during the stim-period in learning and expert phases across 140 Behavioral setup for head-fixed texture discrimination with simultaneous wide-field calcium imaging and video monitoring of whisker motion and body movement. b. Trial structure and possible trial outcomes. pre-and stim-periods are marked in gray and light gray colors, respectively. c. 25 cortical areas used in this study grouped into auditory areas (green), association areas (pink), somatosensory + V1 areas (blue), and motor areas (red) d. Top: Example mean activation map (averaged during the stim period) for the Hit condition. BCbarrel cortex. Color denotes normalized fluorescence. Bottom: Time course of activity in BC for Hit (green) and CR (purple). Error bars are mean±SEM across trials (n=376 and 333 for Hit and CR respectively). e. Example of a learning curve (d′ as a function of trial number) of one mouse, fitted with a sigmoid function (solid black line). Red dashed vertical line indicates the learning threshold. gray rectangles mark the naive, learning and expert phases. f. Schematic diagram of the different trial types for a Hit trial preceded by a different trial (i.e., history): Hit-Hit (blue), CR-Hit (orange) and FA-Hit (gray). g. Probability of the different trial types along with the distribution of history for the Hit trial during the naïve, learning and expert phases (averaged across 7 mice).

152
We next quantified the emergence of history information with regard to the different 153 time scales, the trial structure (within seconds) or the learning profile (across days). 154 We first show 2D activity plots in BC for each trial pair (i.e., CR-Hit and Hit-Hit; showing 155 activity of only the Hit trial), where trial time is plotted on the x-axis and trial number 156 across learning time on the y-axis ( Fig. 3a; 100-trial bins regardless of trial pair). Both 157

Figure 2. History information in BC
a. Example of average BC response of Hit-Hit (blue) and CR-Hit (orange) from 2 mice (upper and lower row) in the naïve, learning and expert phases. Shaded bar depicts the stim period. Shadows are mean±SEM across trials (mouse 1: n=86/66, 90/70 and 166/173 Hit-Hit/CR-Hit for naïve, learning and expert phases respectively. mouse 6: n=94/80, 86/121 and 99/135) b. Grand average of BC activity during the stim period (-0.2:0.6ms) for the naïve, learning and expert phases. Boxes indicate quartiles at 25/75 th percentile across mice (n=7). c. Same as a but for body and whisker movements in the Hit-Hit (light gray) and CR-Hit (dark gray) trials. d. Same as b but for body (top) and whisker (bottom) movements. *p < 0.05; n.s. not significant; Wilcoxon signed-rank test.
trial pairs display an increase in activity during the stim-period shortly after passing the 158 learning threshold. We defined a history modulation index as the difference in activity 159 for BC between the two pair types (Hit-CR minus Hit-Hit). History modulation increased 160 around the stim-period only in learning and expert phases but not in the naïve case 161 (Fig 3b, c). A significant history modulation was defined as values exceeding mean±2SD 162 of a trial-shuffled sample distribution (n=1000 iterations) and was performed for each 163 mouse separately (Fig. 3b). The onset of the history modulation was defined as the first 164 time frame reaching significant values (red arrows in Fig. 3b) and was found in BC to 165 be during the stim-period ( Fig. 3d; 0.05±0.32s, -0.1±0.27s 1s, median±SEM relative to 166 texture stop in learning and expert phases respectively). We note that in the expert 167 phase there is also a small peak exceeding the significance around the cue, indicating 168 history information in BC may be present to some extent before stimulus presentation. 169 Next, we quantified the history modulation in BC during the stim period as a function 170 of the learning time course. History modulation in BC had the steepest increase after 171 each mouse crossed its learning threshold (Fig. 3e, f). The onset of the history 172 modulation was defined as the first trial bin exceeding the trial-shuffled sample 173 distribution and was found to occur shortly after the learning threshold, highly 174 correlated with the learning threshold indicating strong relationship between history 175 emergence and learning of each individual mouse (Fig. 3g, h; 500±83 trials, 176 median±SEM, r=0.97 p<0.001, spearman correlation). Note that our onset 177 measurement is relatively strict and an increase in history information can be observed 178 shortly (i.e., tens of trials) after crossing the learning threshold (Fig. 3d). 179 We expanded our history analysis also for the pair types other than CR-Hit and Hit-Hit. 180 For sufficient trial numbers, we focused on the learning phase. First, we compare FA-181 Hit to Hit-Hit and CR-Hit, i.e., the same current trial type but preceded by an error trial 182 (FA). Response in BC for FA-Hit was similar to Hit-Hit and significantly lower compared 183 to CR-Hit ( Fig. s3; p<0.05 signed rank test). This result highlights that specifically a 184 correct rejection (CR), rather than the stimulus (i.e., texture) type, has a strong history 185 effect. Next, we compared FA-CR, Hit-CR and CR-CR, i.e., similar to the previous 186 comparison differing only in the current trial type (CR instead of Hit). There was no 187 significant difference between the different pairs, indicating that the current trial type, 188 i.e., Hit in this case, has a strong effect along with the history of the CR ( We note that other 205 areas, e.g., different association areas, also encoded history-dependent information 206 especially during learning and expert phases. Taken together, these results indicate 207 that BC encodes history-dependent information that emerges during the stim period 208 and just after learning. These results gave us the motivation to examine history-209 dependent information at time periods before texture touch. 210 Example from one mouse of the history modulation (activity in CR-Hit minus activity in Hit-Hit) in BC along the trial structure in the naïve, learning and expert phases. Dashed gray line is the mean ± 2 SD of the trial-shuffled data (n=1000 iterations). The first-time frame crossing the shuffle data is defined as the onset and is marked in red. c. Mean history modulation in BC along trial time. Shadows depict mean±SEM across mice (n=7). d. Median onset of history modulation. Boxes indicate quartiles at 25/75 th percentile across mice (n=7). e. Example from one mouse of the history modulation along learning dimension. Dashed gray line is the mean ± 2 SD of the trial-shuffled data (n=1000 iterations). The first-time frame crossing the shuffle data is defined as the onset for learning and is marked in red. The vertical red dashed line (trial 0) marks the learning threshold. f. Mean history modulation in BC along the learning profile aligned to the learning threshold of each mouse (time 0). Shadows depict mean±SEM across mice (n=7). g. Onset of the history modulation for learning as a function of the learning threshold. Each point is one mouse (n=7). h. Median onset of history modulation relative to the learning threshold. Boxes indicate quartiles at 25/75 th percentile across mice (n=7).

History information in RL before sensation 214
We next focused our analysis on the pre-period, just before texture touch (-1 to -0.6 215 sec before texture stop). Mean activity maps during the pre-period highlight activity in 216 association area rostrolateral (RL) that is present for both CR-Hit and Hit-Hit pairs 217 during the naïve, learning and expert phases ( Fig. 5a;(Gilad and Helmchen, 2020)) RL 218 pre-period activity is higher in CR-Hit compared to Hit-Hit mostly during learning and 219 expert phases. In addition, higher RL activity in CR-Hit pair starts even before the pre-220 period, indicating that history-information is not directly related on the current 221 stimulus (Fig. 5b). The grand average of all 25 cortical areas, highlights the emergence 222 of history-dependent information emerging during learning, especially in RL, but also 223 in other association and sensory areas (Fig. 5c). 224 RL activity was significantly higher in CR-Hit compared to Hit-Hit trials in the 225 pre-period during the expert phase ( Fig. s4; signed rank test, p<0.05, similar trend for 226 the learning phase but insignificant; not significant for the naïve phase). The onset of 227 history modulation within the trial structure (as in Fig. 3d) was earlier in RL compared 228 to BC in both learning (-0.15±0.32s and 0.05±0.32s, median±SEM in RL and BC 229 respectively) and expert phases (-0.75±0.2s and -0.1±0.27s, median±SEM in RL and BC 230 respectively) but not significantly different (p>0.05, signed rank test). The onset for the 231 history modulation with relation to the learning profile in RL (similar to Fig. 3h; During 232 the pre-period) was also earlier than BC, but not significantly different (200±162 trials 233 after crossing threshold compared to 500±83 in BC; median±SEM, p>0.05 singed rank 234 test). Taken together, these results indicate that as mice gain expertise, RL encodes 235 history information before the next stimulus occurs, which may inform through its 236 projections to BC where history information then could be integrated with information 237 of the current incoming texture. a. Mean activity maps averaged within the pre-period (-1 --0.8 seconds relative to texture stop) of CR-Hit (left) Hit-Hit (right) during the naïve (top), learning (middle), expert (bottom) phases. Color bar denotes normalized fluorescence (∆F/F). 2D top-view atlas is superimposed in gray. b. Example from one mouse of average RL response of Hit-Hit (blue) and CR-Hit (orange) in the naïve (top), learning (middle) and expert (bottom) phases. Shaded gray bar depicts the pre-period (-1--0.6). Shadows are mean±SEM across trials (n=51/54, 92/78 and 168/173 Hit-Hit/CR-Hit for naïve, learning and expert phases respectively) c. Grand average neuronal activity during the pre-period (-1 --0.6) for Hit-Hit (blue) and CR-Hit (orange) in all 25 areas for the naïve (top), learning (middle) and expert (bottom) phases. Error bars depict mean±SEM across mice (n=7).

Past versus present discrimination power in BC and RL 244
How well can BC and RL activity discriminate at the single trial level history information 245 compared to the information of the current stimulus? To do this, we computed the 246 receiver operating characteristics (ROC) analysis between specific trial types (Gilad et 247 al., 2020(Gilad et 247 al., , 2013 , along with the area under the curve (AUC) quantifying the 248 discrimination power at the single trial level (Methods). We calculated the AUC 249 between two types of trials (Fig. 6a): 1) Activity between CR-Hit and Hit-Hit pairs based 250 on the activity during the Hit trial. This is defined as 'history-AUC' since only the 251 previous trial is different. 2) Activity between the current Hit and CR trials. This is 252 defined as the 'Current-AUC' because the current trial types are different (both in 253 terms of stimulus type and action  c. Grand average of history and current-AUC measures during the stim period in the expert phase. Error bars indicate mean±SEM across mice(n=7). d. Same as in a but for the learning phase. Error bars as in a, values significantly differ from chance (0.5) for history-AUC (p<0.05, 2 tail ttest, for both BC and RL), but not for the current-AUC in RL. e. same as in c, but for the pre-period during the learning phase. *p < 0.05; n.s. not significant; Wilcoxon signed-rank test.
AUC in both BC and RL has a discrimination power in the stim period that is not 268 significantly different than that of the current-AUC (Fig. 6b, c; p>0.05; singed rank test). 269 In other words, we found that BC and RL discriminate past stimuli just as well as the 270 current stimuli. In addition, during the learning phase, RL and to some extent BC, 271 display a significantly higher history-AUC compared to the current-AUC, specifically in 272 the pre-period (Fig. 6d, e; p<0.05; Singed rank test). This indicates that history 273 information is discriminative at the single trial level before stimulus onset. Taken 274 together, we find that BC and RL can encode the past just as well as the present. 275 276

Discussion: 277
History information is trial-type specific 278 We have identified cortex wide encoding of history information that emerges as mice 279 learn to discriminate between two textures. History information was not dependent 280 on the current stimulus and emerged in RL association area before texture touch. Our 281 results indicate that a previous CR trial will lead to higher activity in BC and RL 282 compared to a previous Hit trial. This difference is probably not due to pure sensory 283 differences in the previous trial since the effect was not present after FA trials (sup Fig.  284 s3, left panel). In addition, mice trained to lick the P1200 texture displayed a similar 285 bias to the CR-Hit, further indicating that these differences are not purely sensory 286 related. Moreover, this difference is probably not related to the previous motor action 287 (e.g., either lick or no-lick). During the current trial, body and whisker movements were 288 not significantly different, emphasizing that there are no motor-related differences 289 based on the previous trial (Fig. 2c, d). The fact that these differences emerged only 290 after learning implies that these differences are not purely sensory or motor related 291 but rather reflect internal history-related information. It may be that in a go/no-go 292 discrimination task the mouse mainly learns not to lick for the no-go texture (i.e., CR) 293 making the information of a CR trials more pronounced relatively to a Hit trials. 294 Another possibility is that a previous CR will cause a pronounced anticipatory state for 295 the incoming texture, leading to enhanced cortical activity. Again, we did not find any 296 consistent differences in motor movements based on the previous trials making this 297 possibility less likely. In summary, our results indicate that history-dependent 298 information emerges internally in cortex as mice learn to discriminate between two 299 stimuli. 300 such as BC is interesting by itself, but also raises the question of where is its origin. 308

History information emerges in RL and transferred to BC
Interestingly, we show that history information emerges in RL before texture touch 309 implying that RL may transfer history information in a top-down manner to BC for 310 optimal sensory integration. 311 The presence of history information in RL before the sensation period implies 312 that RL may play a crucial role in linking past experience to ongoing sensory integration. The fact that history information emerges only after learning, implies that it 329 encodes a subjective value or association of a certain past stimulus. It may be that only 330 once the value of a certain stimulus has been established, e.g., by strengthening 331 indirect connections between basolateral amygdala (that has a role in associative 332 memory) and RL, history information can aid in efficiently encoding the incoming 333 stimulus. In light of this discussion, we suggest that the consolidation of a certain 334 association (in our case a CR), induces long-term synaptic plasticity of top-down 335 projections from higher-order association area (e.g., RL) to a lower-order sensory area 336 (e.g., BC). This projection-specific potentiation may better recruit sensory cortex in the 337 context of the immediate previous history. 338 339

Mechanisms for integrating past and present 340
The wide-field signal measured in our study reports bulk population activity specifically 2018b). Mice were anesthetized with 2% isoflurane (in pure O2) and body temperature 408 was maintained at 37 °C. We applied local analgesia (lidocaine 1%), exposed and 409 cleaned the skull, and removed some muscles to access the entire dorsal surface of the 410 left hemisphere (Fig. 2a; ~6 × 8 mm2 from ~3 mm anterior to bregma to ~1 mm 411 posterior to lambda; from the midline to at least 5 mm laterally). We built a wall around 412 the hemisphere with adhesive material (iBond; UV-cured) and dental cement "worms" 413 (Charisma). Then, we applied transparent dental cement homogenously over the 414 imaging field (Tetric EvoFlow T1). Finally, a metal post for head fixation was glued on 415 the back of the right hemisphere. This minimally invasive preparation enabled high-416 quality chronic imaging with high success rate. 417 418 Texture discrimination task. 419 Mice were trained on a go/no-go discrimination task (Fig. 1a) using a data acquisition 420 interface (USB-6008; National Instruments) and custom-written LabVIEW software 421 (National Instruments). Each trial started with an auditory cue (stimulus cue; 2 beeps 422 at 2 kHz, 100-ms duration with 50-ms interval), signaling the approach of either two 423 types of sandpapers (grit size P100: rough texture; P1200: smooth texture; 3M) to the 424 mouse's whiskers as 'go' or 'no-go' textures ( Fig. 1a; pseudo-randomly presented with 425 no more than three repetitions). Sandpapers were mounted onto panels attached to a 426 stepper motor (T-NM17A04; Zaber) mounted onto a motorized linear stage (T-427 LSM100A; Zaber) to move textures in and out of reach of whiskers. The texture stayed 428 in touch with the whiskers for 2 s, and then it was moved out after which an additional 429 auditory cue (response cue; 4 beeps at 4 kHz, 50-ms duration with 25-ms interval) 430 signaled the start of a 2-s response period. The stimulus and response cues were 431 identical in both textures. The interval between the trails was 6 s (8 s from response to 432 next cue). A water reward (~3 µL) was given to the mouse for licking for the go texture 433 only after the response cue ('Hit'), i.e. for the first correct lick during the response 434 period ( Fig. 1a; lick were detected using a piezo sensor). Punishment with white noise 435 was given for licking for the no-go texture ('false alarms'; FA). Licking before the 436 response cue was neither rewarded nor punished. Reward and punishment were 437 omitted when mice withheld licking for the no-go ('correct-rejections', CR) or go 438 ('Misses') textures. 439 Training and performance. Five mice were trained to lick for the P100 texture (mice 440 #1-4 and 6) and 2 mice were trained to lick for the P1200 texture (mice #5 and 7). Mice 441 were first handled and accustomed to head fixation before starting water scheduling. 442 Before imaging began mice were conditioned to lick for reward after the go texture 443 (presented within a similar trial structure as the task itself). Imaging began only after 444 mice reliably licked for the response cue (typically after the first day; 200-400 trials). 445 On the first day of imaging, mice were presented with the 'go' texture and after 50 446 trials the 'no-go' texture was gradually introduced (starting from 10% and increasing 447 by 10% approximately every 50 trials (Guo et al., 2014) until reaching 50% probability 448 for the no-go texture by the end of the day. 6 out of the 7 mice learned the task within 449 3-4 days after around a thousand trials (Supplementary Fig. 1 Whisker and body tracking. In addition to wide-field imaging, we tracked movements 501 of the whiskers and the body of the mouse during the task (Fig. 1a). The mouse was 502 illuminated with a 940-nm infrared LED. Whiskers were imaged at 50 Hz (500 × 500 503 pixels) using a high-speed CMOS camera (A504k; Basler), from which we calculated 504 time course of whisking envelope and the time of first touch (see below). An additional 505 camera monitored the movements of the mouse at 30 Hz (The imaging source; DMK 506 22BUC03; 720 × 480 pixels). We used movements of both forelimbs and the head/neck 507 region to assess body movements, to reliably detect large movements ( Fig. 1a; see 508 Data Analysis below). 509 Calculating body movements. We used a body camera to detect general movements 510 of the mouse (30 Hz frame rate). For each imaging day, we first outlined the forelimbs 511 and the neck areas (one area of interest for each), which were reliable areas to detect 512 general movements. Next, we calculated the body movement (1 minus frame-to-frame 513 correlation) within these areas as a function of time for each trial. We than averaged 514 all the defined body areas to one "body" vector. 515 Whisker tracking. The average whisker angle across all imaged whiskers was 516 measured using automated whisker tracking software (Knutsen et al., 2004) . The mean 517 whisker envelope was calculated as the difference between maximum and minimum 518 whisker angles along a sliding window equal to the imaging frame duration (50 ms; 519 (Gilad et al., 2018b)). Whisker envelope was normalized just before the auditory cue 520 similar to wide-field data (Frame zero). In addition, we manually detected the first 521 frame, in which any whisker touched the upcoming texture, using the movies from the 522 whisker camera (LabVIEW custom program). The first touch occurred on average 0.33 523 and 0.34 s before the texture stopped for naïve and expert mice respectively. Time of 524 first touch did not differ between expert and naïve mice (P > 0.05; Mann-Whitney U-525 test; n = 7 mice). We note that the first touch occurred mostly (but not exclusively) in 526 the pre-period from −1 to −0.5 relative to texture stop. 527 Data analysis. Data analysis was performed using Matlab software (Mathworks). All 528 mice were continuously imaged during learning (5-11 days). Wide-field fluorescence 529 images were sampled down to 256 × 256 pixels and pixels outside the imaging area 530 were discarded. This resulted in a spatial resolution of ~40 μm/pixel and was sufficient 531 to determine cortical borders, despite further scattering of emitted light through the 532 tissue and skull. Each pixel and each trial were normalized to baseline several frames 533 before the stimulus cue (frame 0 division). Our main focus was on the history effect. 534 Because the hit trails had the largest portion from all trails, we focused on the hit trials. 535 We sub grouped all the Hit trials based on the type of the preceding trial as follow: CR-536 Hit -Hit trials that were preceded by correct rejection trial. Hit-Hit -Hit trials that were 537 preceded by a Hit trial. FA-Hit -hit trials that were preceded by a false alarm trial. We 538 mainly focused on comparing Hit-Hit and CR-Hit pairs since they had a large proportion 539 in naïve, learning and expert phases (but see Figure s4). We defined two time periods 540 within the trial structure: pre (−1 to 0.6 s relative to texture stop) and stim (−0.2 to 0.2 541 relative to texture stop; Fig. 1a). A learning threshold was defined as the bin in which the d' crossed the inflection point 551 (half point) of the learning curve sigmoid fit. (Fig. s1). 552 Defining the learning phases: We defined the naïve, learning and expert phase each 553 as one day of recordings, the naïve day was defined as the first day to have enough 554 correct rejections that the performance is still before the crossing threshold (typically 555 the 2nd recording day). The learning day was defined as the day that the mouse 556 crossed the learning threshold, and the expert was defined as the last day of the mouse 557 (usually the 5th day) 558 559 Calculating history modulation and onset: We defined the 'history modulation' as the 560 difference between the average activation of all CR-Hit and Hit-Hit trials. To calculate 561 significance of history modulation, we calculated the sample distribution by trial 562 shuffling between CR-Hit and Hit-Hit trials (n=1000 iterations). We than defined the 563 onset of the history modulation as the first bin exceeding mean ± 2 SD of the sample 564 distribution. We calculated this history modulation and significance across the trial 565 dimension (every frame) and across learning dimension (every 100 trials). In the 566 learning dimension, we calculated the average activity in the stim period (-0.2:0.2) of 567 all the CR-Hit and Hit-Hit trials that were falling within each 100 trials bin. 568 Discrimination power between hit trials sub grouped by history. To measure how well 569 could neuronal populations discriminate between go and no-go textures, we calculated 570 a receiver operating characteristics (ROC) curve and calculated its area under the curve 571 (AUC; with a value of 0.5 indicating no discrimination power). This can be done for a 572 given area, each time frame within each learning phase separately (Fig. 6). 573 574 Statistical analysis. In general, the Wilcoxon signed-rank test to compare a 575 population's median to zero (or between two paired populations). Multiple group 576 correction was used when comparing between more than two groups.