Improved Constrained Generation by Bridging Pretrained Generative Models

Xiaoxuan Liang, Saeid Naderiparizi, Yunpeng Liu, Berend Zwartsenberg, Frank WoodarXiv 2026

TL;DR

MBM++ is a novel fine-tuning framework that enforces complex, non-linear constraints on pretrained generative models (both diffusion and flow matching) without sacrificing sample quality. By evaluating constraint losses in the clean data space rather than on noisy intermediate states and using a lightweight parameter-efficient bridge embedding, it achieves a superior trade-off between constraint satisfaction and distributional fidelity.

What Problem Does This Paper Address?

Generative models like diffusion and flow matching excel at capturing complex, high-dimensional data distributions. However, when deployed in safety-critical domains like robotics or autonomous driving, their unconstrained nature poses risks: a generated vehicle trajectory might clip a curb or collide with another agent.

Enforcing real-world constraints is notoriously difficult because they are often non-linear, state-dependent, and implicitly defined via loss functions (e.g., collision avoidance) rather than clean, closed-form geometric sets. Existing solutions fall into two flawed camps:

  1. Training-free sampling guidance: Modifies trajectories at inference time, which often pushes samples off the data manifold, causing severe trajectory distortion and unrealistic behavior.
  2. Full model fine-tuning: Updates all weights to satisfy constraints but risks catastrophic forgetting, training instability, and a reduction in the diversity of generated samples.

The authors bridge this gap by introducing a method that injects constraint awareness directly into the training dynamics while preserving the underlying capabilities of the pretrained model.

Methods

The authors propose MBM++ (Manually Bridged Model ++), a parameter-efficient fine-tuning framework. Its architecture relies on two key innovations:

  1. Denoised-State Guidance: Instead of calculating constraint gradients on highly noisy intermediate states $x_t$ (which leads to high-variance, unreliable signals), MBM++ computes the constraint loss on the one-step denoised estimate $D_\theta(x_t; t)$. This shifts the guidance mechanism from noise space to data space, where the constraints are semantically meaningful. To avoid expensive backpropagation through the entire network, a stop-gradient operator (sg) is applied to the denoiser output during this step.
  2. Bridge Conditioning via Lightweight Embeddings: Rather than fine-tuning the entire backbone, the pretrained model weights are frozen. MBM++ introduces a lightweight MLP-based bridge embedding ($E_\phi$). This module takes the constraint gradient and injects it at the input level (augmenting the noisy state representation) and applies a residual correction at the output level to directly counteract constraint violations.

Importantly, this formulation mathematically unifies and applies equally well to both Diffusion Models (DMs) and Flow Matching (FM) frameworks.

Datasets

The framework was evaluated on two distinct benchmarks representing physical and geometric constraints:

  • Bouncing Balls Simulation: A physics-based dataset adapted from Gan et al. (2015) containing 100,000 scenarios of 10 balls moving and colliding elastically inside a closed box. The model must learn the dynamics while respecting hard constraints against ball-to-ball overlaps (collisions) and boundary infractions.
  • INTERACTION Dataset (Zhan et al., 2019): A real-world vehicle trajectory dataset. The authors focused on challenging multi-agent traffic scenarios (e.g., DR_DEU_Merging_MT, DR_DEU_Roundabout_OF) where models must predict future vehicle motions over a 3-second horizon without causing vehicle-to-vehicle collisions or driving off-road.

Key Insights and Ideas

  • The Power of Data-Space Gradients: Computing gradients on the denoised estimate acts as a clean surrogate for the final sample. This provides stable guidance even at early, high-noise stages of generation where traditional noise-space gradients point in random, unhelpful directions.
  • Freezing the Backbone is a Feature, Not a Limitation: By keeping the pretrained generative model frozen and only training the bridge embedding, the model retains its structural knowledge of the data distribution. This prevents the "distribution shift" or quality degradation typical of other guided methods.
  • The Pareto Frontier Shift: MBM++ uncovers a better compromise between likelihood (r-ELBO) and constraint satisfaction, pushing closer to the optimal top-left frontier of performance than prior fine-tuning or training-free baselines.

Key Results

Bouncing Balls

As shown in the paper's trade-off analysis, MBM++ dramatically reduces infractions while maintaining high likelihood:

  • Diffusion Setting: DM-MBM++ reduced collisions from 38.12% (Standard Diffusion) down to 0.01%, while maintaining an r-ELBO (-22.8) close to the unconstrained baseline and achieving the lowest overall distribution shift (HDH of 27.5).
  • Flow Matching Setting: FM-MBM++ reduced collisions from 29.17% to 2.35%, outperforming Adjoint Matching (AM) which sat at 4.67% and suffered from significantly worse likelihood.

Vehicle Trajectory Prediction

On the real-world INTERACTION dataset, MBM++ demonstrated superior safety without sacrificing accuracy:

Figure 1: Qualitative comparison of constrained trajectory generation. We visualize samples from the same traffic intersection scene and timestep, where gray dot trajectories indicate ground-truth agent motion and orange trajectories denote model predictions. Panel a shows an unconstrained diffusion baseline, which exhibits both offroad and collision violations while executing a left turn. Panel b shows a training-free guided method, MPGD without projection (He et al., 2024) that reduces violations but introduces noticeable trajectory distortion, including persistent offroad behavior and an abrupt acceleration during a right-turn maneuver toward the northeast, leading to a near-collision. Panel c shows our MBM++, which exhibits no offroad or collision violations while preserving realistic and coherent motion. All samples are generated from the same initial conditions.
  • In the DR_DEU_Merging_MT scenario, MBM++ achieved the lowest collision rate (0.27%) and the lowest displacement errors (min $\text{ADE}_6$: 0.180, min $\text{FDE}_6$: 0.452) across all tested models, proving that constraint-aware fine-tuning can actually improve trajectory accuracy by keeping predictions within feasible regions.

Limitations and Future Work

While MBM++ marks a significant step forward, the authors note a few limitations:

  • No Hard Guarantees: Because the method relies on gradient guidance rather than explicit geometric projection, constraint violations are drastically minimized but not completely eliminated to absolute zero in complex settings.
  • Computational Overhead: Evaluating constraint functions and computing gradients at every intermediate step during training adds computational weight, which can become a bottleneck if the constraint evaluation itself is highly expensive.
  • Boundary Sensitivity: The effectiveness of the denoised surrogate relies on specific smoothness assumptions; if these break down, gradient signals near the exact boundaries of feasible regions may become less informative.

Future directions include exploring adaptive step sizes near constraint boundaries and utilizing learned surrogate constraints to optimize gradient quality.

Summary updated

BibTeX
@misc{liang2026improved,
  author = {Xiaoxuan Liang and Saeid Naderiparizi and Yunpeng Liu and Berend Zwartsenberg and Frank Wood},
  title = {{Improved Constrained Generation by Bridging Pretrained Generative Models}},
  year = {2026},
  eprint = {2603.06742},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.06742},
}
Figure