Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Reader activity
0 Useful 10 Views 3 min Read — No ratings
Artificial Intelligence
3 min read

One Tiny Gate, Any Compute Budget: BAG Learns to Schedule Diffusion Caching

Westlake University and StepFun propose BAG, a sub-1K parameter gating network that learns from offline search to make per-step compute-or-cache decisions during diffusion sampling, jointly considering global budget and local trajectory changes, achieving superior reconstruction at same compute across FLUX, Wan2.1, and Qwen-Image models.

Diffusion models require dozens of denoising steps, each invoking a large network, making inference efficiency a persistent bottleneck. Caching methods like TeaCache and MagCache reuse features across steps but lack global budget planning, while static scheduling approaches like BudCache (ICML 2026) pre-compute a fixed schedule that cannot adapt to per-prompt trajectory changes.

The authors frame caching as a scheduling problem: given a limited compute budget (e.g., only 10 full computations out of 50 steps), where should those computations be placed? An experiment on Wan2.1 shows that per-prompt offline search for an optimal schedule reduces LPIPS reconstruction error by 22%–32% compared to SeaCache at the same budget, proving that input-adaptive scheduling has significant headroom.

BAG (Budget-Aware Gating) adopts a three-stage design: (1) Offline search for reference schedules across diverse prompts and budgets, treating the resulting schedules as supervision targets. (2) Distillation of those schedules into a tiny gating network (<1K parameters) that takes six scalar inputs — three describing global budget state (remaining steps, remaining compute, budget ratio) and three capturing local trajectory change (feature difference, timestep, guidance scale). Training the gate takes roughly one minute on a single GPU. (3) Online deployment where the gate decides at each step whether to recompute or reuse cached features, exactly meeting the user-specified budget. The same gate generalizes across different acceleration ratios (2.5× to 5.0×), sampling step counts, random seeds, resolutions, and guidance strengths without retraining.

Experiments on FLUX.1-dev, Wan2.1, and Qwen-Image-2512 demonstrate that BAG consistently outperforms baseline caching methods (TeaCache, SeaCache, BudCache) across all tested budgets. At 5× acceleration (10 full computations out of 50 steps), BAG preserves fine details such as superhero capes and “POW” bubbles that are lost when simply reducing sampling steps. A variant, BAG-R, swaps the offline search objective to align with human preference, showing the framework’s flexibility.

The runtime overhead is minimal: per step the gate processes six scalars through a micro-network. This makes BAG practical for production services where users may request a quick preview (low budget) followed by a high-quality generation (high budget), or where the system dynamically adjusts compute allocation based on load — simply by turning a “budget knob” at inference time.

Figure 1: Same gate covers different acceleration ratios while precisely meeting specified compute budgets.
Figure 1: Same gate covers different acceleration ratios while precisely meeting specified compute budgets.
Figure 2: BAG three-step pipeline — offline search reference schedules, distill into lightweight gate, online step-by-step decisions meeting budget exactly.
Figure 2: BAG three-step pipeline — offline search reference schedules, distill into lightweight gate, online step-by-step decisions meeting budget exactly.
Table 1: Quantitative comparison on FLUX.1-dev (left) and Wan2.1 (right); Qwen-Image results in paper.
Table 1: Quantitative comparison on FLUX.1-dev (left) and Wan2.1 (right); Qwen-Image results in paper.
Figure 3: Full compute steps reduced from 24 to 10 — top row: fewer sampling steps; bottom row: same BAG gate preserves composition and details.
Figure 3: Full compute steps reduced from 24 to 10 — top row: fewer sampling steps; bottom row: same BAG gate preserves composition and details.

For attribution, corrections or content rights, contactadmin@besthub.dev

Report an issue with this article

Discussion 1

Write a comment

Sign in to join the discussion

angel leo ·

good!

Useful (1) Reply