Mitigating Compounding Errors in Online Reinforcement Learning via Optimal Transport Regularized Flow Matching

BoxiangTao, Lei Guo, binwang, Zexin Wang, HongboDouNeurIPS 2026

TL;DR

In reinforcement learning, teaching an AI to "imagine" the future step-by-step is like playing a game of telephone: tiny prediction errors snowball until the imagined reality is complete nonsense. This paper introduces FTA (Flow-based Trajectory TrAnsport), a framework that bypasses the game of telephone by generating entire future trajectories in one shot using flow matching. By applying the physics of optimal transport to keep these generative paths straight and low-energy, FTA turns exponential error blowups into manageable linear drift, drastically boosting learning efficiency.

What Problem Does This Paper Address?

Online Reinforcement Learning (RL)—where an agent learns by interacting directly with its environment—is notoriously data-hungry. Model-Based RL (MBRL) tries to fix this by having the agent learn a "world model" of its environment so it can practice in its own imagination, saving real-world trial and error.

The catch is the compounding error problem. Traditional world models are autoregressive: they predict state $t+1$ from state $t$, then feed that slightly flawed prediction back in to predict $t+2$, and so on. Over long horizons, tiny inaccuracies multiply exponentially. Before long, the agent is optimizing its behavior in a hallucinated, physically impossible corner of the model, wrecking its real-world performance.

Comparison of trajectory generation paradigms: step-by-step drift vs. oscillatory vanilla flow matching vs. straight, value-guided FTA paths.

While generative models (like diffusion) have been used to generate whole trajectories at once in offline RL (learning from static datasets), bringing them to online RL is tough: diffusion is slow to sample, standard flow models take wild, oscillatory detours, and an online agent's data distribution constantly shifts as it gets smarter.

Methods

FTA replaces the traditional step-by-step world model inside a standard Dyna-style loop (collect real data $\rightarrow$ train model $\rightarrow$ generate synthetic experience $\rightarrow$ update policy). Here is how they build a better imagination engine:

  • One-Shot Trajectory Flow Matching: Instead of slow, iterative diffusion, FTA uses Conditional Flow Matching (CFM) built on a Scalable Interpolant Transformer (SiT) backbone. It learns a continuous vector field that transports pure Gaussian noise directly into a full sequence of states, actions, and rewards by solving an Ordinary Differential Equation (ODE).
  • Optimal Transport (OT) Regularization (New): Vanilla CFM guarantees you reach the right target distribution, but the path it takes to get there can be wildly curved and oscillatory, hurting policy stability. Grounded in the Benamou–Brenier formula from optimal transport theory, the authors add a regularizer that penalizes the flow's kinetic energy and enforces exact state displacement. They also attach multiple prediction heads to the Transformer, dynamically applying stronger "straightening" penalties to heads with higher epistemic uncertainty.
  • Value-Guided ODE Sampling (New): Because the generative model trains on past experiences, it naturally mimics average historical behavior. To generate better-than-average trajectories without retraining the generator, FTA modulates the speed of the ODE solver using the trajectory's predicted return. High-return regions get a smaller velocity scaling factor—essentially telling the flow to "slow down and linger" where the rewards are good.

Datasets

Because this is online RL, there are no static datasets; data is collected on the fly via live interaction. FTA is evaluated on eight continuous control robotic benchmarks from MuJoCo-v4 (via the Gymnasium interface): Hopper, Walker2d, HalfCheetah, InvertedPendulum, Ant, Humanoid, Swimmer, and Reacher. No new benchmarks were introduced.

Key Insights and Ideas

  • Breaking the Exponential Curse: Because step-by-step rollouts feed errors back into themselves, state errors grow as $\mathcal{O}(e^{\lambda t})$. The authors prove theoretically—and verify empirically—that constraining trajectory-level flows toward straight Wasserstein-2 geodesics reduces root-mean-square state error growth to linear ($\mathcal{O}(t)$).
  • Informed Optimism Without Retraining: By simply scaling the magnitude (speed) of the vector field rather than its direction during ODE integration, FTA shifts the generated trajectory distribution well past the historical real-data average. It actively synthesizes high-reward experiences that are scarce in the replay buffer while maintaining physical consistency.
  • Physics Priors Generalize Across Bodies: Minimizing kinetic energy doesn't just stabilize training; it distills task-agnostic laws of smooth locomotion. A generative prior learned on a two-legged dog-like robot (HalfCheetah) transferred zero-shot to a bipedal walker (Walker2d), beating baselines trained from scratch.
  • The Horizon Sweet Spot: Generating trajectories of length $T=20$ hits an empirical sweet spot—long enough to avoid myopic traps (like $T=2$ or $5$), without introducing the high variance seen at $T=60$.

Key Results

Across the eight MuJoCo tasks, FTA consistently matches or beats model-free SAC, specialized step-wise MBRL baselines (MBPO, ADMPO, MPPVE, MACURA), and generative RL baselines (FlowRL, SDAC) in both sample efficiency and final return—shining brightest in complex, high-dimensional environments like Humanoid, Ant, and Walker2d.

Figure 2: Performance comparison of FTA (ours) against state-of-the-art baselines on MuJoCo benchmarks. Training curves depict mean returns over total interaction steps, with shaded regions representing the standard deviation across random seeds.
  • Slower Error Growth: On a log-error plot over normalized time, vanilla CFM's cumulative state error diverges with a steep slope of 4.21, whereas FTA cuts that slope down to 2.44.
  • Energy Savings: Across all eight environments, OT regularization cuts the average kinetic energy of generated flows by 30% to 45% (e.g., a 45% drop on Reacher and 35% on Humanoid), eliminating erratic zigzags in phase space.
  • Zero-Shot Transfer: Transferring from HalfCheetah to Walker2d, FTA reaches a return of ~5,000 within 200K steps, substantially outperforming ADMPO and MBPO trained directly on the target task.

Limitations and Future Work

  • Compute Overhead: Solving an ODE across a Transformer backbone to generate trajectories is noticeably heavier computationally than running forward passes through a simple MLP dynamics model.
  • Early Guidance Bias: Value-guided sampling relies on reward/value estimates; early in training when value estimates are noisy, this can introduce bias into the sampling process.
  • Scaling Up: While a 20-step horizon worked well for low-dimensional state vectors, scaling trajectory-level flow matching to ultra-long horizons or high-dimensional, pixel-based visual environments remains an open challenge for future work.

Summary updated

BibTeX
@inproceedings{boxiangtao2026mitigating,
  author = {BoxiangTao and Lei Guo and binwang and Zexin Wang and HongboDou},
  title = {{Mitigating Compounding Errors in Online Reinforcement Learning via Optimal Transport Regularized Flow Matching}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=bKuPATwnfb},
}

Loading related content...

Figure