Probabilistic Prediction of Neural Dynamics via Autoregressive Flow Matching
Authors: Nicole Rogalla, Yuzhen Qin, Mario Senden, Ahmed El-Gazzar, Marcel van Gerven
Organizations: Department of Machine Learning and Neural Computing, Donders Institute for Brain, Cognition and Behaviour, Radboud University, Nijmegen, the Netherlands · Department of Cognitive Neuroscience, Maastricht University, Maastricht, the Netherlands · Maastricht Brain Imaging Center, Maastricht University, Maastricht, the Netherlands
Forecasting neural activity in response to naturalistic stimuli remains a key challenge for understanding brain dynamics and enabling downstream neurotechnological applications. Here, we introduce a generative forecasting framework for modeling neural dynamics based on autoregressive flow matching (AFM). Building on recent advances in transport-based generative modeling, our approach probabilistically predicts neural responses at scale from multimodal sensory input. Specifically, we learn the conditional distribution of future neural activity given past neural dynamics and concurrent sensory input, explicitly modeling neural activity as a temporally evolving process in which future states depend on recent neural history. We evaluate our framework on the Algonauts project 2025 challenge functional magnetic resonance imaging dataset using subject-specific models. AFM significantly outperforms both a non-autoregressive flow-matching baseline and the official challenge general linear model baseline in predicting short-term parcel-wise blood oxygenation level-dependent (BOLD) activity, demonstrating improved generalization and widespread cortical prediction performance. Ablation analyses show that access to past BOLD dynamics is a dominant driver of performance, while autoregressive factorization yields consistent, modest gains under short-horizon, context-rich conditions. Together, these findings position autoregressive flow-based generative modeling as an effective approach for short-term probabilistic forecasting of neural dynamics with promising applications in closed-loop neurotechnology.
Figures & tables
Figure 1: Autoregressive flow matching framework. Training aims to construct a probability path between a base distribution p0 and the target distribution p1 . The path is learned by regressing a neural network νθ which processes a sample from the probability path yts at flow step s , a context vector ht encoding both past BOLD images and stimulus features in a context window of length w , the stimulus feature ct , against the target conditional velocity field μ . Predictions are generated by sampling from p0 and integrating νθ with an ODE solver until s=1 . Figure adapted from El-Gazzar and van Gerven (2025a) .
Train r∗
Test r∗
Framework
mean
sub-01
sub-02
sub-03
sub-05
mean
sub-01
sub-02
sub-03
sub-05
GLM (Algonauts project 2025 challenge baseline)
0.320
0.330
0.331
0.312
0.309
0.260
0.242
0.275
0.267
0.256
SFM
0.577
0.597
0.546
0.584
0.606
0.423
0.402
0.405
0.447
0.438
AFM
0.498
0.480
0.437
0.541
0.532
0.465
0.449
0.428
0.493
0.488
Table 1: Performance comparison of AFM to baselines (SFM and GLM). Noise-ceiling adjusted Pearson’s correlation scores ( r∗ ) per subject for GLM baseline and FM optimized individual models. Train correlations are based on season 1, test correlations are based on season 6 of the TV show Friends . Values are rounded to three decimals. Highest values per column are highlighted in bold. All comparisons between frameworks significant given block-permutation test (10,000 repetitions, p < 0.05).
Figure 2: Flatmap of mean prediction performance of AFM. A) Flatmap of parcel-wise Pearson’s correlation coefficients ( r ) between predicted and observed fMRI responses averaged across subjects displayed on the FreeSurfer fsaverage brain. B) Flatmap of parcel-wise performance difference between (1) GLM and AFM and (2) SFM and AFM. Errorbar shared for difference plots. Insignificant parcels are depicted in grey (block-permutation test; 10,000 repetitions; p<0.05 , FDR-corrected across parcels). Numbers in parentheses indicate the count of significant parcels out of the total 1,000.
Figure 3: Prediction performance of optimized individual AFM models with GRU encoder across Yeo et al. (2011) ’s seven brain networks. A) Noise-level-adjusted correlation test scores ( r∗ ) averaged over parcels within each network. Error bars indicate variability across subjects. All results significant (block-permutation test, 10,000 repetitions, p<0.001 , Bonferroni correction). B) Relative performance gains ( Δr=rAFM∗−rB∗ ) of AFM over baseline frameworks (GLM, SFM). Asterisks denote significance levels of differences given a block-permutation test (10,000 repetitions, *: p<0.05 , **: p<0.001 , ***: p<0.001 , ****: p<0.0001 , ns: not significant; Bonferroni correction). Abbreviations: V: visual, SM: somatomotor, DA: dorsal attention, SV: salience / ventral attention, L: limbic, FP: frontoparietal, D: default. Results rounded to three decimals.
CRPS
mean
sub-01
sub-02
sub-03
sub-05
SFM
0.370
0.368
0.361
0.378
0.374
AFM
0.369
0.366
0.359
0.377
0.373
Table 2: Uncertainty quantification of AFM compared to baseline SFM. Continuous ranked probability score (CRPS) per framework on test set predictions. Values are rounded to three decimals. Best values per column are highlighted in bold.
Figure 4: Ablation analyses of A) context window length and B) prediction window length for AFM and SFM on subject 1. Noise-ceiling adjusted correlation ( r∗ ) shown for frameworks evaluated in increments of 5 (0-50s for context: 0-25 s for prediction). Markers indicate observed values.
mean
sub-01
sub-02
sub-03
sub-05
AFM (BOLD + stimulus)
0.465
0.449
0.428
0.493
0.488
AFM (stimulus only)
0.284
0.274
0.284
0.298
0.279
SFM (BOLD + stimulus)
0.423
0.402
0.405
0.447
0.438
SFM (stimulus only)
0.162
0.165
0.161
0.181
0.141
Table 3: Performance of FM models trained using both past stimulus and BOLD dynamics compared to FM models given only stimulus history. Noise-ceiling adjusted Pearson’s correlation scores ( r∗ ) per subject. Test correlations are based on season 6 of the TV show Friends . Values are rounded to three decimals.
Hertie Institute for AI in Brain Health, University of Tübingen, Germany · Tübingen AI Center, University of Tübingen, Germany · Charité – Universitätsmedizin Berlin, Department of Psychiatry and Psychotherapy, Germany +1
Faculty of Information Science and Technology, Hokkaido University, Japan · SANKEN, The University of Osaka, Japan · Department of Computer Science, University of Illinois Urbana-Champaign, USA +1