Introduction
We address Stage 2 of autoregressive video diffusion: initialize a student that generates good videos with few denoising steps per frame, under a fixed compute budget. The student must work both on short clips and when its generated frames become the context for later frames. This is difficult because the teacher's multi-step trajectories are not the states visited by a re-noising student chain, while causal errors persist in the key-value context and can compound from frame to frame. The context-free first frame is also a different problem from a continuation conditioned on an already generated frame.
The field has developed causal autoregressive distillation methods [1, 2], methods aimed at the train-test gap in autoregressive video [3], and on-policy flow-map distillation [4]. Teacher-forcing and self-forcing recipes provide related ways to supervise a causal student [5]. Our proposal combines these ideas around the states and contexts that the deployed student actually visits.
Method
We call the method OCF, for on-policy causal flow-map distillation. A frozen causal teacher supplies endpoint targets, while the student is updated only from states collected by its own sampler. We use one branch for continuation frames and a second branch for the context-free first frame.
On-policy continuation states
Let be a student state at noise level , with condition . The student predicts a clean endpoint
For an intermediate chain step, the next state is re-noised from that prediction,
We roll out a whole clip using a randomly selected sampler exposed by the context, choose one visited state in each frame, and save its state and noise level. After each frame, we encode the student's own clean prediction at zero noise so that the next frame sees the same causal cache it will see at deployment. The final recipe fixes CONTEXT = "self", so the continuation target is conditioned on the generated clip rather than a ground-truth clip.
self.opt = torch.optim.AdamW([p for p in self.student.parameters() if p.requires_grad],
lr=LR, betas=BETAS, weight_decay=WD)
self.template = ctx.stage1_state_dict()
self.ema = {_clean(n): p.detach().float().clone() for n, p in self.student.named_parameters()}
self.F = ctx.num_frames
self.L = ctx.frame_seq_length
self.u1 = 1.0 / (2 * self.F) # units of one single-frame forward
self.grids = {N_FIRST: _grid(N_FIRST), N_CONT: _grid(N_CONT)} budget = ctx.meter.budget
self.b_new = int(min(MAX_NEW, max(1, round(budget / 15000.0))))
self.b_train = max(1, int(round(self.b_new * REUSE)))
# first-frame branch sized to ~FRAC_FIRST of the budget
avg_first = N_FIRST * 0.625 # mean solve length over the 4 chain states
u_first = 0.14 + 2 * avg_first * self.u1 + REUSE * 3 * self.u1
u_clip = (1.8 + 1.0 + 2 * self.u1 * (avg_first + 9.5 * (self.F - 1))) * self.b_new \
+ 3.0 * self.b_train
self.b0_new = int(min(4 * MAX_NEW, max(1, round(FRAC_FIRST / (1 - FRAC_FIRST) * u_clip / u_first))))
self.b0_train = max(1, int(round(self.b0_new * REUSE)))
self.buf, self.buf0 = [], []
self.cap, self.cap0 = max(4 * self.b_train, 8), max(4 * self.b0_train, 16)
self.n_steps = 0
s = EMA_REL
self.gamma = float(np.roots([1, 7, 16 - s ** -2, 12 - s ** -2]).real.max())Teacher flow-map targets
For each saved state, the teacher starts from that state and uses the same context. The conditional and unconditional teacher predictions are combined with classifier-free guidance,
The code integrates this teacher field with a DPM-Solver++(2M), -form update. Its grid is generated by taking uniformly spaced values from to and mapping them as , with the final value set exactly to zero. We use for the first-frame solve and for continuation solves. The solve begins at the grid point nearest the sampled student noise level. For the second-order update, if is the log-SNR increment and , the code uses
# ----------------------------------------------------------------- teacher
@torch.no_grad()
def _solve(self, x, s0, n, cond2, kv=None, ca=None, start=0):
"""Teacher CFG PF-ODE from sigma s0 to 0 on the n-grid (DPM-Solver++(2M), x0 form)."""
g = self.grids[n]
k0 = min(range(n), key=lambda k: abs(g[k] - s0))
B = x.shape[0]
dev = x.device
x = x.float()
prev_x0, prev_h = None, None
for k in range(k0, n):
s, s_next = g[k], g[k + 1]
ts = torch.full([2 * B, 1], s * 1000.0, device=dev)
xin = x.repeat(2, 1, 1, 1, 1).to(torch.bfloat16)
if kv is None:
flow, _ = self.teacher(xin, cond2, ts)
else:
flow, _ = self.teacher(xin, cond2, ts, kv_cache=kv, crossattn_cache=ca, current_start=start)
flow = flow.float()
v = flow[B:] + CFG * (flow[:B] - flow[B:])
x0 = x - s * v
if s_next == 0.0:
return x0
h = math.inf if s >= 1.0 - 1e-9 else math.log((1 - s_next) / s_next) - math.log((1 - s) / s)
if prev_x0 is None or math.isinf(prev_h):
d = x0
else:
r = prev_h / h
d = (1 + 0.5 / r) * x0 - (0.5 / r) * prev_x0
x = (s_next / s) * x + (1 - s_next) * (1 - math.exp(-h)) * d
prev_x0, prev_h = x0, h
return x # ------------------------------------------------------- continuation data
@torch.no_grad()
def _fresh_clips(self):
ctx = self.ctx
B = self.b_new
dev = ctx.device
di = ctx.data.next_indices(B)
cond = ctx.data.cond(di)
cond2 = self._cond2(cond, B)
use_gt = (CONTEXT == "gt") or (CONTEXT == "mix" and random.random() < 0.5)
gt = ctx.data.latents(di).to(torch.bfloat16) if use_gt else None
sampler = random.choice(SAMPLERS)
shape = (B, self.F, 16) + tuple(ctx.latent_hw)
kv, ca = self._kv(B)
out = torch.empty(shape, dtype=torch.bfloat16, device=dev)
states = torch.empty(shape, dtype=torch.bfloat16, device=dev)
sig = torch.empty(B, self.F, device=dev)
for i in range(self.F):
sched = [t / 1000.0 for t in (ctx.samplers[sampler]["first"] if i == 0
else ctx.samplers[sampler]["rest"]).tolist()]
pick = random.randrange(len(sched))
x = torch.randn((B, 1) + shape[2:], device=dev)
for j, s in enumerate(sched):
if j == pick:
states[:, i:i + 1] = x.to(torch.bfloat16)
sig[:, i] = s
flow, _ = self.student(x.to(torch.bfloat16), cond, torch.full([B, 1], s * 1000.0, device=dev),
kv_cache=kv, crossattn_cache=ca, current_start=i * self.L)
x0 = x - s * flow.float()
if j + 1 < len(sched):
x = (1 - sched[j + 1]) * x0 + sched[j + 1] * torch.randn_like(x0)
out[:, i:i + 1] = x0.to(torch.bfloat16)
c = gt[:, i:i + 1] if use_gt else out[:, i:i + 1]
self.student(c, cond, torch.zeros([B, 1], device=dev), kv_cache=kv, crossattn_cache=ca,
current_start=i * self.L)
context = gt if use_gt else outA separate first-frame stream
The first frame has no visual context, so we collect it separately from states visited by the student's designated first-frame chain. The teacher labels each saved state with the same -point solve. This stream receives approximately FRAC_FIRST = 0.25 of the available compute, while the continuation stream uses the remaining allocation. Both streams feed small FIFO buffers; each training step takes the newest samples and randomly reuses older labels.
# -------------------------------------------------------- first-frame data
@torch.no_grad()
def _fresh_first(self):
ctx = self.ctx
B = self.b0_new
dev = ctx.device
di = ctx.data.next_indices(B)
cond = ctx.data.cond(di)
pick = random.randrange(len(self.first))
x = torch.randn((B, 1, 16) + tuple(ctx.latent_hw), device=dev)
for j in range(pick):
s = self.first[j]
flow, _ = self.student(x.to(torch.bfloat16), cond, torch.full([B, 1], s * 1000.0, device=dev))
x0 = x - s * flow.float()
x = (1 - self.first[j + 1]) * x0 + self.first[j + 1] * torch.randn_like(x0)
s0 = self.first[pick]
tgt = self._solve(x, s0, N_FIRST, self._cond2(cond, B))
for b in range(B):
self.buf0.append((di[b], x[b].to(torch.bfloat16), s0, tgt[b].to(torch.bfloat16)))
self.buf0 = self.buf0[-self.cap0:]Loss, optimization, and export
For continuation samples, we compute a mean squared endpoint error over latent dimensions for every frame. For first-frame samples we compute the same error over the single frame. With continuation buffer , first-frame buffer , and , the combined loss is
We optimize the student with AdamW at learning rate , betas , weight decay , a linear warmup over WARMUP = 20, and gradient-norm clipping at . The training reuse factor is REUSE = 3.0, and fresh clips per step are capped by MAX_NEW = 4. After each update, a power-function EMA is applied with relative width EMA_REL = 0.1; export starts from the Stage-1 state dictionary and replaces the student parameters with the EMA values.
def step(self, it):
ctx = self.ctx
u0 = ctx.meter.units
self._fresh_clips()
self._fresh_first()
lr = LR * min(1.0, (self.n_steps + 1) / WARMUP)
for g in self.opt.param_groups:
g["lr"] = lr
clips = self._draw(self.buf, self.b_new, self.b_train)
firsts = self._draw(self.buf0, self.b0_new, self.b0_train)
n_items = len(clips) * self.F + len(firsts)
self.opt.zero_grad(set_to_none=True)
stats = {}
for (di, context, states, sig, tgt) in clips:
_, pred = self.student(states[None], ctx.data.cond([di]), sig[None] * 1000.0, clean_x=context[None])
per = ((pred.float() - tgt[None].float()) ** 2).mean(dim=(2, 3, 4))[0]
(per.sum() / n_items).backward()
stats.setdefault("f0", []).append(per[0].item())
stats.setdefault("f1", []).append(per[1].item())
stats.setdefault("f2+", []).append(per[2:].mean().item())
di = [d for (d, _, _, _) in firsts]
x = torch.stack([s for (_, s, _, _) in firsts])
t = torch.tensor([[s0 * 1000.0] for (_, _, s0, _) in firsts], device=ctx.device)
tgt = torch.stack([g for (_, _, _, g) in firsts]).float()
_, pred = self.student(x, ctx.data.cond(di), t)
per = ((pred.float() - tgt) ** 2).mean(dim=(1, 2, 3, 4))
(per.sum() / n_items).backward()
stats["first"] = [per.mean().item()]
gn = self.student.clip_grad_norm_(CLIP)
self.opt.step()
self.n_steps += 1
self._ema_update()
used = ctx.meter.units - u0
self.unit_per_step = used if self.unit_per_step is None else max(0.9 * self.unit_per_step, used)
info = {k: sum(v) / len(v) for k, v in stats.items()}
info.update({"gn": float(gn), "u": used})
return infoResults
| Method | ① | ② | ③ | ④ |
|---|---|---|---|---|
| VBench Quality Score ↑ | VBench Quality Score ↑ | VBench Quality Score ↑ | VBench Quality Score ↑ | |
| Claude Opus 5.5 | 83.19 | 81.11 | 79.07 | 74.26 |
| No initialization | 69.66 | 67.05 | 65.92 | 64.59 |
| Bidirectional ODE | 75.11 | 71.70 | 71.03 | 67.27 |
| Causal ODE | 82.99 | 80.83 | 77.44 | 70.63 |
| Rectified-trajectory causal ODE | 80.89 | 76.32 | 73.41 | 67.57 |
| Causal consistency distillation | 83.13 | 81.61 | 79.48 | 73.28 |
| Teacher-forcing dCM | 82.80 | 81.80 | 80.48 | 76.85 |
| Teacher-forcing sCM | 82.73 | 80.89 | 78.80 | 72.57 |
| Causal DMD | 84.08 | 78.10 | 81.04 | 80.39 |
| AnyFlow | 80.99 | 77.56 | 74.49 | 70.08 |
- ① VBench Quality Score, 4 steps per frame (480x832, 33 frames)
- ② VBench Quality Score, 4 steps per frame (480x832, 81 frames)
- ③ VBench Quality Score, 2 steps per frame (480x832, 81 frames)
- ④ VBench Quality Score, 1 step per frame (480x832, 81 frames)
Our score is 83.19 on VBench Quality Score, 4 steps per frame (480x832, 33 frames), compared with 69.66 for no initialization and 84.08 for the strongest baseline, Causal DMD [2]. On VBench Quality Score, 4 steps per frame (480x832, 81 frames), we obtain 81.11, versus 67.05 and a best-baseline value of 81.80 from Teacher-forcing dCM [5]. On VBench Quality Score, 2 steps per frame (480x832, 81 frames), our score is 79.07, versus 65.92 and 81.04 from Causal DMD [2]. On VBench Quality Score, 1 step per frame (480x832, 81 frames), it is 74.26, versus 64.59 and 80.39 from Causal DMD [2].
Thus OCF improves over the unchanged Stage-1 model on every setting, but it does not exceed the strongest published baseline on any setting. The result supports the value of matching the student's visited states and contexts, while also showing that initialization alone is not a universal replacement for the strongest distillation recipes.
How we got here
The trace records the first prototype as on-policy causal flow-map distillation. The final code and its docstring preserve the design decisions that survived development: use the student's own context, keep a separate first-frame stream, solve the first frame with a denser teacher grid than continuation frames, reuse labels from FIFO buffers, and export an EMA.
Several alternatives were tried and then dropped. The trace records a candidate configuration that collapsed across the available samplers and describes this as a solver-choice failure; the final recipe keeps separate first-frame and continuation grids. The submission docstring also records ablations in which replacing the student's context with teacher-forcing context, removing the first-frame branch, or changing the continuation grid reduced development quality, so the final constants retain the on-policy context, the first-frame branch, and N_CONT = 12. The trace further says that the documentation was rewritten after a cheap-grid design was refuted. These are development observations from the run's artefacts, not new evaluation measurements.
The method therefore emerged as a practical DAgger-style loop: visit the states that the deployed student actually uses, label those states with a frozen teacher from the same causal context, and train both the continuation and first-frame regimes. The operator is a flow-map regression target, while the on-policy state and cache construction are the choices that make it fit autoregressive deployment.
Limitations
OCF remains behind the strongest baseline on every setting, as the per-setting comparisons above show. Its improvement over no initialization does not establish that the student is the best available few-step generator.
The method spends a substantial part of its compute on fresh student rollouts and teacher solves. That cost grows with the number of frames and with the teacher integration grids, so the fixed allocation is a heuristic rather than an adaptive guarantee. The split FRAC_FIRST = 0.25, the grids N_FIRST = 24 and N_CONT = 12, and the classifier-free guidance constant CFG = 6.0 are fixed recipe choices; they may not transfer to a different teacher or cache layout.
On-policy supervision exposes the student to its own errors, which is the point of the method but also makes target collection dependent on early student behavior. The first-frame branch and the continuation branch use separate buffers, so imbalance between the two data regimes can still limit learning. Finally, the recipe only initializes the student: it does not include a later distribution-matching refinement stage.
References
- Hongzhou Zhu, Min Zhao, Guande He et al. (2026). Causal Forcing: Autoregressive Diffusion Distillation Done Right for High-Quality Real-Time Interactive Video Generation. ICML.
- Min Zhao, Hongzhou Zhu, Kaiwen Zheng et al. (2026). Causal Forcing++: Scalable Few-Step Autoregressive Diffusion Distillation for Real-Time Interactive Video Generation.
- Xun Huang, Zhengqi Li, Guande He et al. (2025). Self Forcing: Bridging the Train-Test Gap in Autoregressive Video Diffusion. NeurIPS.
- Yuchao Gu, Guian Fang, Yuxin Jiang et al. (2026). AnyFlow: Any-Step Video Diffusion Model with On-Policy Flow Map Distillation.
- Kaiwen Zheng, Guande He, Min Zhao et al. (2026). Causal-rCM: A Unified Teacher-Forcing and Self-Forcing Open Recipe for Autoregressive Diffusion Distillation in Streaming Video Generation and Interactive World Models.
- Jiaqi Feng, Justin Cui, Yuanhao Ban et al. (2026). One-Forcing: Towards Stable One-Step Autoregressive Video Generation.