# Contextual Flow Matching: Adaptive Step Selection in Flow Models for Efficient Visual Generation

*Divya Jyoti Bajpai, Arun Verma, Manjesh Kumar Hanawal*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/148315) · [OpenReview](https://openreview.net/forum?id=yjB0PiXm3S) · [alphaXiv](https://www.alphaxiv.org/abs/2610.03202) · [Open on the map](../papers.html#p148315)

Category: [Diffusion & Image Generation](../pcat/5.md) › [Diffusion Model Distillation and Alignment](../pgroup/101.md) · Type: new method · Keywords: flow matching, adaptive step selection, visual generation, inference acceleration, plug-and-play

Areas: [Generative Models (Diffusion & Flows)](../areas/generative-models.md) › Flow Matching and Diffusion › Improved Flow Matching

## Summary
CoFlow adaptively selects step counts per generation based on prompt features, achieving over 2.5× speedup while preserving visual quality.

## Explained to a 5-year-old
Some computers can draw pictures by following a smooth path, but they need many steps to finish. A new idea looks at what the picture is about and decides how many steps to take for each picture. This makes the drawing faster, like finishing a puzzle quicker. The method works for both single pictures and moving videos. It can be added to existing drawing computers without changing them.

## Explained to a 5-year-old, longer
Computers can make pictures using something called flow matching, which follows a smooth path to draw. To draw a picture, the computer must take many small steps, like stepping stones across a river. Taking many steps makes the picture good but also takes a long time. Some ideas tried to skip steps, but they either made the picture worse or needed extra work to train. The new idea looks at what the picture is about before drawing. It then decides how many steps to take for that particular picture. If the picture is simple, it takes fewer steps; if it is complex, it takes more. This way the computer can be fast when it can be fast and still be careful when needed. The method works for still pictures and also for videos that show movement. It can be added to existing picture-making computers without changing how they work. Because it does not need to retrain the whole computer, it is easy to use. This helps people get pictures quickly for games, art, and other fun uses.

## For a technical reader
The system dynamically adjusts the number of integration steps during generation based on the input prompt, reducing computational cost. It learns an online reward that balances speed and visual fidelity without altering the underlying generative model. This plug-and-play module can be applied to both image and video generation pipelines. The approach provides a theoretical understanding of how step selection impacts discretization error. As a result, users see faster outputs while maintaining quality, and the method requires no additional training of the base model.

## Problem
Generating high-quality visuals with flow models is computationally expensive because inference requires many sequential function evaluations. Existing acceleration methods either add training overhead, reduce quality, or ignore input-dependent variability.

## Method
The approach uses an inference-time adaptive step selection that adjusts the number of function evaluations based on prompt features. It is trained online with an unsupervised reward that balances speed and fidelity, and it operates as a plug-and-play module without modifying the underlying generative model.

## Results
The approach achieves over 2.5× speedup on image and video generation while preserving perceptual and semantic quality. It also provides theoretical insights linking adaptive step allocation to discretization error.

## Contributions
A plug-and-play inference-time method that adaptively selects step counts per generation, an online unsupervised training scheme balancing efficiency and fidelity, and theoretical analysis of adaptive step allocation. The method generalizes across image and video generation without retraining the base model.

## Research questions this paper is counted under

- [How can we accelerate sampling in flow-based generative models while maintaining high fidelity?](../q/722.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/148315)
