TL;DR
Trajectory Replay is a novel framework for the continual learning of flow-based generative models that avoids the high computational cost and error accumulation of traditional generative replay. By matching velocity fields along trajectories rather than generating full synthetic samples, it achieves superior performance in image generation and biological perturbation modeling with significantly fewer network evaluations.
What Problem Does This Paper Address?
Generative models like diffusion and flow matching are powerful but suffer from "catastrophic forgetting" when trained on a sequence of new tasks: they learn the new data but lose the ability to generate the old.
The standard solution is generative replay, where the model generates synthetic samples of "historical" data to mix with new data during training. However, for continuous-time models, this is problematic:
- Computational Cost: Generating each replay sample requires simulating a full trajectory (solving an ODE or SDE), which is extremely slow during training.
- Error Accumulation: Numerical solvers introduce discretization errors. These errors "corrupt" the replay samples, and as the model is updated over multiple tasks, these errors compound, leading to a steady decline in the quality of the historical distribution.
Methods
The authors introduce Trajectory Replay, which shifts the focus from samples to the underlying dynamics (the velocity field).
Instead of simulating a full trajectory from noise ($t=0$) to data ($t=1$), Trajectory Replay:
- Picks a random intermediate time $t$.
- Simulates the frozen historical model only up to time $t$.
- Trains the updated model to match the historical model’s velocity at that specific point.
To further boost efficiency, they propose a MeanFlow variant. This uses "mean velocity distillation" to learn a field that can jump directly between time points, bypassing the need for even partial ODE simulations during the replay step.
Datasets
The method was validated across diverse domains:
- Standard Vision: Fashion-MNIST, CIFAR-10, and a latent-space version of ImageNet-100.
- Single-Cell Transcriptomics: Replogle-Nadig (CRISPRi screens) and Parse-PBMC (cytokine stimulations), where the goal is to predict how cells respond to different drugs or genetic perturbations.
- Microscopy: The RxRx1 dataset, consisting of high-resolution fluorescence images of cells under various gene knockdowns across different experimental batches.
- Synthetic Benchmarks: Bimodal and ring-structured Gaussian mixtures used to mathematically verify that the model correctly recovers the intended mixture of distributions.
Key Insights and Ideas
- Mathematical Optimality: The authors prove that the Trajectory Replay objective is not just a heuristic; its population optimum is a density-weighted mixture of the historical and incoming probability paths. This provides a formal grounding for how the model balances "stability" (remembering the old) and "plasticity" (learning the new).
- Robustness to Solver Error: In standard replay, solver error creates "bad data" that the model then tries to fit. In Trajectory Replay, solver error just moves the "probe" to a slightly different location in space, but the target (the teacher's velocity at that location) remains perfectly accurate. This breaks the cycle of compounding errors.
- Efficiency Gains: By stopping trajectories early, the method halves the expected simulation cost. When combined with MeanFlow, the number of network evaluations required for a continual update drops even further.
Key Results
- Image Quality: On CIFAR-10, Trajectory Replay achieved a Fréchet Inception Distance (FID) of ~31.4, significantly outperforming standard generative replay (~43.3) and diffusion-based distillation baselines.
- Biological Accuracy: In single-cell studies, it was the only memory-free method capable of both retaining old perturbation effects and accurately predicting new ones. In microscopy, it maintained an FID of ~40 on the oldest data batch, while generative replay degraded to ~71.
- Speed: The framework is 1.22x to 1.65x faster end-to-end than generative replay, with the margin increasing as the underlying generative task becomes more complex.
Limitations and Future Work
- Partial Simulation: While more efficient, the "ODE backend" still requires some simulation. The "MeanFlow" backend solves this but introduces its own complexity (requiring Jacobian-vector products), which can be memory-intensive for very high-dimensional data like raw microscopy images.
- Hyperparameter Tuning: The stability-plasticity coefficient ($\lambda$) is crucial. While the authors propose an "adaptive" version that picks the best $\lambda$ based on a validation set, this requires running multiple training passes per update, which is computationally expensive.
- Long-term Scaling: The experiments spanned up to five sequential tasks. Whether these gains hold up over dozens or hundreds of tasks (as seen in some LLM contexts) remains an open question for future research.
Summary updated