Training Village hardware and software.

a, Schematic layout of the TV, composed of three main elements: the home cages, the operant box, and the corridor that regulates access to the operant box. Cameras are placed above the system. b, Diagram of hardware connections. The TV is controlled by a Raspberry Pi, which sends and receives signals from electronic devices in the corridor and operant box, and controls the remote devices. c, Diagram of the main states of the system and data flow. When an animal is detected in the corridor, the corresponding parameters are loaded, and the behavioral session is initiated. After task completion, the generated data is automatically added to a global DataFrame that contains all information about the subject. This information is used to update a parameter dictionary for that subject, which adapts task difficulty and training stage based on the subject’s performance. Finally, data is backed up to an external device. d, Graphical User Interface of the TV. Shortcut buttons allow direct system control, while multiple tabs provide intuitive interaction and user-friendly access to the system settings and data, and allow the manual initiation of behavioral tasks. Two cameras continuously monitor activity in the operant box and corridor. Real-time behavioral plots and event logs are also available to inform the user about the system status quickly (Supplementary Fig. S3).

Self-regulated behavior in the TV results in an efficient and well-distributed use of the operant box.

a, Left: Raster plot of entries into the operant box (rectangles, colors represent training stages) and entrance attempts (black dots) during the first 8 days of training (Group 6, n=12). Gray areas represent nighttime. Right: Histogram of individual occupancy of the operant box by the same mouse group shown in a (same y-axis). Each bar represents the mean individual occupancy of the box across the entire experiment (error bars indicate the 95% CI). The self-organized distribution of the box usage time is very close to a uniform distribution (dashed line). b, Evolution of the operant box total occupancy during the same period shown in a (left), and its histogram over the entire experiment (right). Connected dots indicate the mean occupancy in 6-hour bins. The drop on day 5 was due to system maintenance. The dashed line represents mean occupancy over the entire experiment. c, Operant box average occupancy as a function of group size (sizes 3 to 9 correspond to single groups, while sizes 10–14 aggregate multiple groups). Rat cohort indicated in pink. The black triangles represent the example group shown in panels a-b, whose size varied across time. d, Histogram of the number of daily sessions per animal computed separately for mice (gray) and rats (pink). e, Histogram of the inter-session interval (i.e., time between successive behavioral box entrances of the same subject). No entrances occurred within the first 4 hours after a session ended due to the imposed refractory interval. f, Average number of daily sessions as a function of the group size. g, Average number of daily sessions over time (grouped by trimesters). Data is from groups 4, 5, 6, 7, and 9, which ran on the TV for at least 6 months. Paired t-test: t = -1.86, p = 0.07. h, Monthly average occupancy (black) and cumulative number of task trials (gray) versus experiment time (error bars indicate 95% CI; Group 7). i, Quantification of the distribution of box usage across animals by the Gini coefficient for the different groups tested in the TV. j, Number of failed entrance attempts per session (i.e., per successful entrance) calculated by type of attempt. Paired t-test t = -5.7, p < 0.001. k, Failed entrance attempts per session calculated separately during the first and second trimester of data collection. Same dataset as in g. Paired t-test: t = 5.6, p < 0.001 (left); t = 3.3, p = 0.002 (right). l, Number of failed entrance attempts per session shown as a function of the group size. Only multi-animal attempts were considered for this analysis. m, Time spent inside the operant box after the door opened as a function of the door opening time (left) and its histogram (right). Sessions were classified as fast exits (green, extra time <1 min) or slow exits (brown, >1 min extra time). Each dot represents one session. Regression lines for fast (slope = -0.07, p = 0.002) and slow exits (slope = 4.4, p = 0.73). Analysis is based on Groups 5 and 6 (n=829 sessions). Boxes show the median and IQR across groups (panel i), days (c), or subjects (f, j, k, l).

Animals are consistently engaged in different cognitive tasks tested in the Training Village.

a-c, Schematics of the behavioral tasks implemented and tested in the TV. a, Visuospatial three-alternative choice delayed-response task (3AFC), adapted for mice and rats. b, Two-alternative discrimination task for mice (2AFC). c, Two-armed bandit task for mice (2AB). Panel columns in d, f, h and j correspond to each task; see panel titles. d, Distributions of the trial duration obtained from all animals in each task. 3AFC Median = 19.1 s, Groups 1-8, n= 88 mice, N= 105 trials; 3AFC Median = 20.6 s, Group 9, n= 6 rats, N=84,670 trials; 2AFC Median = 4.1 s, Group 12, n=10 mice, N = 49,727 trials; 2AB Median = 1.65 s, n = 9 mice, N = 450,382 trials. In the 2AB task, we excluded a portion of the trial to avoid confounds, as a consequence, trial durations appear shorter (see Methods for details). e, Trial index as a function of trial onset in three example sessions from the same mouse carrying out the 3AFC task. Notice that trials containing long pauses are classified as disengaged (purple). f, Averaged percentage of time spent by each subject in each of the four engagement states: time to complete the first trial, time from door opening to the animal’s exit, time engaged and time disengaged. Dots represent subjects, and boxes show the IQR with the median. g, Percentage of time spent in the four engagement states (defined in f) across months (only Group 7, n = 12). Lines represent the monthly averages and shaded bands indicate the SEM. h, Fraction of engaged trials as a function of trial index. Lines represent averages across bins (10-trial bins in 3AFC and 30-trial bins in 2AFC and 2AB). i, Fraction of engaged trials over a session as a function of the preceding inter-session interval (ISI). Dots connected by a line represent the mean fraction across sessions with similar ISI and shaded bands the SEM. Histogram of ISIs is shown in gray. j, Choice accuracy as a function of trial difficulty and different levels of engagement. More details of the engagement calculation and trial difficulty categorization are in Methods. Small dots represent individual subjects. Larger dots connected by lines represent mean ± SEM. The gray area represents chance-level accuracy. k, Choice accuracy across months split by trial difficulty (Group 7, n = 12 as in panel g). Lines represent monthly averages, and shaded bands indicate the SEM. Equivalent plots for the auditory 2AFC task are shown in Supplementary Fig. S6f (corresponding to panels d, f, and j).

Home cage behaviors are modulated by task activity.

a, Schematic of the TV + Eco-HAB spatial arrangement. Bottom right: Averaged daily occupancy for each box. b, Raster plot showing individual mouse location across the four home cages and the operant box over two days in two different TVs (Group 5 n = 11, and Group 6 n = 10, separated by the horizontal line). Each row represents one mouse, and colored boxes represent periods during which a mouse remained in one of the different types of cages described in panel a. Black bars on top indicate night phases (limited by vertical lines). c, Home cage activity quantified as the median number of cage changes per hour plotted in circadian time. Data is split by system status (task: normal access to the operant box; no task: no access to the operant box and plain water ad libitum in the home cages). Dots represent the mean across subjects; error bars represent 95% CI. The gray band represents the nighttime period. d, Median number of cage changes during day and night phases, split by system status. Lines represent individual subjects; boxplots show the median and IQR. Effects of task status, light cycle, and their interaction were assessed using a linear mixed-effects model with subject as a random intercept: task status β = -4.7, p = 0.06; cycle β = 12.6, p < 0.001; interaction β = 2.2, p = 0.6. Significance markers indicate results from paired t-tests. e, Cage occupancy during the 5 minutes before and after each behavioral session. Dots represent the mean across subjects, and error bars show 95% CI. Paired t-test: t = 8.9, p < 0.001 (Nest), t = 3.3, p = 0.04 (Task access), t = -8.4, p < 0.001 (Food); t = -1.7, p = 0.5 (Enrichment). All p-values were corrected for multiple comparisons using Bonferroni. Panels c-e show data from Group 5, n=11.