On-Policy Codec Distillation for Efficient All-in-One Video Generation
Organizations: Adobe Research · University of Virginia
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 2x 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.
Figures & tables
| Quality and Fidelity | Condition Following | |||||||||||||
| Method | Prep. (s) | FID | FVD | LPIPS | Identity DINOv3 | Segm. mIoU | Depth si-RMSE | Normal Angle | Edges F1 | In/Outpaint mPSNR | Pose [email protected] | Track TrajErr | Grayscale | |
| 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 | 0 | 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. | 0 | 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 | |
| VBench | 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 |
| Quality and Fidelity | Condition Following | ||||||||
| FID | FVD | LPIPS | DINOv3 | si-RMSE | Edges F1 | mPSNR | PCK | TrajErr | |
| 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 |
| Token Drop (%) | Quality | |||||||
| Task | DiT | VLM | Denoise Speedup | Technical | Aesthetic | Physical | Reference Fidelity | Instruction Realization |
| Content | 74.3 | 42.2 | 1.31 | 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 | 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 | 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 | 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 | 17.1 ±0.0 | 46.0 −0.6 | 61.3 −1.1 | 83.0 −2.7 | 82.8 +3.6 |
| Model | Ref. tokens | Instr. | Consist. | Quality | 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 |
| Quality | Efficiency | ||||
| Task | Metric | Dense (teacher) | +CodecOPSD | Token Drop (%) | Denoise Speedup |
| Segmentation | mIoU | 0.715 0.035 | 0.751 | 84.2 | 1.93 |
| Blur | SSIM | 0.910 0.004 | 0.911 | 45.0 | 1.36 |
| Depth | si-RMSE | 0.821 0.096 | 0.846 | 84.7 | 1.92 |
| Edge | F1 | 0.462 0.004 | 0.459 | 35.0 | 1.24 |
| Continuation | Physics-IQ | 50.6 5.2 | 50.6 | 89.4 | 1.93 |
| Component | Setting |
| Transformer | 48 blocks, width 4,096 (32 heads 128) |
| Text | 12B LLM encoder, 8-layer connector, cross-attention |
| VAE | 32 spatial, 8 temporal compression |
| Tokens | one per latent cell (1 1 1 patches), 128 channels |
| Positions | 3D RoPE [ 58 ] (time, height, width); after pruning, |
| a token keeps its position in the full grid |
| Shared by all conditions | ||||
| Encoder | x264, 8-bit YUV 4:4:4 input | |||
| Frame types | one I-frame, then P-frames | |||
| Key-frame interval | 250 frames, no scene cut | |||
| Reference frames | 1, the previous frame | |||
| Adaptive quantization | off | |||
| Deblocking | off when decoding | |||
| Model | Input per case | GPU work (s) | Codec pruning (s) | Extra time left (s) |
| Our internal model | 1–4 conditions, 81 frames, 512 768 | 1.536 | 1.134 | +0.402 |
| MiniMax-H3 Ref2VA [ 44 ] | 1–5 references, videos of up to 124 frames at about 768 1344 | 20.675 | 2.039 | +18.636 |
| MiniMax-H3-Image [ 45 ] | 1–3 reference images, short edge 1,024 pixels | 0.715 | 0.198 | +0.517 |
| Cosmos3-Nano [ 1 ] | 1–4 controls, 81 frames, 480 832 | 3.164 | 1.154 | +2.010 |
| Quality and Fidelity | Condition Following | |||||||||||||
| Method | Prep. (s) | FID | FVD | LPIPS | Identity DINOv3 | Segm. mIoU | Depth si-RMSE | Normal Angle | Edges F1 | In/Outpaint mPSNR | Pose [email protected] | Track TrajErr | Grayscale | |
| 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 | |
| SFT, Random | 0 | 25.4 | 133.0 | 0.303 | 0.285 | 0.870 | 0.847 | 6.38 | 0.342 | 19.43 | 0.915 | 9.51 | 6.89 | |
| SFT, Reduced Res. | 0 | 34.1 | 213.7 | 0.424 | 0.284 | 0.673 | 1.494 | 13.40 | 0.124 | 14.81 | 0.846 | 13.97 | 11.81 | |
| SFT, DINO [ 57 ] | 23.8 | 26.3 | 132.0 | 0.330 | 0.285 | 0.872 | 0.908 | 7.10 | 0.352 | 18.88 | 0.910 | 6.13 | 8.19 | |
| SFT, Saliency [ 49 ] | 75.0 | 27.5 | 138.8 | 0.360 | 0.291 | 0.836 | 1.267 | 10.22 | 0.315 | 16.65 | 0.913 | 9.68 | 10.25 | |
| Condition | Cases | Tokens | Dropped | Drop (%) |
| Motion track | 69 | 4,224 | 4,023 | 95 |
| Boxes | 66 | 4,224 | 3,906 | 92 |
| Identity | 69 | 1,484 | 1,280 | 86 |
| Segmentation | 64 | 4,224 | 3,593 | 85 |
| Human pose | 66 | 4,224 | 3,433 | 81 |
| Outpainting | 69 | 4,224 | 2,782 | 66 |
| Quality | Ratio to GT ( 1) | |||||
| FID | FVD | Aesthetic | Contrast | Saturation | Sharpness | |
| CodecOPSD | 43.1 | 307.7 | 0.530 | 1.02 | 1.03 | 1.78 |
| CodecOPSD with a more privileged teacher | 57.9 | 370.2 | 0.502 | 0.96 | 0.89 | 2.25 |
| 8 states (CodecOPSD) | 1 state | ||
| Training time (s / step) | 34.6 | 11.0 | |
| Quality and Fidelity | FID | 23.0 | 22.9 |
| FVD | 113.8 | 115.4 | |
| LPIPS | 0.278 | 0.282 | |
| Condition Following | DINOv3 | 0.289 | 0.289 |
| si-RMSE | 0.706 | 0.691 | |
| Task | Inputs output | Refs | % | Task | Inputs output | Refs | % |
| Edit, transfer, and scene (6) | Reference images and storyboards (cont.) | ||||||
| Edit† | clip + edit instruction edited clip | 1V | 19.2 | Composition, 4 refs | person + 2 products + scene video | 4I | 0.7 |
| Style† | clip same clip in a new style | 1V | 2.0 | Storyboard sheet | numbered sheet panels in order | 1I | 0.6 |
| Motion transfer† | clip new subject, same motion | 1V | 8.5 | Storyboard video | storyboard video live action | 1V | 1.2 |
| Camera transfer† | clip new place, same camera move | 1V | 5.1 | Coarse line art | line-art video live action | 1V | 1.1 |
| Scene† | subject + scene image subject there | 2I | 6.4 | Storyboard + 1 person | front image + storyboard video | 1I1V | 0.8 |
| Task | Inputs output | Refs | Samples | Task | Inputs output | Refs | Samples |
| Edits of one image (26) | Composition from 2 to 5 images (cont.) | ||||||
| Art style, line art, sketch, greybox, edges, turnaround | image drawing, render, edges, or views, and edges photo | 1 | 317 | Product, scene, and style | products or people, optional scene, + style image image in that style | 2–5 | 1,581 |
| Object add, remove, replace, restyle, circle edit | image one named or circled object changed | 1 | 281 | Product in a new scene | 1–2 products, optional person, + scene product photo | 2–3 | 1,400 |
| Brighten, relight, weather, colourize, deblur | image new light, weather, or colour, or sharp | 1 | 280 | Outfit | person + clothes from 1–2 images, optional accessory dressed person | 2–4 | 1,151 |
| Inpaint, outpaint, zoom in, new background | image filled, extended, zoomed in, or new background | 1 | 216 | Four or five subjects | 4–5 people, animals, or objects, optional scene one image | 4–5 | 1,064 |
| Expression, garment extraction | person new expression, or the garment alone | 1 | 112 | Style reference | image + style image same image in that style | 2 | 299 |
Video Diffusion Models
Video diffusion models generate or edit temporally coherent video by iteratively denoising latent sequences conditioned on text, images, motion, or other signals.
See all 832 papers