The cerebellum uses a learnt expectation of optic flow stimulus to generate swims with lower latency. (A) Optic flow stimulus protocol used (green) and corresponding motor responses of a representative fish (pink). The positions of the probe stimuli were randomized. (B) Zoomed-in view of the highlighted region in (A) Top: A probe stimulus ±5 forward optic flow pulses. Bottom: Calculation of latency modulation around the probe. (C) Average latency modulation for 10 forward optic flow pulses around the probe stimulus. N = 17 fish. Unexpected probe stimuli cause a transient elevation in latency. (D) Latency modulation around the probe stimulus for cerebellum (CB) lesioned fish. N = 11. Probe stimuli did not cause an elevation in latency in lesioned fish. (C) and (D) *P = 0.013; nonsignificant (ns), P > 0.05 by linear mixed-effects evaluating pre-probe versus post-probe latency modulation with an interaction effect of lesion. (E) A single two-photon optical section of the GCaMP6s expressing PCs before (top) and after (bottom) lesioning. Disintegration and blebbing of cells and neuropil can be seen after the lesioning protocol. Scale bar, 20 μm. (F and G) Both lesioned and nonlesioned fish show similar levels of behavioral responsiveness (F) and respond to optic flow with similar average latency (G). ns, P > 0.05 by independent sample t test.

Purkinje cells (PCs) show direction selective responses to optic flow stimuli. (A) Schematic of the experimental setup. (B) Average two-photon image of PCs expressing GCaMP6s from a representative fish. Scale bar, 20 μm (C) Left: Zoomed-in view of the stimulus protocol highlighting the 5-s interval between two stimulus pulses and the 2-s pulse duration. Right: An example of the randomly ordered optic flow stimulus presented in the first trial. Note: The y axis is scaled nonlinearly in this schematic to highlight the small-amplitude probe stimuli. (D) Classification of PCs based on tuning as backward (black), forward (magenta), or motor (brown) using regressors (gray) in a representative fish, shown as means ± SD. (E) Average response profiles across fish of backward-, forward-, and motor-tuned cells (rows 2, 3, and 4, respectively) aligned to the start of each stimulus (columns 1 to 4) or motor activity (column 5); shaded regions around the average calcium traces are SEM over N = 8 fish. The first row shows the respective optic flow stimulus (columns 1 to 4) and average motor activity (column 5). Solid lines in columns 1 to 4 are average responses for stimulus presentations without motor activity, and the dashed lines are averages for all presentations including those with motor activity. Motor activity traces in gray represent the average for individual fish.

A change in optic flow direction is encoded in enhanced responses to probe stimuli. (A) Schematic of the experimental protocol. Trials 2 to 13 began with an acclimatization phase of 8× optic flow pulses at 1 cm/s followed by a probe. (B to E) Average calcium responses in the backward-tuned cells to the different trials [(B), negative probe; (C), random stimulus timing followed by negative probe; (D), positive probe; and (E), no probe)]. The respective optic flow stimuli and average motor activity are shown above. Gray traces are the responses of individual fish (N = 8). Fold change in peak amplitude in response to the three presentations of the negative probe stimuli with respect to (w.r.t.) the baseline amplitude in trial 1 is shown for (B) and (C). *P < 0.05 and **P < 0.01 by Wilcoxon signed-rank test showing an elevation in amplitude w.r.t. baseline (dashed line at 0). There were no large calcium responses in the backward-tuned cells to the positive probe or the zero probe [(D) and (E)]. (F) Average calcium response in backward-tuned cells to the negative probe stimulus when presented in random order in trial 1 (gray) and to the first presentation of the same stimulus after acclimatization (black). (G and H) The peak amplitude in dF/F of the trial-averaged calcium response to the respective stimuli shown on the x axis for the backward-tuned cells (G) and the forward-tuned cells (H). *P < 0.05 w.r.t. the baseline amplitude by post hoc Conover’s test following a significant Friedman’s test (P = 3 × 10−5). n = 98 cells, N = 8 fish in (G); n = 41 cells, N = 7 fish in (H). No large calcium events were seen in forward-tuned cells to any of the probe stimuli. Hence, no statistical analysis was performed to test for systematic changes in amplitude values across all trial types (see fig. S2).

Self-induced change in optic flow direction does not cause Purkinje cell (PC) activation. (A) Average motor activity (bottom, red) during forward optic flow at 1 cm/s, negative probe, positive probe, and no optic flow stimuli (top, green). (B) Forward optic flow reliably evoked swims, whereas very few and no swims were seen in response to positive probe and negative probe stimuli respectively. N = 8 fish, **P = 0.0006 by Friedman’s test, P = 0.011 (forward flow versus +ve probe) and P = 0.002 (forward flow versus −ve probe) by post hoc Conover’s test. (C) Example forward optic flow stimulus at 1 cm/s (top), motor activity (middle), and the resultant net optic flow experienced by the fish in closed loop (bottom). (D) Motor onset triggered average optic flow stimulus (green, top), swim velocity (pink, top), and net optic flow experienced by the fish (middle). Bottom panel shows average calcium responses in backward-tuned PCs aligned to motor onset. (E) Probe triggered average optic flow (green, top), swim velocity (pink, top), and average net optic flow experienced by the fish (middle). Bottom panel shows the average calcium responses in backward-tuned PCs aligned to probe onset. (F) Same as (D) for swim events lasting longer than 0.75 s. (G) Magnitude of the negative component of optic flow during swims is much larger than the amplitude of the negative probe stimulus. (H) Peak amplitude of the calcium response in backward-tuned cells to the negative probe stimulus is much larger than the response to swim bouts. (I) The slope of the rise phase of the calcium response in backward-tuned cells is significantly steeper for the negative probe stimulus than during motor activity. N = 7 fish, *P = 0.016 [(G) and (H)] and 0.03 (I) by Wilcoxon signed-rank test. Shaded areas in (D) and (F) represent SEM across eight fish.

Purkinje cell (PC) response to probe represents the magnitude of error from the expected stimulus pattern. (A) Top (text): Description of the experimental protocol. Middle: Stimulus traces. Bottom: Corresponding calcium responses in backward-tuned cells. Solid line is the mean for N = 7 fish, and shaded regions are SEM. Colors indicate the number of acclimatization pulses. (B) Zoomed-in view of the average calcium response of backward-tuned cells to pre-probe (left) and post-probe (right) pulses aligned to the onset of the first probe. (C) Average amplitude of the response to pre-probe stimuli. ns, P = 0.54. The three probe pulses were pooled as there was no difference between them. (D) Average amplitude of the response to the first post-probe pulse scales with the number of acclimatization pulses. P = 0.0015 by Friedman’s test; *P < 0.05 and **P < 0.01 by post hoc Conover’s test w.r.t. the pre-probe amplitude. (E) Decay of the amplitude of the enhanced response to the post-probe stimulus over the three successive post-probe pulses for the different number of acclimatization pulses. Red dashed line with the shaded region shows the mean and SEM of the respective pre-probe amplitudes. Slope and P value by linear mixed-effects are inset in each plot. (F) Schematic of the experimental protocol for the delayed probe experiments. 3× probe pulses were presented with a variable delay from 1 s to 15 s after 8× acclimatization pulses. (G) Average response of the backward-tuned cells aligned to the onset of the probe pulses. Shaded regions are SEM across N = 9 fish. Colors indicate the delay as shown in (F). (H) Amplitude of the response to the first probe pulse does not depend on the delay. ns, P = 0.98 by Friedman’s test.

Granule cell (GC) responses reveal absence of the error signal. (A) Schematic of the experimental protocol. (B) A representative imaging plane (top) and regions of interest (ROIs) drawn around GC cell bodies using semiautomated anatomical segmentation (bottom). Scale bar, 20 μm (C to G) Functional response types identified using correlation-based clustering. The cluster label, the number of cells (means ± SD), and the number of fish in which the cluster was found are inset in each panel. (H) Average motor activity overlaid on the optic flow stimulus trace. (I) The number and relative proportions of GCs in each cluster across fish. (J) Top: Response of probe responsive cells identified using cross-correlation with stimulus regressor. Bottom: Response of the same cells shown on top to optic flow at 1 cm/s. (K) Number of cells identified as probe responsive. (L) Average response of the probe responsive cells to negative probe pulses after acclimatization and when presented at random (baseline). (M) Response amplitude of the probe responsive cells to negative probe when presented randomly compared to the amplitude after acclimatization. ns, P = 0.11 by Wilcoxon signed-rank test. Traces shown in (C) to (H), (J), and (K) are means ± SEM.

Strong population-wide representation of stimulus expectation correlates with lower swim latency. (A) Left: Schematic of the experimental preparation. Right: Traces showing the optic flow stimulus, PC recording with SSs and CF inputs, fictive motor recording, and the processed motor signal used for closed-loop feedback for some fish. Scale: zoomed-out, 2 s; zoomed-in, 20 ms. (B and C) Both SS (B) and CF input (C) rates show a significant, steady increase before the onset of optic flow. ***P < 0.001 by linear mixed-effects. n = 20 cells in (B) and n = 15 cells in (C). (D) Regression-based classification of cells into forward (magenta)– and backward (black)–tuned. Gray traces represent individual fish, N = 27. (E to G) The pre-flow calcium activity is significantly anticorrelated with latency for the forward-tuned cells (E). No correlation is seen after shuffling trial order (F) or in backward-tuned cells (G). Slope and P value by linear mixed-effects are inset in each plot. N = 27 fish. (H) The pre-flow calcium activity in forward-tuned cells is significantly anticorrelated with latency up to 2.5 s before the onset of the forward optic flow stimulus. (I) Heatmap of single-trial responses of all cells in a representative fish to two instances of the negative probe stimulus. The average motor activity over a window of 10 nonprobe stimulus pulses around each of the probes is shown on top. The mean latency to initiate swims and the population-wide probe response probability are inset in each plot. (J) Representative plot from one fish showing latency to swim in response to forward optic flow (pink) along with probe response amplitude (black) and probability (black dashed) for backward-tuned cells. (K) Both amplitude and probability are anticorrelated with latency. Green-shaded area shows 95% confidence interval for the median estimated by bootstrapping. N = 16 fish.

Acknowledgments
This image is the copyrighted work of the attributed author or publisher, and ZFIN has permission only to display this image to its users. Additional permissions should be obtained from the applicable author or publisher of the image. Full text @ Sci Adv