The Practicality of Normalizing Flow Test-Time Training in Bayesian Inference for Agent-Based Models
Junyao Zhang, Jinglai Li, Junqi Tang
TL;DR
The paper addresses posterior calibration for agent-based models under distribution shift by adopting test-time training (TTT) of normalizing-flow posteriors within Sequential Neural Posterior Estimation (SNPE). It compares full-parameter fine-tuning (SNPE-TTT), parameter-efficient LoRA, and introduces gradient-subspace methods (GradSubspace-TTT and GradSubspace-PEA) to constrain adaptation to data-driven subspaces. Across the Brock–Hommes model and Multivariate Geometric Brownian Motion, SNPE-TTT consistently improves alignment with ground-truth posteriors, while LoRA can underfit under strong shifts. The gradient-subspace approaches deliver robust, parameter-efficient corrections, often matching or surpassing full fine-tuning, with GradSubspace-PEA showing especially strong discrepancy reductions. Overall, the work demonstrates practical strategies for real-time, stable posterior inference in ABMs facing distribution shifts, highlighting the importance of aligning updates with task-specific gradient structure.
Abstract
Agent-Based Models (ABMs) are gaining great popularity in economics and social science because of their strong flexibility to describe the realistic and heterogeneous decisions and interaction rules between individual agents. In this work, we investigate for the first time the practicality of test-time training (TTT) of deep models such as normalizing flows, in the parameters posterior estimations of ABMs. We propose several practical TTT strategies for fine-tuning the normalizing flow against distribution shifts. Our numerical study demonstrates that TTT schemes are remarkably effective, enabling real-time adjustment of flow-based inference for ABM parameters.
