Manuscript Offprint

arXiv:2610.26749

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

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

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Alessandro Palma 1,2,3†^{1,2,3\dagger}, Charles Jones 4,5^{4,5}, Tristan Cinquin 6†^{6\dagger}, Fabian J. Theis 1,2,3^{1,2,3}, Frederik Wenkel 4,5∗^{4,5*}

1^{1}Helmholtz Munich, 2^{2}Technical University of Munich, 3^{3}Munich Center for Machine Learning, 4^{4}Valence Labs, 5^{5}Recursion, 6^{6}University of Tübingen

†^{\dagger}Work done during an internship at Valence Labs

∗^{*}Corresponding author: frederik@valencelabs.com

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. Code is available at https://github.com/valence-labs/trajectory_replay.

1 Introduction

Continuous-time generative models, such as diffusion and flow matching (Song et al., 2021; Lipman et al., 2023), have gained traction across image generation (Dhariwal & Nichol, 2021; Esser et al., 2024), language modeling (Li et al., 2022), and scientific applications (Morehead et al., 2026; Sriram et al., 2024). Trained on large corpora of data to capture complex, multi-modal distributions, they yield reusable generative priors for a range of downstream tasks (Rombach et al., 2022). As novel data accumulates, however, effective strategies are needed to update pre-trained models with incoming knowledge while preserving generative capabilities over the historical distribution. Joint retraining on the union of historical and incoming data grows more expensive with every update, and is infeasible when the original data is no longer accessible, for instance due to privacy or licensing constraints.

Incorporating new data without full retraining motivates continual learning (CL) strategies (Wang et al., 2024), whereby a seed model is updated on incoming data streams while mitigating forgetting of previous tasks. In generative modeling, each task corresponds to a new data distribution, absent from the historical dataset, that the model must learn to sample from (Guo et al., 2025). CL approaches applied to generative models include architectural evolution (Smith et al., 2024), regularization (Song et al., 2024), and replay (Rolnick et al., 2019). Among them, generative replay (Shin et al., 2017) is one of the most established (Van de Ven et al., 2022): the objective over incoming tasks is augmented with samples generated by the model itself over the historical distribution, alleviating catastrophic forgetting without storing or revisiting historical data.

Applying standard generative replay to continuous-time frameworks is expensive, as each replay sample requires iterative simulation of the underlying dynamics. Approximation errors compound along these trajectories, degrading replay fidelity and, in turn, subsequent CL updates (Gao & Liu, 2023). One line of work stabilizes replay by Renoising generated samples and regressing the frozen historical model's

Figure

λ↑\lambda \uparrow Stability λ↓\lambda \downarrow Plasticity vtv_t Updated field Vs,tV_{s,t} Historical mean velocity

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 qbatchq_{batch}. Trajectory replay instead regresses a single field against the historical field btb_t and the incoming task's data-conditioned velocity bt∣1b_{t|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,tV_{s,t}. Increasing λ\lambda favors stability and decreasing it favors plasticity.

prediction on the Renoised states, rather than using the samples directly as training data (Masip et al., 2025), but generation is still required. Cheaper solutions that bypass data generation remain underexplored. Beyond this bottleneck, most work on CL for continuous-time models remains empirical and lacks a formal understanding of the distributional properties induced by sequential updates.

To address these shortcomings, we introduce trajectory replay (Fig. 1), a flow-based generative replay framework for continuous-time models. Given a batch of incoming data and a vector field trained to generate the historical task distribution, our method splits the CL-update objective for a joint-task velocity field into two regression terms. The first is a standard conditional flow matching loss (Lipman et al., 2023) over the incoming data. The second regresses the joint-task velocity toward the frozen historical field along its own generative trajectory at intermediate times, so replay never runs through to fully generated samples. This halves the simulation cost in expectation and makes replay more robust to discretization error. A stability-plasticity coefficient weights the two terms and controls how much mass the optimum assigns to the historical and the incoming density.

We validate trajectory replay in controlled simulations and class-incremental image-generation benchmarks, where it improves sample fidelity and retention of earlier tasks across sequential updates at a fraction of the network evaluations of existing CL strategies. Since continual adaptation is particularly important in biological discovery, where measurements arrive sequentially across cell lines, donors, and experimental batches, and where historical screens may be inaccessible, we evaluate two drug-discovery applications of generative perturbation prediction in single-cell gene expression and microscopy. Across these settings, trajectory replay offers the best stability-plasticity balance among methods that store no historical data. In summary, our contributions are as follows:

• Trajectory-level replay objective. We formulate generative replay as velocity-field regression along the historical model's generative trajectories, and derive a matching continual update rule for its mean velocity (Geng et al., 2026a), reducing each update to fewer network evaluations.

• Optimality and stability-plasticity control. We show the population optimum of our trajectory objective is a density-weighted mixture of the historical and incoming probability paths, with the mixture weight controlling the stability-plasticity trade-off, and that the objective recovers a weighted forward Kullback-Leibler (KL) divergence up to time reweighting.

• Gains across scales and domains. Trajectory replay improves the fit-retention trade-off over baselines on simulations, image benchmarks, and two biological case studies.

References (100)

  • Predicting cellular responses to perturbation across diverse contexts with State (opens the publisher in a new tab)
  • Stochastic interpolants: A unifying framework for flows and diffusions
  • Flow map matching with stochastic interpolants: A mathematical framework for consistency models
  • Avalanche: A PyTorch Library for Deep Continual Learning
  • Neural ordinary differential equations
  • ImageNet: A large-scale hierarchical image database
  • Diffusion models beat GANs on image synthesis
  • How to continually adapt text-to-image diffusion models for flexible customization? In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024
  • DDGR: Continual learning with deep diffusion-based generative replay
  • Mean flows for one-step generative modeling
  • Improved mean flows: On the challenges of fastforward generative models
  • From LLMs to MLLMs and beyond (opens arXiv in a new tab)
  • Deep residual learning for image recognition
  • LoRA: Low-rank adaptation of large language models
  • Elucidating the design space of flow matching for cellular microscopy (opens arXiv in a new tab)
  • Analyzing and improving the training dynamics of diffusion models
  • Adam: A Method for Stochastic Optimization
  • Proceedings of the national academy of sciences, 114(13):3521–3526, 2017
  • CellFlow enables generative single-cell phenotype modeling with flow matching (opens the publisher in a new tab)
  • Technical report, Technical report, University of Toronto, 2009
  • Diffusion-LM improves controllable text generation
  • Continual personalization for diffusion models
  • Flow matching for generative modeling
  • CCD: Continual Consistency Diffusion for Lifelong Generative Modeling
  • Qiang Liu. Rectified Flow: A marginal preserving approach to optimal transport. arXiv preprint arXiv:2209.14577, 2022. (opens arXiv in a new tab)
  • Generative feature replay for class-incremental learning
  • Continual learning of diffusion models with generative distillation
  • Flow matching for generative modelling in bioinformatics and computational biology
  • Transcriptome-wide analysis of differential expression in perturbation atlases (opens the publisher in a new tab)
  • A single-cell cytokine dictionary of human peripheral blood (opens the publisher in a new tab)
  • DINOv2: Learning robust visual features without supervision
  • Scalable single-cell gene expression generation with latent diffusion models
  • Mapping information-rich genotype-phenotype landscapes with genome-scale Perturb-seq (opens the publisher in a new tab)
  • Experience replay for continual learning
  • High-Resolution Image Synthesis with Latent Diffusion Models
  • Uncertainty quantification for flow-based vision-language-action models (opens arXiv in a new tab)
  • Continual learning with deep generative replay
  • ContinualFlow: Learning and unlearning with neural flow matching
  • Joint diffusion models in continual learning
  • The superposition of diffusion models using the Itô density estimator
  • Continual diffusion: Continual customization of text-to-image diffusion with C-LoRA
  • Towards lifelong few-shot customization of text-to-image diffusion (opens arXiv in a new tab)
  • Score-based generative modeling through stochastic differential equations
  • FlowLLM: Flow matching for material generation with large language models as base distributions
  • On flow matching KL divergence (opens arXiv in a new tab)
  • An introduction to numerical analysis, volume 1
  • Create your world: Lifelong text-to-image diffusion (opens the publisher in a new tab)
  • RxRx1: A dataset for evaluating experimental batch correction methods
  • Rethinking the Inception architecture for computer vision
  • Gradual fine-tuning for flow matching models
  • Improving and generalizing flow-based generative models with minibatch optimal transport
  • Simulation-free Schrödinger bridges via score and flow matching
  • Three types of incremental learning
  • Diffusers: State-of-the-art diffusion models
  • A comprehensive survey of continual learning: Theory, method and application
  • Learning to generate new categories without forgetting
  • Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms
  • Learning latent representations across multiple data domains using lifelong VAEGAN
  • Exploring continual learning of diffusion models (opens arXiv in a new tab)
  • CellFlux: Simulating cellular morphology changes via flow matching
  • Guided flows for generative modeling and decision making (opens arXiv in a new tab)
  • Flow matching (Lipman et al., 2023; Tong et al., 2024a) regresses a marginal vector field $\{b_t(\boldsymbol{x})\}_{t\in[0,1]}$ that generates a probability path $\{p_t(\boldsymbol{x})\}_{t\in[0,1]}$ through the continuity equation:
  • (3) that sends an initial state to its state at time $t$ is a diffeomorphism, called the flow, that maps noise vectors to samples from $p_t$
  • Writing $\boldsymbol{x} = \alpha_t \boldsymbol{x}_1 + \sigma_t \boldsymbol{x}_0$ with $\boldsymbol{x}_0 \sim p_0$, differentiating in $t$ gives the associated conditional velocity
  • Wherever $\alpha_t, \sigma_t > 0$ and $\dot{\alpha}_t \sigma_t - \alpha_t \dot{\sigma}_t \neq 0$, so that $c_t \neq 0$, the relation is invertible, and learning the marginal velocity field and learning the marginal score are equivalent tasks
  • To distinguish our notation from Geng et al. (2026a), we set noise at $t = 0$ and data at $t = 1$, so $s$ is the lower limit of integration
  • Note that the sign in Eq
  • As stated, Eq
  • Under the boundary condition of Eq
  • We refer to $\widetilde{G}_{\theta}$ as a semigradient: it is not, in general, the gradient of any objective, so the field it converges to is characterized as a fixed point, at which $\widetilde{G}_{\theta}$ vanishes, rather than as a minimizer
  • (32) with respect to $\rho(\boldsymbol{x})$ and set it to zero:
  • Substituting $\gamma = 1$ back into Eq
  • (7) becomes a pointwise minimization, as the objective does not contain any derivative of the minimizer $v$
  • The bracketed factor is strictly positive by assumption, so dividing through recovers Eq
  • Combined with Prop
  • Subtracting the two, the affine terms cancel, and the score difference collapses to a velocity difference:
  • Taking the $\lambda$-weighted combination of the two and collecting the integrals yields Eq
  • (4), the two residuals read
  • The marginals $p_t, p_t'$ at time $t$ evolve under the corresponding Fokker–Planck equations
  • Formulating the mixture problem over path measures rather than densities, Girsanov's theorem reduces the divergence between two such diffusions to an integrated quadratic drift mismatch, weighted by the inverse squared diffusion coefficient
  • The weighted objective is therefore the functional of Eq
  • Selecting $\lambda_k$ is therefore a choice of how the stream is weighted overall, not only of the current stability-plasticity trade-off, and the two schedules above correspond to the settings compared in Sec
  • Generative replay always pays Eq
  • Stopping early therefore reduces the worst-case error in the replayed state, and by more when the field varies rapidly
  • replaying generated images is expensive, and errors in those images enter training as if they were data
  • Generative replay runs every block to obtain the output $\boldsymbol{x}_1$ and treats it as a sample
  • $p_{\text{diag}}$;
  • The ODE backend integrates the teacher with Euler at the replay step size in Tab
  • Since the baselines below use a different generative objective, we report it for both, as diffusion naive fine-tuning and flow matching naive fine-tuning, separating the gain attributable to replay from that attributable to the objective
  • This is the strongest published no-storage continuous-time baseline on these streams
  • The margin grows with the cost of the teacher: integrating to an intermediate time saves a fraction of the trajectory fixed by $\mathbb{E}[t]$, so the absolute saving scales with how expensive a full generation is, from 0.2h on Fashion-MNIST to 25.5h on ImageNet-100
  • (a) Final stream FID relative to the matched ODE run as a function of replay-field evaluations per update, and (b) final stream FID against accounted training time, for Fashion-MNIST, CIFAR-10, and ImageNet-100
  • 16b) the teacher is expensive enough that the MeanFlow backends match FID at a fraction of the cost
  • The velocity field is an MLP over PCA latents with 128-dimensional sinusoidal time and condition embeddings concatenated to the input, trained on the linear noise-to-data interpolant with target $\boldsymbol{x}_1 - \boldsymbol{x}_0$
  • The fit falls monotonically with width on both datasets, giving 50 components on Replogle, while on PBMC 50 and 100 are within a thousandth of each other, and we take 100 following Klein et al
  • Every method uses Adam at $10^{-4}$ with batch size 1024, under the budgets in Tab
  • whether the velocity field trains, whether perturbation rows seen earlier train, and whether earlier context rows train
  • Following the CellEval metric suite in Adduri et al. (2026), the headline metric is Pearson $\Delta$, the correlation between predicted and observed perturbation-minus-control profiles, macro-averaged over strata
  • Only the new context row is learned, so task 0 is preserved almost exactly, and PBMC retention is the highest of any memory-free method at 0.491
  • The old rows drift to compensate for a field that cannot move, costing retention (0.400) for no fit at all (0.232) on PBMC. On Replogle, the same relaxation does buy fit, 0.359 against 0.193, at a smaller retention cost

Couldn't load all references. Reload the page to try again.