Trajectory Replay: Continuous-Time Mixture Transport for Lifelong Generative Models

Alessandro Palma, Charles Jones, Tristan Cinquin, Fabian J. Theis, Frederik WenkelarXiv 2026

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:

  1. Computational Cost: Generating each replay sample requires simulating a full trajectory (solving an ODE or SDE), which is extremely slow during training.
  2. 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.
Figure 1: Trajectory replay for generative CL. Given a historical flow model and an incoming task (left), generative replay simulates full trajectories to draw replay samples and trains on the mixture qbatch. Trajectory replay instead regresses a single field against the historical field bt and the incoming task’s data-conditioned velocity bt|1 along their own paths, stopping the historical trajectory at an intermediate time. The MeanFlow variant optimizes the same objective with intermediate states drawn through the historical mean velocity Vs,t. Increasing λ favors stability and decreasing it favors plasticity.

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.
Figure 2: (a) Generated historical-mode mass versus mixture weight λ for trajectory replay and joint training (mean ± SD, three seeds). (b) Target and generated samples at λ ∈{0.3, 0.7}. Historical and incoming modes are on the left and right.

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

Abstract

Adapting pre-trained continuous-time generative models to sequentially incoming data without forgetting earlier tasks is a central challenge in lifelong learning. A leading strategy, generative replay, uses a generative model trained on historical tasks to augment its own continual update with synthetic samples from experience. However, it requires full trajectory simulations at every training step, which accumulate discretization errors and can degrade the replayed historical distribution. Here, we propose trajectory replay, which bypasses sample generation by training an updated velocity field to match both a frozen historical velocity along its trajectories and the incoming task's velocity field, weighted by a stability-plasticity coefficient. Through the lens of continuous-time transport, we show the resulting optimum averages the two task velocities by their respective densities and generates the mixture of their probability paths. Combined with mean velocity distillation, trajectory replay accesses historical trajectories using only a few network evaluations per continual update. Empirically, it outperforms generative replay and distillation baselines on class-incremental image generation. In two biological case studies, trajectory replay extends generative perturbation models to new contexts and experimental batches across two data modalities while preserving treatment-effect prediction.
BibTeX
@misc{palma2026trajectory,
  author = {Alessandro Palma and Charles Jones and Tristan Cinquin and Fabian J. Theis and Frederik Wenkel},
  title = {{Trajectory Replay: Continuous-Time Mixture Transport for Lifelong Generative Models}},
  year = {2026},
  eprint = {2610.26749},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.26749},
}
Figure