Skip to content

ICLR papers

Search ICLR papers by title, author, or track. Open a paper’s abstract to read more.

Explore the ICLR analysis

Search results

161–180 of 282

  • ICLR · Workshop · Latent & Implicit Thinking – Going Beyond CoT Reasoning

    Denoising is not the End: Discrete Diffusion Language Models with Self-Correction

    Jinwei Zhang, Dimitri von Rütte, Yuhui Ding, Thomas Hofmann

    Abstract

    Discrete Diffusion Models have emerged as an effective approach to text generation, providing an alternative to autoregressive models. However, the generated texts often suffer from quality issues, including grammatical errors, lack of fluency and factual inaccuracies. This paper systematically evaluates different self-correction strategies for hybrid-noise (masking and uniform) discrete diffusion language models. The outputs of the base model are compared with self-corrected outputs under different strategies, with improvements measured in terms of quality, fluency, and fidelity. Our experiments show significant quality gains from iterative self-correction, with improvements in grammar, factuality, clarity, and creativity reaching double-digit percentages. We also observe a tradeoff between text quality and content preservation and identify optimal configurations that achieve significant quality enhancements while maintaining high fidelity to the original output. Finally, we find that it is optimal to allocate inference compute to denoising and self-correction in approximately equal proportions.

    Abstract source
  • ICLR · Workshop · The 3rd Workshop on Test-Time Updates (TTU)

    An Optimal Transport View of Activation Steering In Masked Diffusion Models

    Gert Lek, Chaoyi Zhu, Pin-Yu Chen, Robert Birke, Lydia Chen

    Abstract

    Diffusion Large Language Models (dLLMs) offer a non-autoregressive alternative to left-to-right decoding, but inference-time control in dLLMs remains underdeveloped relative to autoregressive LLMs. Prior activation-steering methods for masked diffusion models (MDMs), a prominent dLLM formulation, focus primarily on concept negation and employ heuristics that do not explicitly optimize the transport objective. We introduce an Optimal Transport (OT) view of activation steering for MDMs: given contrastive prompt distributions, we learn a lightweight affine map that transports pooled activation distributions from a source behavior to a target behavior. This perspective unifies common steering rules (activation addition, mean-shift, directional ablation) as special cases of an affine transport map, and motivates the use of the OT estimator that matches first- and second-order moments. Across three state-of-the-art dLLMs (LLaDA-Instruct, LLaDA 1.5, Dream-Instruct), affine OT steering improves instruction-following accuracy (e.g., +6.5 to +11.9 absolute points) with no inference-time overhead.

    Abstract source
  • ICLR · Workshop · The 2nd Workshop on Foundation Models for Science: Real-World Impact and Science-First Design

    WIND: Weather Inverse Diffusion for Zero-Shot Atmospheric Modeling

    Andreas Fürst, Michael Aich, Florian Sestak, Carlos Ruiz-Gonzalez, Niklas Boers, Johannes Brandstetter

    Abstract

    Deep learning has revolutionized weather and climate modeling, yet the current landscape remains fragmented: highly specialized models are typically trained individually for distinct tasks. To unify this landscape, we introduce WIND, a single pre-trained foundation model capable of replacing specialized baselines across a vast array of tasks. Crucially, in contrast to previous atmospheric foundation models, we achieve this without any task-specific fine-tuning. To learn a robust, task-agnostic prior of the atmosphere, we pre-train WIND with a self-supervised video reconstruction objective, utilizing an unconditional video diffusion model to iteratively reconstruct atmospheric dynamics from a noisy state. At inference, we frame diverse domain-specific problems strictly as inverse problems and solve them via posterior sampling. This unified approach allows us to tackle highly relevant weather and climate problems, including probabilistic forecasting, spatial and temporal downscaling, sparse reconstruction and enforcing conservation laws purely with our pre-trained model. We further demonstrate the model's capacity to generate physically consistent counterfactual storylines of extreme weather events under global warming scenarios. By combining generative video modeling with inverse problem solving, WIND offers a computationally efficient paradigm shift in AI-based atmospheric modeling.

    Abstract source
  • ICLR · Workshop · The 2nd Workshop on Foundation Models for Science: Real-World Impact and Science-First Design

    Full-length mRNA Design with Reward-Guided Masked Diffusion Model Fine-Tuning

    Sawan Patel, Sophia Tang, Pranam Chatterjee, Sherwood Yao

    Abstract

    High-fitness mRNA design requires the simultaneous optimization of multiple application-critical properties, but the design principles governing this high- dimensional landscape remain poorly understood. This motivates the need for methods that provide systematic, controllable generation of mRNA sequences. To address this, we introduce T3PO-mRNA, a framework for computing reward- guided discrete diffusion trajectories that iteratively construct increasingly accurate approximations of the Pareto frontier. Our approach leverages tree search to identify high-reward sequence trajectories and uses these trajectories to fine-tune diffusion models on progressively stronger sequence buffers. We demonstrate that T3PO-mRNA effectively designs therapeutic mRNAs with optimized half-life and translation efficacy, enabling both improved multi-objective performance and efficient inference-time sampling over prior inference-time guidance methods

    Abstract source
  • ICLR · Workshop · The 2nd Workshop on Foundation Models for Science: Real-World Impact and Science-First Design

    Vehicle Surface Pressure Prediction from 2D Sketches via a Pre-Trained Diffusion Model

    Shunya Nakamura

    Abstract

    In the early stages of automotive design, designers explore shape concepts using 2D sketches, yet existing aerodynamic evaluation methods require 3D geometry representations. We propose an end-to-end approach that directly predicts surface pressure coefficient (Cp) distributions from 2D sketch images via image-to-image translation. By fine-tuning a pre-trained image editing diffusion model (Qwen-Image-Edit-2511) with LoRA on the large-scale automotive aerodynamics dataset DrivAerNet++, we achieve Relative L2 Error (Rel L2) = 0.165 and R$^2$ = 0.955 on the test set. Even with training data reduced to 2.2\% (128 samples), the model maintains Rel L2 = 0.218, demonstrating applicability in practical settings where CFD simulation costs are prohibitive. We confirm good generalization to unseen base vehicle categories while revealing that prediction quality degrades for shape features absent from training data, highlighting that coverage of shape features matters more than category labels. We also investigate calibrated uncertainty (UQ) via diffusion ensemble, revealing when variance reliably indicates prediction error. These results demonstrate the feasibility of aerodynamic evaluation without 3D geometry representations, opening a path toward aerodynamic feedback at the earliest design stage.

    Abstract source
  • ICLR · Workshop · The 2nd Workshop on Foundation Models for Science: Real-World Impact and Science-First Design

    SaDiT: Efficient Protein Backbone Design via Latent Structural Tokenization and Diffusion Transformers

    Shentong Mo, Lanqing Li

    Abstract

    Generative models for de novo protein backbone design have achieved remarkable success in creating novel protein structures. However, these diffusion-based approaches remain computationally intensive and slower than desired for large-scale structural exploration. While recent efforts like Proteina have introduced flow-matching to improve sampling efficiency, the potential of tokenization for structural compression and acceleration remains largely unexplored in the protein domain. In this work, we present $\textit{SaDiT}$, a novel framework that accelerates protein backbone generation by integrating SaProt Tokenization with a Diffusion Transformer (DiT) architecture. SaDiT leverages a discrete latent space to represent protein geometry, significantly reducing the complexity of the generation process while maintaining theoretical SE(3) equivalence. To further enhance efficiency, we introduce an IPA Token Cache mechanism that optimizes the Invariant Point Attention (IPA) layers by reusing computed token states during iterative sampling. Experimental results demonstrate that SaDiT outperforms state-of-the-art models, including RFDiffusion and Proteina, in both computational speed and structural viability. We evaluate our model across unconditional backbone generation and fold-class conditional generation tasks, where SaDiT shows superior ability to capture complex topological features with high designability.

    Abstract source
  • ICLR · Workshop · The 2nd Workshop on Foundation Models for Science: Real-World Impact and Science-First Design

    MOOSE: Targeted Small Molecule Generation via Multi-Objective-Guided Discrete Diffusion

    Elizabeth Mahood, William Pattie, Ethan Jones, Sophia Vincoff, Adi Mashiach, Pranam Chatterjee

    Abstract

    We introduce MOOSE, a Multi-Objective Optimization framework for property-driven Small-molecule Engineering using discrete diffusion. MOOSE builds on GenMol, a masked discrete diffusion model that generates molecules in a fragment-based token space, and adapts it to goal-directed molecular design through iterative fine-tuning toward desired property distributions. By scoring target binding affinity with a rapid, state-of-the-art sequence-based surrogate model (Bonbon), together with standard chemical heuristics for drug-likeness and synthetic accessibility, MOOSE enables scalable optimization without reliance on docking during generation. We evaluate MOOSE on a diverse set of protein targets relevant to therapeutic discovery. Across all targets, molecules generated by MOOSE achieve stronger predicted binding affinity compared to known reference ligands, while maintaining chemical diversity, synthesizability, and drug-likeness. Together, these results demonstrate that MOOSE can be directly integrated into practical small-molecule discovery pipelines, enabling scalable multi-objective optimization without docking-in-the-loop.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    UniGuide: Learning Guidance Policies for Multi-Objective Diffusion Sampling

    Mahmoud Hegazy, Navid Bagheri Shouraki, Eric Moulines, Aymeric Dieuleveut, Michael Jordan, Yazid Janati el idrissi

    Abstract

    Guidance is the primary mechanism for steering conditional diffusion models, yet modern samplers rely on coupled, step-dependent design choices that obscure trade-offs between alignment, realism, and diversity. We introduce UniGuide, a unified framework that formulates guided diffusion sampling as a sequential decision-making problem, where guidance actions are selected along the denoising trajectory based on the evolving model state. UniGuide employs a flexible parameterization assigning distinct guidance to the denoiser and the noise-prediction term. To address multi-objective trade-offs, we learn a low-dimensional, preference-conditioned policy that maps intermediate model states to per-step guidance parameters. This enables continuous traversal of a Pareto frontier at inference time via a preference vector, eliminating the need for retuning or manual schedule design. Experiments on conditional image generation demonstrate effective Pareto-optimal guidance with pretrained diffusion backbones.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    Inference-Time Attribute Distribution Alignment for Unconditional Diffusion

    Hao Luan, See-Kiong Ng, Chun Kai Ling

    Abstract

    Controllable generation is crucial to real-world applications of diffusion models. However, many applications require control beyond individual samples: the distribution of semantic attributes (e.g., proportions of styles, objects, or demographics) over generated samples should match user-specified targets that may change at test time. We formalize this setting as the inference-time attribute distributional alignment problem for pretrained diffusion models. To address this, we cast the attribute distributional alignment as an optimal control problem over the reverse diffusion process, viewing the process as the rollout of a dynamical system and augmenting it with an additive, time-dependent perturbation as control. We solve for the perturbations using an optimal-control-based algorithm to optimize a differentiable distribution-matching objective while penalizing control effort to preserve data fidelity. Experiment results in image generation demonstrate that our proposed plug-and-play approach can better align attribute distributions to diverse test-time targets compared to inference-time baselines, without retraining or fine-tuning the pretrained diffusion model.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    Guided Star-Shaped Masked Diffusion

    Viacheslav Meshchaninov, Egor Shibaev, Artem Makoian, Ivan Klimov, Nikita Balagansky, Daniil Gavrilov, Aibek Alanov, Dmitry P. Vetrov

    Abstract

    The performance of pre-trained masked diffusion models is often constrained by their sampling procedure, which makes decisions irreversible and struggles in low-step generation regimes. We introduce a novel sampling algorithm that works with pre-trained models and, after a lightweight fine-tuning of a single layer, significantly improves sample quality and efficiency. Our method reformulates the generation process using a star-shaped paradigm, which inherently allows for error correction. To make this process effective, we augment it with a learnable remasking module that intelligently identifies and revises likely errors. This approach yields a substantial quality boost, particularly when using a small number of sampling steps. We extensively ablate key components of our approach and show its usability in different scenarios. In comprehensive experiments on text, and code generation, our sampling algorithm outperforms or matches existing methods.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    WIND: Weather Inverse Diffusion for Zero-Shot Atmospheric Modeling

    Michael Aich, Andreas Fürst, Florian Sestak, Carlos Ruiz-Gonzalez, Niklas Boers, Johannes Brandstetter

    Abstract

    Deep learning has revolutionized weather forecasting, but many challenges remain, including climate modelling. Moreover, the current landscape remains fragmented: highly specialized models are typically trained individually for distinct tasks. To unify this landscape, we introduce WIND, a single pre-trained foundation model capable of replacing specialized baselines across a vast array of tasks. Crucially, in contrast to previous atmospheric foundation models, we achieve this without any task-specific fine-tuning. To learn a robust, task-agnostic prior of the atmosphere, we pre-train WIND with a self-supervised video reconstruction objective, utilizing an unconditional video diffusion model to iteratively reconstruct atmospheric dynamics from a noisy state. At inference, we frame diverse domain-specific problems strictly as inverse problems and solve them via posterior sampling. This unified approach allows us to tackle highly relevant weather and climate problems, including probabilistic forecasting, spatial and temporal downscaling, reconstruction of spatial fields from from sparse observations, and enforcing global dry air mass conservation purely with our pre-trained model. We further demonstrate how WIND can be applied to explore extreme weather events under prescribed out-of-distribution warming scenarios. By combining generative video modeling with inverse problem solving, WIND offers a computationally efficient paradigm shift in AI-based atmospheric modeling.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    Divide-and-Denoise: A Game-Theoretic Method for Fairly Composing Diffusion Models

    Abhi Gupta, Polina Barabanshchikova, Vikas Garg, Samuel Kaski, Tommi Jaakkola

    Abstract

    Despite the abundance of pre-trained diffusion models, it is still not obvious how to use them collectively. We propose a coordination approach based on a fair yet efficient division of labor. Divide-and-Denoise uses multiple pre-trained diffusion models to refine a noisy sample over time by alternating between (i) dividing the sample into regions satisfying game-theoretic criteria and (ii) denoising each region with its assigned model. This creates a composite denoising process that evolves with a division process. In the conditional image generation setting, we evaluate Divide-and-Denoise on the coordination of single-concept diffusion models, comparing it with prior compositional approaches and a multi-concept model. Across several metrics including the GenEval benchmark, our method generates images capturing each model's strengths, outperforming baselines and resolving common failures like missing objects and mismatched attributes.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    Enhancing Reasoning for Diffusion LLMs via Distribution Matching Policy Optimization

    Yuchen Zhu, Wei Guo, Jaemoo Choi, Petr Molodyk, Bo Yuan, Molei Tao, Yongxin Chen

    Abstract

    Diffusion large language models (dLLMs) are promising alternatives to autoregressive large language models (AR-LLMs), as they potentially allow higher inference throughput. Reinforcement learning (RL) is a crucial component for dLLMs to achieve comparable performance with AR-LLMs on important tasks, such as reasoning. However, RL algorithms that are well-suited for dLLMs' unique characteristics have yet to be developed. This paper proposes **Distribution Matching Policy Optimization (DMPO)**, a principled and theoretically grounded RL fine-tuning method specifically designed to enhance the reasoning capabilities of dLLMs by matching the dLLM policy distribution to the optimal, reward-tilted one through cross-entropy optimization. We identify a key challenge in the implementation with a small training batch size and propose several effective solutions through a novel weight baseline subtraction technique. DMPO exhibits superior performance on multiple reasoning benchmarks without supervised fine-tuning, with an accuracy improvement of up to $54.3\\%$ over previously SOTA baselines and $66.41\\%$ over the base model, underscoring the effectiveness of the distribution matching framework. Our code is available at https://github.com/yuchen-zhu-zyc/DMPO.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    Optimizing Remasking Schedules for Reasoning in Discrete Diffusion Models

    Radostin Cholakov, Zeyneb Kaya, Nicole H. Ma

    Abstract

    Discrete diffusion language models (DLLMs) have emerged as a new paradigm of language modeling that offers improved inference efficiency and nonlinear generation and reasoning. While standard methods rely on fixed or heuristic schedules (e.g., random or confidence-based), we present LeADS, a framework that enables dynamic inference-time control for DLLMs with a learned remasking scheduler optimized for downstream performance. LeADS chooses what tokens are denoised at each diffusion step based on the internal representations of the model and dynamically allocates compute for token efficiency. On mathematical reasoning tasks, LeADS achieves 19.2% relative improvement (12 pp) over low-confidence based denoising schedules and reduces required diffusion steps by up to 15.3%.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    MolHIT: Advancing Molecular-Graph Generation with Hierarchical Discrete Diffusion Models

    Hojung Jung, Rodrigo Hormazabal, Jaehyeong Jo, Youngrok Park, Kyunggeun Roh, Se-Young Yun, Sehui Han, Dae-Woong Jeong

    Abstract

    Molecular generation with diffusion models has emerged as a promising direction for AI-driven drug discovery and materials science. While graph diffusion models have been widely adopted due to the discrete nature of 2D molecular graphs, existing models suffer from low chemical validity and struggle to meet the desired properties compared to 1D modeling. In this work, we introduce MolHIT, a powerful molecular graph generation framework that overcomes long-standing performance limitations in existing methods. MolHIT is based on the Hierarchical Discrete Diffusion Model, which generalizes discrete diffusion to additional categories that encode chemical priors, and decoupled atom encoding that splits the atom types according to their chemical roles. Overall, MolHIT achieves new state-of-the-art performance on the MOSES dataset with near-perfect validity for the first time in graph diffusion, surpassing strong 1D baselines across multiple metrics. We further demonstrate strong performance in downstream tasks, including multi-property guided generation and scaffold extension.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    MacroGuide: Topological Guidance for Macrocycle Generation

    Alicja Maksymiuk, Alexandre Duplessis, Michael Bronstein, Alexander Tong, Fernanda Duarte, Ismail I Ceylan

    Abstract

    Macrocycles are ring-shaped molecules that offer a promising alternative to small-molecule drugs due to their enhanced selectivity and binding affinity against difficult targets. Despite their chemical value, they remain underexplored in generative modeling, likely owing to their scarcity in public datasets and the challenges of enforcing topological constraints in standard deep generative models. We introduce MacroGuide: Topological Guidance for Macrocycle Generation, a diffusion guidance mechanism that uses Persistent Homology to steer the sampling of pretrained molecular generative models toward the generation of macrocycles, in both unconditional and conditional (protein pocket) settings. At each denoising step, MacroGuide constructs a Vietoris-Rips complex from atomic positions and promotes ring formation by optimizing persistent homology features. Empirically, applying MacroGuide to pretrained diffusion models increases macrocycle generation rates from 1% to 99%, while matching or exceeding state-of-the-art performance on key quality metrics such as chemical validity, diversity, and PoseBusters checks.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    AReUReDi: Annealed Rectified Updates for Refining Discrete Flows with Multi-Objective Guidance

    Tong Chen, Yinuo Zhang, Sophia Vincoff, Pranam Chatterjee

    Abstract

    Designing sequences that satisfy multiple, often conflicting, objectives is a central challenge in therapeutic and biomolecular engineering. Existing generative frameworks largely operate in continuous spaces with single-objective guidance, while discrete approaches lack guarantees for multi-objective Pareto optimality. We introduce AReUReDi (Annealed Rectified Updates for Refining Discrete Flows), a discrete optimization algorithm with theoretical guarantees of convergence to the Pareto front. Building on Rectified Discrete Flows (ReDi), AReUReDi combines Tchebycheff scalarization, locally balanced proposals, and annealed Metropolis-Hastings updates to bias sampling toward Pareto-optimal states while preserving distributional invariance. Applied to peptide and SMILES sequence design, AReUReDi simultaneously optimizes up to five therapeutic properties (including affinity, solubility, hemolysis, half-life, and non-fouling) and outperforms both evolutionary and diffusion-based baselines. These results establish AReUReDi as a powerful, sequence-based framework for multi-property biomolecule generation.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    Stratified Hazard Sampling: Minimal-Variance Event Scheduling for CTMC/DTMC Discrete Diffusion and Flow Models

    Seunghwan Jang, SooJean Han

    Abstract

    Uniform-noise discrete diffusion and flow models (e.g., D3PM, SEDD, UDLM, DFM) generate sequences non-autoregressively by iteratively refining randomly initialized vocabulary tokens through multiple context-dependent replacements. These models are typically formulated as time-inhomogeneous CTMC/DTMC processes and sampled using independent Bernoulli change decisions at each discretization step. This induces Poisson-binomial variance in per-position jump counts that grows with the number of required edits, leading to the characteristic under-editing (residual noise) and over-editing (cascading substitutions) failure modes that degrade sample quality, especially under tight discretization budgets. In contrast, absorbing-state (mask-start) models avoid this instability by allowing each position to jump at most once. We propose Stratified Hazard Sampling (SHS), a training-free, drop-in, and hyperparameter-free inference principle for any sampler that admits a stay-vs.- replace decomposition. SHS models per-token edits as events driven by cumulative hazard (CTMC) or cumulative jump mass (DTMC) and places events by stratifying this cumulative quantity: with a single random phase per position, a token is updated whenever its accumulated hazard crosses unit-spaced thresholds. This preserves the expected number of jumps while achieving the minimum possible conditional variance among unbiased integer estimators (bounded by 1/4 for any fixed cumulative mass), without altering per-jump destination sampling and thus retaining multimodality. Experiments on uniform-noise discrete diffusion language models show that SHS consistently improves sample quality. We further show that SHS improves robustness under token-level blacklist filtering, with benefits increasing as lexical constraints grow more severe.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    DiffAntiSeq: Target-Steered Diffusion in Latent Sequence Space for Antibody Library Design

    Fang Wu

    Abstract

    Antibodies are among the most versatile molecules in therapeutic discovery, yet computational antibody library design remains challenging when evolutionary signals from multiple sequence alignments are sparse or unreliable. We present DiffAntiSeq, a controllable diffusion-based generative framework for efficient, target-specific antibody sequence design. DiffAntiSeq performs non-autoregressive denoising in a continuous latent residue embedding space, enabling global sequence refinement beyond the limitations of autoregressive or discrete diffusion models. To steer generation toward desired functional outcomes, we incorporate gradient-based classifier guidance derived from protein language models trained to predict antibody–antigen binding affinity and specificity. We evaluate DiffAntiSeq using large-scale antibody sequence and binding data from the AlphaSeq platform, and apply it to the design of thousands of single-chain variable fragment antibodies targeting a SARS-CoV-2 peptide. Across extensive in silico analyses and structure-based validation, DiffAntiSeq consistently outperforms state-of-the-art machine-learning-driven evolution methods, producing antibody libraries with substantially stronger binding while maintaining meaningful sequence diversity. These results demonstrate that controllable diffusion in continuous latent sequence space provides an effective and scalable paradigm for antibody library design in data-sparse and structure-limited settings.

    Abstract source
  • ICLR · Workshop · ReALM-GEN: Real-World Constrained and Preference-Aligned Flow- and Diffusion-based Generative Models

    HardFlow: Hard-Constrained Sampling for Flow-Matching Models via Trajectory Optimization

    Zeyang Li, Kaveh Alim, Navid Azizan

    Abstract

    Diffusion and flow-matching have emerged as powerful methodologies for generative modeling, with remarkable success in capturing complex data distributions and enabling flexible guidance at inference time. Many downstream applications, however, demand enforcing hard constraints on generated samples—for example, robot trajectories must avoid obstacles—a requirement that goes beyond simple guidance. Prevailing projection-based approaches constrain the entire sampling path to the constraint manifold, which is overly restrictive and degrades sample quality. In this paper, we introduce a novel framework that reformulates hard-constrained sampling as a trajectory optimization problem. Our key insight is to leverage numerical optimal control to steer the sampling trajectory so that constraints are satisfied precisely at the terminal time. By exploiting the underlying structure of flow-matching models and adopting techniques from model predictive control, we transform this otherwise complex constrained optimization problem into a tractable surrogate that can be solved efficiently and effectively. Furthermore, this trajectory optimization perspective offers significant flexibility beyond mere constraint satisfaction, allowing for the inclusion of integral costs to minimize distribution shift and terminal objectives to further enhance sample quality, all within a unified framework. We provide a control-theoretic analysis of our method, establishing bounds on the approximation error between our tractable surrogate and the ideal formulation. Extensive experiments across diverse domains, including robotics (planning), partial differential equations (boundary control), and vision (text-guided image editing), demonstrate that our algorithm, which we name HardFlow, substantially outperforms existing methods in both constraint satisfaction and sample quality.

    Abstract source