On-Policy Codec Distillation for Efficient All-in-One Video Generation

媒体报道 Hugging Face Papers 原文语言:中文

作者提出 CodecOPSD,通过视频编码器剔除冗余条件 token 并使用自蒸馏学习剪枝模式,在 16 种条件下平均削减 66% token,推理速度提升约 2 倍,内存占用降至 27%,并可迁移…

全文

On-Policy Codec Distillation

for Efficient All-in-One Video Generation

Boyang Wang Kevin Blackburn-Matzen Oindrila Saha Matheus Gadelha Zezhou Cheng Affiliation: Adobe Research University of Virginia Project Page kiteretsu77.github.io/CodecOPSD_website

Abstract

Modern visual generative models operate on tokens, and every visual asset they receive, whether an identity, a scribble, a depth map, or a motion video, is tokenized and appended to the input token sequence. Consequently, conditioning quickly dominates the computation cost. Yet most of these tokens carry redundant spatiotemporal information. Our key insight is that identifying what is genuinely new is exactly the problem that classical video codecs have long solved. Thus, we first introduce a codec-based token pruning method that discards redundant tokens. Then, we propose an on-policy self-distillation (OPSD) strategy to train a DiT adapter capable of learning the codec pruning pattern well without quality degradation. Together, they form On-Policy Codec Distillation (CodecOPSD). We scale CodecOPSD to 16 condition modalities on our own video diffusion model, where it prunes 66% of the condition tokens on average with almost no quality drop. Therefore, denoising becomes 2×\times faster, and the cache memory shrinks by up to 73% in KV cache mode. CodecOPSD also extends to other state-of-the-art pretrained image and video generative models, where its benefit grows further with more conditions, longer frames, and higher resolution.

Figure 1: CodecOPSD keeps the informative condition tokens and shows a clear speedup. Our codec pruning drops 89% of the condition tokens with consistent quality, while being 3.1×\times faster. Our method simply adds an adapter to the video DiT through our proposed on-policy codec distillation. The same pruning works on 16 condition types and is extendable to MiniMax-H3 Ref2VA [44], MiniMax-H3-Image [45], and Cosmos3 [1], with up to 8.4×\times faster denoising on higher resolution, longer frames, and more conditions.

11footnotetext: Work partially done during an internship at Adobe Research.

†Equal advising.

1 Introduction

Creativity rarely arrives in text alone. To turn an afternoon at home into a video, a creator brings a photo of the living room sofa, a sketch of the room around it, the poses of two people, a picture of the family corgi, and its path scribbled across the floor (Fig. 1 left). State-of-the-art video generative models can receive all these conditions as input. However, modern generative models concatenate all condition tokens into one sequence [5, 29, 30] as inputs, so the attention cost grows quadratically with every added condition. Fine-grained controllability then leads to severe computational cost.

Most existing acceleration methods speed up the denoiser through fewer sampling steps [76], FlashAttention [56], quantization [43], feature caching [40], or sparse attention [73]. We instead reduce the condition tokens at their source, which is orthogonal to and pluggable into these methods. Condition signals are highly compressible, since a static background repeats in every frame and a motion path covers a few pixels. In our daily life, every video we watch or store is compressed by a video codec such as H.264 [70], which removes exactly this redundancy. These codecs are the product of decades of traditional video compression research: rule-based systems that run efficiently on nearly every phone, camera, and browser. For every pixel of every frame, a codec records how it can be predicted from earlier frames, as a motion vector, and what remains new, as a residual. These signals thus provide a natural rule for selecting condition tokens of every modality, from natural RGB images and videos to sketches, depth, and motion tracks. They can be computed in real time on a CPU during training and inference.

Turning this idea into a working model takes two steps: selecting the right tokens and adapting the model to learn from them. First, raw codec signals cannot be used directly and need careful engineering. We resolve these issues, propose an algorithm to map the signals from pixels to VAE tokens, and adapt the selection to each modality. Second, pruning alone is not enough, as the model must learn the codec pattern for faithful generation. We observe that supervised fine-tuning (SFT) leaves a clear gap to the dense model on codec-pruned conditions. We instead propose adapting the model to the pruned conditions through on-policy self-distillation (OPSD) [82], which supervises the model on the states of its own rollouts rather than on noised ground truth [2]. Teacher and student are the same base model, but the teacher additionally sees the tokens dropped by codec pruning as inferable privileged information. The teacher turns these tokens into dense guidance at every state of the student’s own rollout. We name this method On-Policy Codec Distillation (CodecOPSD).

To demonstrate the effectiveness of CodecOPSD, we adapt it to 16 condition modalities in our video diffusion model, namely segmentation, bounding box, identity, sketch, edge, depth, surface normal, human pose, sparse and dense tracking, blurring, grayscale, first-last frame interpolation, continuation, inpainting, and outpainting. With quality close to the dense teacher, it drops 66% of the condition tokens on average, which speeds up denoising by up to 2.30×\times and shrinks up to 73% of the memory cost in KV cache mode. We further apply it to three state-of-the-art models, namely MiniMax-H3 Reference-to-Audio-Video (Ref2VA) [44] for video generation, MiniMax-H3-Image [45] for image generation, and Cosmos3 [1] for physical AI tasks. At similar quality, the denoising speedup keeps growing with the input scale, reaching 3.72×\times on MiniMax-H3 Ref2VA with more references, 3.06×\times on MiniMax-H3-Image at 204822048^{2}, and 2.30×\times on Cosmos3, with consistent gains across tasks as diverse as control-to-video, video continuation, video-to-audio, and video-to-action generation.

Our contributions are summarized as follows:

•

We propose codec pruning in controllable generation, which maps the motion vectors and residuals of a standard H.264 codec from pixels to VAE token masks.

•

We introduce CodecOPSD, where the teacher additionally sees the codec-pruned tokens as privileged information, leaving the student an information gap that is inferable and of the right size.

•

We scale CodecOPSD to 16 condition modalities on our video diffusion model, and further extend it to the state-of-the-art all-in-one models MiniMax-H3 Ref2VA, MiniMax-H3-Image, and Cosmos3.

•

We show that CodecOPSD outperforms other token pruning baselines and has consistent gains in denoising speed with consistent quality.

2 Related Work

Controllable Video Generation.

Early controllable image and video generators add one condition type at a time, such as ControlNet [78], SparseCtrl [17], and AVControl [5]. Later, more works extend them to multiple conditions for richer creative expression [3, 65, 51, 85]. On the other hand, all-in-one models train one network on many condition types. VACE [27] injects a unified condition module through a context adapter, FullDiT [29] and EditVerse [30] place all inputs in one token sequence under self-attention, and UniVideo [69] and OmniWeaving [48] pair a multimodal language model with the diffusion transformer. The recent MiniMax-H3 Ref2VA [44] accepts several image and video conditions at the same time. These models mostly append conditions along the sequence rather than the channel dimension, so as users bring ever more references, quadratic attention dominates the cost. This is exactly the problem we are addressing in this work.

Token-Pruning-based Compression in Vision.

In diffusion models, ToMe-SD [7] merges tokens inside the network, and FullDiT2 [19] keeps the condition tokens ranked highest by a learned scoring network. Keep The Essentials [49] instead drops reference tokens before the network, at random or by DeepGaze [35] saliency. Another common practice is to downscale the condition, as in OminiControl2 [62], EasyControl [81], and AVControl [5]. In vision-language models, codec-based encoders such as OneVision-Encoder [63], Video-LaVIT [28], CoPE-VideoLM [55], CodecSight [52], and AdaCodec [22] read the motion vectors and residuals of the compressed stream to skip or compactly encode redundant patches. These VLM works target understanding, where dropping redundant patches rarely changes the answer, so they can prune aggressively. Controllable generation is inherently different, since the content of a pruned token still appears in the output, which calls for a more conservative selection. To the best of our knowledge, we are the first to use codec signals for token pruning in diffusion models, where we map them to 3D VAE tokens and adapt the selection to each condition modality.

On-Policy Distillation.

In large language models, on-policy distillation [2] trains a student on its self-generated sequences with token-level teacher feedback. On-policy self-distillation [82] lets one model act as both teacher and student, where the teacher additionally sees privileged information. In diffusion models, D-OPSD [26] fine-tunes a step-distilled image model without losing its few-step ability, where the teacher additionally sees the target image. OPSD-V [41] post-trains few-step autoregressive video models on their own rollouts, where the teacher instead sees real-video context. DanceOPD [84] distills several teachers into one student, and supervises a single state of each student rollout. PDM [36] and LIFT [25] distill dense per-frame control into sparse control. In our work, the privileged information is the condition tokens dropped by codec pruning, where the model learns to preserve quality from a fraction of the original condition tokens.

3 Method

Figure 2: From codec signals to kept tokens. (a) An I-frame predicts each block from its coded neighbours. (b) A P-frame finds the best match of each block in a previous frame and stores its motion vector. (c) The residual is the difference between the block and its best match. (d) Each token receives a motion score and a residual score from the blocks it covers, and threshold-based or priority-based pruning then selects the kept tokens.
Figure 2: From codec signals to kept tokens. (a) An I-frame predicts each block from its coded neighbours. (b) A P-frame finds the best match of each block in a previous frame and stores its motion vector. (c) The residual is the difference between the block and its best match. (d) Each token receives a motion score and a residual score from the blocks it covers, and threshold-based or priority-based pruning then selects the kept tokens.

Figure 2: From codec signals to kept tokens. (a) An I-frame predicts each block from its coded neighbours. (b) A P-frame finds the best match of each block in a previous frame and stores its motion vector. (c) The residual is the difference between the block and its best match. (d) Each token receives a motion score and a residual score from the blocks it covers, and threshold-based or priority-based pruning then selects the kept tokens.

Figure 3: Pipeline of CodecOPSD. Left: Codec pruning runs in parallel with the VAE encoder and drops condition tokens at a dynamic rate per condition, and the kept tokens concatenate with the noisy latent as the DiT input. It optionally drops the vision tokens of a VLM, which enter the DiT by cross-attention or joint attention depending on the model. Right: On-Policy Codec Distillation provides the tokens removed by codec pruning to the frozen teacher as privileged information and compares the s
Figure 3: Pipeline of CodecOPSD. Left: Codec pruning runs in parallel with the VAE encoder and drops condition tokens at a dynamic rate per condition, and the kept tokens concatenate with the noisy latent as the DiT input. It optionally drops the vision tokens of a VLM, which enter the DiT by cross-attention or joint attention depending on the model. Right: On-Policy Codec Distillation provides the tokens removed by codec pruning to the frozen teacher as privileged information and compares the s

Figure 3: Pipeline of CodecOPSD. Left: Codec pruning runs in parallel with the VAE encoder and drops condition tokens at a dynamic rate per condition, and the kept tokens concatenate with the noisy latent as the DiT input. It optionally drops the vision tokens of a VLM, which enter the DiT by cross-attention or joint attention depending on the model. Right: On-Policy Codec Distillation provides the tokens removed by codec pruning to the frozen teacher as privileged information and compares the student’s prediction with the teacher’s.

We first review the video codec preliminaries in Sec. 3.1 (Fig. 2). In Sec. 3.2, we show how we turn the codec signals from the pixel to the token level, and in Sec. 3.3, we illustrate the methodology of feeding the kept tokens to the DiT model. In Sec. 3.4, we design the model training for CodecOPSD. The pipeline is shown in Fig. 3.

3.1 Video Codec Preliminaries

As shown in Fig. 2, a video codec such as H.264 [70] predicts each block of pixels from a reference block in the same frame or in past frames. While a codec also involves transform, quantization, and entropy coding, these stages are not relevant to our method, and we focus on how the reference and the residual of each block are obtained.

The codec divides the frames of a video into two types: intra-coded frames (I-frames) and predictive frames (P-frames). An I-frame has no temporal reference and predicts each block from its neighbours within the same frame (Fig. 2a). A P-frame predicts each block from previously coded frames, where the compression encoder finds the best match with classical block-matching search algorithms (Fig. 2b). This match is rarely exact, so the codec stores the residual, which is the difference between the ground-truth block and its best match (Fig. 2c). In summary, a P-frame tt provides a motion vector mt​(p)m_{t}(p) and a residual rt​(p)r_{t}(p) for the block of each pixel pp, while an I-frame provides a residual and no motion vector.

3.2 Token Pruning from Codec Signals

In video diffusion models, the 3D VAE compresses the input both spatially and temporally, where a token cic_{i} of the DiT can cover a set of 32×3232\times 32 pixels 𝒫i\mathcal{P}_{i} over a set of 8 frames ℱi\mathcal{F}_{i} in pixel space. In contrast, the motion vectors mtm_{t} and residuals rtr_{t} obtained from the codec are at a much finer level, from 16×1616\times 16 down to 4×44\times 4 pixel blocks.

As shown in Fig. 2d, we first extract the motion vectors mt​(p)m_{t}(p) and the residuals rt​(p)r_{t}(p) from the codec signal, and then map them onto the spatiotemporal region of each token cic_{i}. To adapt to different resolutions, we also rescale these signals by the condition size. To convert dense information into a scalar per token, we compute a motion score MiM_{i} and a residual score RiR_{i} by:

Mi\displaystyle M_{i} =maxt∈ℱi⁡maxp∈𝒫i​‖mt​(p)‖,\displaystyle=\max_{t\in\mathcal{F}_{i}}\max_{p\in\mathcal{P}_{i}}\|m_{t}(p)\|, (1)

Ri\displaystyle R_{i} =maxt∈ℱi⁡meanp∈𝒫i|rt​(p)|.\displaystyle=\max_{t\in\mathcal{F}_{i}}\operatorname*{mean}_{p\in\mathcal{P}_{i}}\big|r_{t}(p)\big|.

Based on these two scalar scores on each token, we propose two pruning mechanisms in this paper: a threshold-based and a priority-based one to adapt to different demands.

First, we propose a threshold-based pruning mechanism because we observe that videos with high camera motion are harder to compress than videos that are almost static. Therefore, it is suitable to find a balance point for each video through a threshold-based design, which we formulate as:

bi={1,if ​Mi≥τm​ or ​Ri>τr,0,otherwise,b_{i}=\begin{cases}1,&\text{if }M_{i}\geq\tau_{m}\text{ or }R_{i}>\tau_{r},\\ 0,&\text{otherwise},\end{cases} (2)

where τm\tau_{m} and τr\tau_{r} are the motion and residual thresholds, and bi=1b_{i}=1 means that we will keep the current token cic_{i}.

Second, we also propose a priority-based pruning mode for flexible budget demands. We construct a sortable energy EiE_{i} formula by combining RiR_{i} and MiM_{i} by:

Ei=R¯i​(1+λ​M¯i),{E_{i}=\bar{R}_{i}\,\big(1+\lambda\bar{M}_{i}\big)}, (3)

where R¯i\bar{R}_{i} and M¯i\bar{M}_{i} are normalized RiR_{i} and MiM_{i} in the range [0,1][0,1], and λ\lambda is a scalar weight for the motion. In this design, we sort the tokens by EiE_{i} value and drop the lowest first.

3.3 Conditioning with Token Selection

Our conditions span diverse modalities, and to adapt them in one system, each condition jj is rendered as an image or a video I(j)I^{(j)} and then encoded by the same frozen VAE encoder ℰ\mathcal{E} into condition tokens 𝒞(j)=ℰ⁡(I(j))\mathcal{C}^{(j)}=\mathcal{E}\big(I^{(j)}\big), as shown in Fig. 3 left. In parallel, codec pruning computes the kept mask b(j)b^{(j)} following Sec. 3.2. The DiT follows standard flow matching [39] and denoises the noisy latent xσ=(1−σ)​z+σ​ϵx_{\sigma}=(1-\sigma)z+\sigma\epsilon of the generated video, where zz is the clean latent, ϵ\epsilon is Gaussian noise, and σ\sigma is the noise level. The mask is applied to each condition, and the kept tokens of the JJ conditions are concatenated with xσx_{\sigma} as the input sequence 𝒮\mathcal{S}. The formula is:

𝒞~(j)\displaystyle\tilde{\mathcal{C}}^{(j)} =b(j)⊙𝒞(j),j=1,…,J,\displaystyle}{\displaystyle=b^{(j)}\odot\mathcal{C}^{(j)},\quad j=1,\dots,J, (4)

𝒮\displaystyle\mathcal{S} =[xσ;𝒞~(1);…;𝒞~(J)],\displaystyle}{\displaystyle=\big[\,x_{\sigma};\ \tilde{\mathcal{C}}^{(1)};\dots;\ \tilde{\mathcal{C}}^{(J)}\,\big],

where ⊙\odot applies the mask element-wise and xσx_{\sigma} is not pruned. Each kept token retains its original 3D RoPE [58] position, and the resulting sequence 𝒮\mathcal{S} is fed into the DiT without architectural modification.

Meanwhile, state-of-the-art models such as MiniMax-H3 Ref2VA and MiniMax-H3-Image [44, 45] also feed the condition references to a VLM encoder (optional path in Fig. 3). Codec pruning reuses the same codec signals to prune these vision tokens too. The vision encoder (ViT) of the VLM still reads every reference in full, and codec pruning drops its output vision tokens before they enter the language model of the VLM.

Table 1: Token Pruning Comparisons. Under the same average drop rate, we compare different token pruning methods in either training-free or fine-tuned settings. Our CodecOPSD shows better numerical performance on most metrics and stays close to the teacher. Prep. is the token selection time in seconds per case, and ours runs on 6 CPU cores of an Intel Xeon Platinum 8275CL. The best results in each group are highlighted, and the second best are underlined.

Quality and Fidelity Condition Following

Method Prep. (s) ↓\downarrow FID ↓\downarrow FVD ↓\downarrow LPIPS ↓\downarrow Identity DINOv3 ↑\uparrow Segm. mIoU ↑\uparrow Depth si-RMSE ↓\downarrow Normal Angle ↓\downarrow Edges F1 ↑\uparrow In/Outpaint mPSNR ↑\uparrow Pose PCK@0.1 ↑\uparrow Track TrajErr ↓\downarrow Grayscale Δ​E00\Delta E_{00} ↓\downarrow

Teacher 0 22.4 118.0 0.273 0.288 0.888 0.647 4.72 0.445 20.93 0.912 13.54 6.63

Random ∼\sim0 29.2 161.2 0.351 0.278 0.782 0.959 7.44 0.286 17.88 0.870 15.73 8.65

Reduced Res. ∼\sim0 56.3 381.1 0.663 0.269 0.288 3.740 30.05 0.066 10.73 0.286 38.42 27.35

DINO [57] 23.8 28.8 151.1 0.368 0.284 0.838 1.053 8.13 0.321 18.21 0.891 11.69 9.59

Saliency [49] 75.0 30.0 148.5 0.401 0.286 0.796 1.470 11.88 0.294 15.69 0.895 13.91 13.01

Training-free Codec (ours) 1.13 24.5 132.3 0.307 0.284 0.734 0.868 6.05 0.393 19.89 0.836 13.90 6.93

SFT, Random ∼\sim0 25.6 142.7 0.305 0.289 0.864 0.875 6.22 0.338 19.11 0.901 7.50 6.78

SFT, Reduced Res. ∼\sim0 34.7 199.5 0.444 0.288 0.655 1.633 14.43 0.114 14.72 0.835 14.53 12.62

SFT, DINO [57] 23.8 26.7 138.0 0.337 0.287 0.885 0.941 7.45 0.343 18.62 0.910 6.86 8.16

SFT, Saliency [49] 75.0 29.6 146.4 0.398 0.281 0.805 1.427 11.87 0.297 15.78 0.898 13.32 12.70

SFT, Codec (ours) 1.13 23.8 130.9 0.297 0.284 0.796 0.767 5.80 0.404 19.83 0.890 11.03 7.24

Fine-tuned CodecOPSD (ours) 1.13 23.0 113.8 0.278 0.289 0.883 0.706 5.44 0.417 20.43 0.911 7.80 6.53

3.4 On-Policy Codec Distillation

Our training design is based on on-policy self-distillation (OPSD), and the full pipeline is shown in Fig. 3 right. OPSD uses a single base model as both teacher and student, where the teacher supervises the student on the states of the student’s own rollout.

The student shares the same base model vθv_{\theta} as the teacher, but with an additional trainable LoRA [23] ϕ\phi. As shown in Fig. 3, the LoRA is applied to the projections of the condition tokens, but not to those of the noisy latent or the VLM tokens. The student takes the kept tokens 𝒞~\tilde{\mathcal{C}}, where the mask follows the threshold-based pruning of Eq. 2 during training. The teacher is frozen and receives the same condition types as the student, with no extra condition type. It additionally takes the dropped tokens 𝒞⋆=𝒞∖𝒞~\mathcal{C}^{\star}=\mathcal{C}\setminus\tilde{\mathcal{C}} of these conditions, which serve as its privileged information. Accordingly, their velocity predictions are formulated as:

vT​(x,σ)\displaystyle v_{\mathrm{T}}(x,\sigma) =vθ​(x,σ,𝒞~∪𝒞⋆),\displaystyle=v_{\theta}(x,\sigma;\tilde{\mathcal{C}}\cup\mathcal{C}^{\star}), (5)

vS​(x,σ)\displaystyle v_{\mathrm{S}}(x,\sigma) =vθ,ϕ​(x,σ,𝒞~).\displaystyle=v_{\theta,\phi}(x,\sigma;\tilde{\mathcal{C}}).

The student learns to match the teacher without this privileged information, which is feasible since the kept tokens are the most representative ones of each condition and can largely represent the dropped regions.

In each training step, the student first rolls out its own trajectory without gradient. Starting from pure noise x1=ϵx_{1}=\epsilon, it denoises step by step along the KK decreasing noise levels of the inference sampler:

xk+1=xk+(σk+1−σk)​vS​(xk,σk),x_{k+1}=x_{k}+(\sigma_{k+1}-\sigma_{k})\,v_{\mathrm{S}}(x_{k},\sigma_{k}), (6)

where σk\sigma_{k} is the kk-th noise level, with σ1=1\sigma_{1}=1 for pure noise, and xkx_{k} denotes the kk-th state of the rollout. We supervise a subset 𝒩\mathcal{N} of these states, namely the first NN states at high noise. At each supervised state, the teacher and the student receive the same xkx_{k} and σk\sigma_{k}, and we minimize the distance between their predictions:

ℓk\displaystyle\ell_{k} =‖vS​(xk,σk)−vT​(xk,σk)‖22,\displaystyle={\big\|v_{\mathrm{S}}(x_{k},\sigma_{k})-v_{\mathrm{T}}(x_{k},\sigma_{k})\big\|_{2}^{2}}, (7)

ℒOPSD​(ϕ)\displaystyle\mathcal{L}_{\mathrm{OPSD}}(\phi) =𝔼𝒞,ϵ​[1|𝒩|​∑k∈𝒩ℓk],\displaystyle={\mathbb{E}_{\mathcal{C},\epsilon}\Big[}\frac{1}{|\mathcal{N}|}\sum_{k\in\mathcal{N}}\ell_{k}{\Big]},

where the expectation is over the training conditions and the noise. Note that no ground truth enters Eq. 7, since the supervision comes from the teacher. At inference, the student runs with 𝒞~\tilde{\mathcal{C}}, and the teacher is no longer needed.

4 Experiments

Secs. 4.1 and 4.2 provide the implementation and evaluation details. Sec. 4.3 analyzes token dropping and speedup on our multi-condition video model, and Sec. 4.4 provides an ablation. Sec. 4.5 extends CodecOPSD to MiniMax-H3 Ref2VA [44], the H3-Image variant [45], and Cosmos3 [1] for multi-task generation.

4.1 Implementation details

We build our own multi-condition video model as the main testbed of this work. It is relatively lightweight and not distilled, and its training data comes with ground truth, so it can be directly trained with SFT. This enables the extensive SFT comparisons in Tab. 1 and shows the versatility of our method across diverse visual controls, each with its own metric. Our model starts from a pretrained 22B-parameter text-image-to-video DiT, and its condition tokens never attend to the noise tokens, so it supports KV cache [62]. For the first stage, it is initially trained with text and a mix of 16 condition modalities, namely segmentation, bounding box, identity, sketch, edge, depth, surface normal, human pose, sparse and dense tracking, blurring, grayscale, frame interpolation, continuation, inpainting, and outpainting. Each training sample uses 1 to 5 of them. All token pruning methods in Tab. 1 are also based on these weights. In the second stage, it is trained with CodecOPSD for 2K steps on 16 H200 GPUs. Inference sampling uses 30 denoising steps, and CodecOPSD rolls out the first 8 of these 30 steps in training. Further implementation details are in the supplementary material.

4.2 Evaluation details

Figure 4: Denoising time and memory change. Test cases run at 512×\times896 with 121 frames, 8 sampling steps [76], and one H200. Ours is faster both without the KV cache (left) and with the KV cache (right top). The KV cache requires extra memory cost, and ours needs much less of it (right bottom).

Figure 5: Per-condition drop rates. We drop the tokens of a single condition at different rates in the order of Eq. 3 and measure quality relative to the teacher in each target metric, for (a) dense conditions and (b) sparse conditions. The grey band is the teacher’s seed noise (±2​σ\pm 2\sigma). The green region marks the free drop, where quality stays within this band, and the orange region marks the lossy drop. (c) provides the free drop value of each condition.

Figure 6: Scaling tokens on MiniMax-H3 Ref2VA and MiniMax-H3-Image. Top: MiniMax-H3 Ref2VA with more reference videos, higher resolution, and more frames; the speedup keeps growing without a clear quality drop relative to the dense teacher. For both speedup and quality, MiniMax-H3 Ref2VA runs the 8-step FastH3-Omni of FastVideo [79]. Bottom: MiniMax-H3-Image with more reference images and higher resolution, which has the same trend. At 204822048^{2} pixels, with every module (DiT, VLM, and VAE) loaded on the GPU and no offloading, ours still fits 16 images, while the dense model runs out of memory from 12 images on. Quality averages the five scores of Tab. 4 and the three judge scores of Tab. 5, relative to the dense model.

Evaluation dataset.

The test clips of our model experiments are randomly selected from a 2,000-video pool of VidGen-1M [61], where each comes with its ground truth and we prepare the condition modalities needed. Inference mainly runs at 512×\times768 with 81 frames. Each experiment constructs its own cases and conditions from this set, namely 400 clips with 1 to 4 conditions in Tab. 1 and Tab. 3, 200 clips with 1 to 5 conditions in Fig. 4, 100 clips with 1 to 4 conditions in Tab. 2, and 50 clips per condition in Fig. 5. Extension experiments are instead tested on benchmarks in their domain [37, 42, 71, 83, 46, 11, 33].

Baselines.

We compare popular token pruning-based methods. The Random baseline drops tokens uniformly at random, the same share in every condition. The Reduced Resolution baseline is the common way to reduce condition tokens widely used in controllable image and video generation [5, 62, 81], where every condition is encoded at one lower resolution. The DINO attention baseline keeps the tokens that the CLS token of DINOv3 [57] attends to most, which chooses the semantically most important tokens. The Saliency [49] baseline applies DeepGaze [35] to keep the tokens with the highest predicted human-fixation density, which represents where a viewer would look.

Metrics.

Table 2: Perceptual Comparisons. Subscripts provide the change against the dense-conditioned teacher, and CodecOPSD is consistent with the teacher on VBench [24]. In the human study, about 90% of the answers rate CodecOPSD as equal or better in both condition following and quality.

VBench ↑\uparrow Human study (%)

# cond. Imaging quality Aesth. quality Motion smooth. Temp. flicker. Backgr. consist. Overall consist. Equally follows? Equally good?

1 73.4−0.2 54.1+0.4 99.0±0.0 97.1+0.1 94.4+0.2 25.9+0.1 84 95

2 68.8+0.1 54.9+1.0 98.6±0.0 96.6+0.1 93.9+0.1 25.3−0.1 92 84

3 65.8+0.3 54.2−0.2 98.8±0.0 96.9±0.0 93.6±0.0 25.3±0.0 93 88

4 66.7−0.3 53.9+0.6 98.5±0.0 96.3±0.0 94.1−0.3 25.2−0.3 94 91

All 67.7 ±0.0 54.3 +0.4 98.7 ±0.0 96.7 ±0.0 93.9 ±0.0 25.4 −0.1 92 88

Perceptual quality and fidelity to the ground truth are measured with FID [20], FVD [64], and LPIPS [80]. Each condition also has its own metric, computed on the clips that carry it. DINOv3 [57] cosine similarity is for identity references, mIoU for segmentation, si-RMSE [12] for depth, mean angular error for surface normals, F1 for Canny edges, mPSNR for inpainting and outpainting, PCK@0.1 [75] for human pose, TrajErr for motion tracks, and the colour difference Δ​E00\mathit{\Delta E}_{00} for grayscale. We also select six dimensions of VBench [24] to measure videos without the ground truth. More details are in the supplementary material.

4.3 Token dropping and inference

Comparison of different token pruning methods.

Tab. 1 compares the token pruning methods at the same overall budget, which drops 66% of the condition tokens on average over all conditions. Without training, codec pruning is the best training-free method in 8 of the 12 metrics, including FID, FVD, and LPIPS. After the same number of training steps, CodecOPSD is the best fine-tuned model in 10 of the 12 metrics and stays close to the teacher. Codec pruning selects the tokens in 1.13 s per case on average on the CPU, in parallel with the VAE and text encoders, while DINO attention and saliency take 23.8 s and 75.0 s on the GPU. The supplementary material provides a longer SFT training comparison, parallelism of modules, and per-condition token statistics of codec pruning.

Speedup and perceptual evaluation.

Fig. 4 measures the denoising time with 1 to 5 conditions per video. Without the KV cache, the dense-conditioned teacher model slows down with every added condition, while ours grows much more slowly, where the speedup rises from 1.54×\times to 2.30×\times. This gain is smaller than with full bidirectional attention, since our condition tokens never attend to the noise tokens, which also lets our base model support the KV cache setting, where their keys and values are computed once at the first denoising step and reused by every later step. Ours is still 1.15×\times to 1.37×\times faster, and its KV cache is 62% to 73% smaller.

Tab. 2 compares ours with the teacher model on VBench [24] and a human study. VBench shows that ours keeps the perceptual quality of the teacher model, with no score changing by more than 1.0 point. In a blind A/B study, 20 raters took part and gave 384 answers. They judged ours as good as or better than the dense model in 92% of the answers for following the conditions and in 88% for visual quality.

Table 3: Teacher–student gap ablation. We control the gap by the drop rate, dropping 90% of student tokens for the larger gap and some teacher tokens for the smaller gap. Both are worse than ours on at least 8 of the 9 metrics. The best results are highlighted.

Quality and Fidelity Condition Following

FID FVD LPIPS DINOv3 si-RMSE Edges F1 mPSNR PCK TrajErr

↓\downarrow ↓\downarrow ↓\downarrow ↑\uparrow ↓\downarrow ↑\uparrow ↑\uparrow ↑\uparrow ↓\downarrow

Smaller gap 23.7 123.9 0.290 0.290 0.793 0.406 20.26 0.853 12.04

Ours 23.0 113.8 0.278 0.289 0.706 0.417 20.43 0.911 7.80

Larger gap 23.8 124.3 0.287 0.288 0.798 0.404 19.48 0.906 9.90

Table 4: MiniMax-H3 Ref2VA on OmniVBench [37]. Ours drops 71.6% of condition tokens in the DiT and 36.2% in the VLM. It denoises 1.87×\times faster, and no overall score drops more than 0.6 points. Subscripts are changes from the dense model.

Token Drop (%) Quality ↑\uparrow

Task DiT VLM Denoise Speedup Technical Aesthetic Physical Reference Fidelity Instruction Realization

Content 74.3 42.2 1.31×\times 20.1−0.1 51.1−0.3 64.7+0.8 91.7+0.4 95.6+0.2

Motion 75.1 28.8 2.06×\times 15.3−0.2 50.4−0.3 63.1−1.2 53.9+5.8 87.7−0.3

Style 44.3 19.1 1.13×\times 16.2+0.2 54.1−0.4 65.4+1.2 53.3+5.0 84.8−0.7

Structure 79.7 42.3 2.21×\times 16.0−0.2 46.0−1.2 64.1+0.7 86.3+5.1 92.5−1.4

Narrative 71.8 25.0 1.78×\times 17.1±0.0 46.0−0.6 61.3−1.1 83.0−2.7 82.8+3.6

Multi-cont. 77.9 47.2 2.02×\times 21.7−0.1 49.8−0.6 63.1−1.4 91.6−2.3 94.0−0.5

Cross 77.9 48.5 2.55×\times 19.2+0.2 50.1−0.5 62.1+0.8 77.2−0.4 93.1+0.3

Overall 71.6 36.2 1.87×\times 17.9 ±0.0 49.6 −0.6 63.4 ±0.0 76.7 +1.6 90.1 +0.2

Per-condition rate-distortion analysis.

We also evaluate how each input modality alone affects quality and performance, with a single condition as the only input of the generation. We then drop more and more tokens of this condition, starting with those of the lowest energy following Eq. 3. Fig. 5 compares each output with the teacher. The teacher’s seed noise is ±2​σ\pm 2\sigma with σ2=(1+1S)​v¯/N\sigma^{2}=(1+\frac{1}{S})\,\bar{v}/N, where v¯\bar{v} is the mean variance of a case over S=3S=3 teacher seeds and NN is the number of cases. In Fig. 5(c), dense conditions drop 26% to 71% of their tokens for free, while sparse conditions can drop 80% to 94%. This shows that different condition modalities have different levels of robustness to token pruning.

4.4 Teacher-student gap ablation

In CodecOPSD, the teacher sees all condition tokens, while the student sees the tokens kept by codec pruning. The dropped tokens form the gap between them. For a smaller gap, the teacher is also pruned with half of the student’s codec thresholds. For a larger gap, the student drops 90% of its condition tokens. As shown in Tab. 3, both variants are worse than ours on almost every metric, where FID rises from 23.0 to 23.7 and 23.8, and FVD from 113.8 to 123.9 and 124.3. Therefore, the gap from codec pruning provides the best balance between what the teacher can teach and what the student can infer.

4.5 Extend CodecOPSD to other models

We transfer codec pruning and CodecOPSD together to three other models, which are MiniMax-H3 Ref2VA [44], the image variant MiniMax-H3-Image [45], and Cosmos3 [1] for multi-task generation.

4.5.1 Reference-to-video with MiniMax-H3 Ref2VA

MiniMax-H3 Ref2VA [44] is a recent state-of-the-art video diffusion model with reference-to-video capabilities, i.e., the ability to be conditioned by images or videos besides text. It can take up to 9 images and 3 videos as conditions. Besides its diffusion transformer (DiT) [50], every condition image passes through the vision encoder (ViT) of its vision-language model (VLM) [4]. Condition videos are passed to this ViT as images at a 2 FPS rate. The vision tokens of the VLM can amount to 33% of the condition tokens in the DiT. Therefore, we prune both kinds of tokens with the same codec signals in a single pass.

We evaluate on 237 selected OmniVBench [37] cases, the reference-richest ones of each task, and present them by task family in Tab. 4. Ours drops 71.6% and 36.2% of the DiT and VLM tokens, respectively, while denoising 1.87×\times faster on average, with no overall score lower by more than 0.6 points. In Fig. 6 top, we show that our denoising speedup grows with the number of references, frames, and resolution. Adding CodecOPSD can accelerate denoising by up to 3.72×\times, while quality matches the teacher model and sometimes slightly exceeds it. The data curation, the training details, and the results of CodecOPSD on top of other acceleration techniques are in the supplementary material.

4.5.2 Reference-to-image with MiniMax-H3-Image

MiniMax-H3-Image [45] supports text-to-image generation and editing with up to 16 reference images. We evaluate on GEdit-Bench-EN [42] for image editing and OmniContext [71] for generation from multiple reference images, where codec pruning drops about half of the reference image tokens. Since MiniMax-H3-Image requires a short side of at least 1024 pixels, we upscale smaller reference images to this size. CodecOPSD matches the teacher in Tab. 5, so the results stay consistent on existing benchmarks.

In Fig. 6 bottom, the speedup grows with the number of reference images, from 1.36×\times with 1 image to 2.99×\times with 12, and with the resolution, from 2.25×\times at 102421024^{2} to 3.06×\times at 204822048^{2} pixels. At 204822048^{2} pixels, the dense model runs out of memory with 12 or more images even on a 141 GB H200, while ours does not. The data curation and training details are in the supplementary material.

Table 5: MiniMax-H3-Image on GEdit-Bench-EN [42] and OmniContext [71]. Scores are VLM-judge ratings from 0 to 10, higher is better, and Mean averages them relative to the teacher.

Model Ref. tokens Instr.↑\uparrow Consist.↑\uparrow Quality↑\uparrow Mean (%)

GEdit-Bench-EN

Teacher 1,401 8.992 8.936 7.287 100.0

+CodecOPSD 685 (−51%) 9.061 8.868 7.295 100.0

OmniContext

Teacher 2,940 9.490 8.000 7.540 100.0

+CodecOPSD 1,287 (−56%) 9.527 8.015 7.560 100.3

4.5.3 Multi-task generation with Cosmos3

Table 6: Comparison with the teacher on Cosmos3 [1]. Teacher values are the mean ±2​σ\pm 2\sigma over three seeds. CodecOPSD stays within this range or better on every task while denoising up to 2.30×\times faster. EE err. is the 3D end-effector position error.

Quality Efficiency

Task Metric Dense (teacher) +CodecOPSD Token Drop (%) Denoise Speedup

Segmentation mIoU↑\uparrow 0.715±\pm0.035 0.751 84.2 1.93×\times

Blur SSIM↑\uparrow 0.910±\pm0.004 0.911 45.0 1.36×\times

Depth si-RMSE↓\downarrow 0.821±\pm0.096 0.846 84.7 1.92×\times

Edge F1↑\uparrow 0.462±\pm0.004 0.459 35.0 1.24×\times

Continuation Physics-IQ↑\uparrow 50.6±\pm5.2 50.6 89.4 1.93×\times

Video-to-audio AV match↑\uparrow 0.864±\pm0.017 0.866 70.0 2.30×\times

Video-to-action EE err. (cm)↓\downarrow 2.16±\pm0.06 2.21 44.0 1.21×\times

Cosmos3 [1] is a Mixture-of-Transformers model for physical AI. Its diffusion transformer can be conditioned on control videos such as edge, blur, depth, and segmentation, on history frames for video continuation, and on an input video for audio and action generation. All condition tokens join the generated tokens in one sequence, so codec pruning applies without modification. We use Cosmos3-Nano, which has 16B parameters. Tab. 6 tests four of its conditioned tasks. On control-to-video with 20 selected PAI-Bench-C [83] cases per control, CodecOPSD stays within the teacher’s ±2​σ\pm 2\sigma seed noise or better, with 84% of the segmentation and depth tokens dropped for 1.9×\times faster denoising and lower drops of 45% and 35% for blur and edge. On continuation of the 66 center-view Physics-IQ videos [46], it drops 89% of the given-frame tokens, denoises 1.93×\times faster, and keeps the dense Physics-IQ score. On video-to-audio with 50 selected FoleyBench [11] clips, it drops 70% of the video tokens and denoises 2.30×\times faster at the same AV match, the probability that a multimodal judge [74] accepts the soundtrack. On video-to-action with 50 randomly selected DROID [33] episodes, the official setting reads only 17 input frames, but CodecOPSD still drops 44% of their tokens, denoises 1.21×\times faster, and its 3D end-effector position error against the robot log stays close to the teacher’s. Visualizations and details are in the supplementary material.

5 Conclusion

In CodecOPSD, codec pruning drops redundant condition tokens with a standard video codec, and on-policy self-distillation adapts the model to the kept tokens. CodecOPSD matches the dense teacher while dropping 66% of the condition tokens on average. It works across 16 condition types of different modalities and extends to MiniMax-H3 Ref2VA, MiniMax-H3-Image, and Cosmos3. A promising direction for future work is to bring codec pruning to a finer granularity, for example by reducing the channels of each kept token according to its codec residual.

6 Acknowledgments

The authors acknowledge the University of Virginia Research Computing and Data Analytics Center (Rivanna).

References

[1] Niket Agarwal, Arslan Ali, Jon Allen, Martin Antolini, Adeline Aubame, Alisson Azzolini, Junjie Bai, Maciej Bala, Yogesh Balaji, Josh Bapst, et al. Cosmos 3: Omnimodal world models for physical ai. arXiv preprint arXiv:2606.02800, 2026.

[2] Rishabh Agarwal, Nino Vieillard, Yongchao Zhou, Piotr Stańczyk, Sabela Ramos, Matthieu Geist, and Olivier Bachem. On-policy distillation of language models: Learning from self-generated mistakes. In International Conference on Learning Representations, 2023.

[3] Hassan Abu Alhaija, Jose Alvarez, Maciej Bala, Tiffany Cai, Tianshi Cao, Liz Cha, Joshua Chen, Mike Chen, Francesco Ferroni, Sanja Fidler, et al. Cosmos-transfer1: Conditional world generation with adaptive multimodal control. arXiv preprint arXiv:2503.14492, 2025.

[4] Shuai Bai, Yuxuan Cai, Ruizhe Chen, Keqin Chen, Xionghui Chen, Zesen Cheng, Lianghao Deng, Wei Ding, Chang Gao, Chunjiang Ge, et al. Qwen3-vl technical report. arXiv preprint arXiv:2511.21631, 2025.

[5] Matan Ben-Yosef, Tavi Halperin, Naomi Ken Korem, Mohammad Salama, Harel Cain, Asaf Joseph, Anthony Chen, Urska Jelercic, and Ofir Bibi. Avcontrol: Efficient framework for training audio-visual controls. arXiv preprint arXiv:2603.24793, 2026.

[6] Yanrui Bin, Wenbo Hu, Haoyuan Wang, Xinya Chen, and Bing Wang. Normalcrafter: Learning temporally consistent normals from video diffusion priors. In 2025 IEEE/CVF International Conference on Computer Vision (ICCV), pages 8330–8339. IEEE, 2025.

[7] Daniel Bolya and Judy Hoffman. Token merging for fast stable diffusion. In 2023 IEEE/CVF conference on computer vision and pattern recognition workshops (CVPRW), pages 4599–4603. IEEE, 2023.

[8] Nicolas Carion, Laura Gustafson, Yuan-Ting Hu, Shoubhik Debnath, Ronghang Hu, Didac Suris Coll-Vinent, Chaitanya Ryali, Kalyan Vasudev Alwala, Haitham Khedr, Andrew Huang, et al. Sam 3: Segment anythin

原文配图

Figure S2: Codec fixes. Each row shows an input, followed by its codec signal and the tokens after codec pruning, without the corresponding fix on the left and with it on the right. The four fixes (a) set uncoded intra blocks to 128128, (b) set uncoded inter blocks to 128128, (c) read the residual from the luma plane of the decoder instead of an RGB conversion, and (d) treat skipped macroblocks as static. Without these fixes, flat regions and backgrounds are mistaken for new content, and their t
Figure S2: Codec fixes. Each row shows an input, followed by its codec signal and the tokens after codec pruning, without the corresponding fix on the left and with it on the right. The four fixes (a) set uncoded intra blocks to 128128, (b) set uncoded inter blocks to 128128, (c) read the residual from the luma plane of the decoder instead of an RGB conversion, and (d) treat skipped macroblocks as static. Without these fixes, flat regions and backgrounds are mistaken for new content, and their t
Figure S3: Qualitative results of CodecOPSD on our multi-condition model. Each case shows the conditions with the tokens dropped by codec pruning darkened, followed by five frames of the teacher with all condition tokens and of CodecOPSD with the remaining tokens. A play icon marks a video condition shown by one frame, the results of (b) are cropped to 4:3, and all results are shown with condition overlay. CodecOPSD follows every condition as the teacher does while dropping 83–92% of the conditi
Figure S3: Qualitative results of CodecOPSD on our multi-condition model. Each case shows the conditions with the tokens dropped by codec pruning darkened, followed by five frames of the teacher with all condition tokens and of CodecOPSD with the remaining tokens. A play icon marks a video condition shown by one frame, the results of (b) are cropped to 4:3, and all results are shown with condition overlay. CodecOPSD follows every condition as the teacher does while dropping 83–92% of the conditi
Figure S4: A more privileged teacher degrades the student on cases with few conditions. Each panel shows the ground truth, each condition with its drop rate and with the tokens dropped by threshold-based pruning in grey, and the results of CodecOPSD and of its variant with a more privileged teacher, which also sees the other conditions of the clip. Both students are trained for 2K steps on the distilled version of our internal model and receive the same input and remaining condition tokens, so t
Figure S4: A more privileged teacher degrades the student on cases with few conditions. Each panel shows the ground truth, each condition with its drop rate and with the tokens dropped by threshold-based pruning in grey, and the results of CodecOPSD and of its variant with a more privileged teacher, which also sees the other conditions of the clip. Both students are trained for 2K steps on the distilled version of our internal model and receive the same input and remaining condition tokens, so t
Figure S5: Training-Free Codec and CodecOPSD on MiniMax-H3 Ref2VA. We show (a) a rough-storyboard video, (b) a video continuation, and (c) a human-pose control video, with condition overlay in (a) and (c). Both models receive the same remaining reference tokens, inputs, and seed.
Figure S5: Training-Free Codec and CodecOPSD on MiniMax-H3 Ref2VA. We show (a) a rough-storyboard video, (b) a video continuation, and (c) a human-pose control video, with condition overlay in (a) and (c). Both models receive the same remaining reference tokens, inputs, and seed.
[Uncaptioned image]
[Uncaptioned image]
Figure S7: Training-Free Codec and CodecOPSD on MiniMax-H3-Image [45]. Both models receive the same remaining tokens after codec pruning, as well as the same inputs and seed, and all images show the same crop. Within the red box, Training-Free Codec redraws the dropped thin lettering and generates garbled print on the blank label, while CodecOPSD matches the teacher.
Figure S7: Training-Free Codec and CodecOPSD on MiniMax-H3-Image [45]. Both models receive the same remaining tokens after codec pruning, as well as the same inputs and seed, and all images show the same crop. Within the red box, Training-Free Codec redraws the dropped thin lettering and generates garbled print on the blank label, while CodecOPSD matches the teacher.

正文以来源语言显示。

参考来源

← 返回每日AI报告