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

1Adobe Research 2University of Virginia †Equal advising

TL;DR: CodecOPSD uses codec pruning to drop redundant condition tokens in video generation.
It works on 16 condition modalities and drops 66% of the condition tokens on average with no clear quality drop.

Abstract

Modern visual generative models operate on tokens, and every visual asset they receive, whether a reference image, a sketch, 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 develop 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× faster, and the cache memory shrinks by 70% in KV cache mode. CodecOPSD also extends to multiple state-of-the-art pretrained image and video generative models, where its benefit grows further with more conditions, more frames, and higher resolution.

MiniMax-H3 Reference-to-Video

Reference Videos with Priority-Based Pruning

Silver wolf in a dusk desert8.4× faster denoisingReference-to-video · 2 pictures + 3 videos → 1 video (Pika H3 Flex, distilled 6 steps) · 768×1344, 243 frames · 1× B200
Picture 1: character
Picture 1: character −80%2048×3584
Picture 2: scene
Picture 2: scene −87%2048×3584
Video 1: effect (chrome splash) (priority-based) −90%768×1344, 243 frames
Video 2: motion (gallop and leap) (priority-based) −90%768×1344, 243 frames
Video 3: camera (orbit) (priority-based) −90%768×1344, 243 frames
Teacher (all tokens)30 FPS
+ CodecOPSD (8.4× faster)30 FPS
Condition tokens 232,064 → 24,153 (−90%) · VLM reference tokens 47,670 → 10,996 (−77%)
Denoising on 1× B200: 1013 s → 121 s (8.4× faster)
Extreme setting: 90% priority-based pruning on the effect, motion, and camera videos, also applied in the VLM encoder.
Readable text from a reference picture8.9× faster denoisingReference-to-video · 3 pictures + 3 videos → 1 video (Pika H3 Flex, distilled 6 steps) · 768×1344, 124 frames · 1× H200

The word comes from Picture 1, where the plane tows the banner. Codec pruning keeps the letters and drops the empty sky around them. Video 2 provides the layout of the plane and the running man. Video 3 provides the camera pan.

Picture 1: plane with the banner
Picture 1: plane with the banner −94%1536×2688, shown cropped
Picture 2: beach
Picture 2: beach −64%2048×3584
Picture 3: man
Picture 3: man −78%2048×1536
Video 1: motion (running) (priority-based) −90%768×1344, 124 frames
Video 2: layout boxes −99%768×1344, 124 frames
Video 3: camera (pan) (priority-based) −90%768×1344, 124 frames
Teacher (all tokens) · 662 s30 FPS
+ CodecOPSD · 74.7 s (8.9× faster)30 FPS
Condition tokens 126,160 → 11,362 (−91%)
Denoising on 1× H200: 662 s → 74.7 s (8.9× faster)
Extreme setting: 90% priority-based pruning on the motion and camera videos, also applied in the VLM encoder.
Anime duel in two shots6.8× faster denoisingReference-to-video · 3 pictures + 3 videos → 1 video (Pika H3 Flex, distilled 6 steps) · 768×1344, 124 frames · 1× H200
Picture 1: character
Picture 1: character −88%2048×3584
Picture 2: character
Picture 2: character −88%2048×3584
Picture 3: scene
Picture 3: scene −86%2048×3584
Video 1: effect (lightning) (priority-based) −90%768×1344, 124 frames
Video 2: effect (fire vortex) (priority-based) −90%768×1344, 124 frames
Video 3: camera (zoom-in, cut, orbit) −67%768×1344, 124 frames
Teacher (all tokens) · 731 s30 FPS
+ CodecOPSD · 108 s (6.8× faster)30 FPS
Condition tokens 133,392 → 22,329 (−83%)
Denoising on 1× H200: 731 s → 108 s (6.8× faster)
Extreme setting: 90% priority-based pruning on the two effect videos, also applied in the VLM encoder.

Greybox

From Saturn to Earth2.3× faster denoisingReference-to-video · 5 pictures + 1 greybox video → 1 video (Pika H3 Flex, distilled 6 steps) · 768×1344, 345 frames in one shot · 1× H200Camera, one continuous take: Dolly Zoom (Hitchcock zoom, Vertigo effect) → Push-In → Crash Zoom into her eye → Push-Through the pupil into space → slow Push-In on the Earth
Picture 1: astronaut
Picture 1: astronaut −63%1344×1024
Picture 2: her face
Picture 2: her face −25%1344×1024
Picture 3: cliff and planet
Picture 3: cliff and planet −19%768×1344
Picture 4: beacon
Picture 4: beacon −84%768×1344
Picture 5: Earth (last frame)
Picture 5: Earth (last frame) −47%768×1344
Video 1: greybox camera (Dolly Zoom, Crash Zoom, Push-Through) (priority-based) −75%768×1344, 345 frames
Teacher (all tokens) · 867.8 s30 FPS
+ CodecOPSD · 373.7 s (2.3× faster)30 FPS
Condition tokens 108,528 → 28,723 (−74%) · VLM reference tokens 20,375 → 12,492 (−39%)
Denoising on 1× H200: 867.8 s → 373.7 s (2.3× faster)
Our LoRA is added to the SolarRenderer greybox model without retraining.
Racing drone through a city2.1× faster denoisingReference-to-video · greybox + first frame → video (SolarRenderer, distilled 4 steps) · 768×1344, 158 frames · 1× H200
First frame
First frame −20%768×1344
Greybox video (priority-based) −75%768×1344, 158 frames
SolarRenderer alone (all tokens) · 137 s30 FPS
+ CodecOPSD · 66.7 s (2.1× faster)30 FPS
Condition tokens 48,384 → 12,652 (−74%)
Denoising on 1× H200: 137 s → 66.7 s (2.1× faster)
Highway chase downtown2.0× faster denoisingReference-to-video · greybox + first frame → video (SolarRenderer, distilled 4 steps) · 768×1344, 158 frames · 1× H200
First frame
First frame −16%768×1344
Greybox video (priority-based) −75%768×1344, 158 frames
SolarRenderer alone (all tokens) · 136 s30 FPS
+ CodecOPSD · 68.2 s (2.0× faster)30 FPS
Condition tokens 48,384 → 12,687 (−74%)
Denoising on 1× H200: 136 s → 68.2 s (2.0× faster)
Just for fun: a greybox-driven short film, made with MiniMax-H3 Ref2VA + CodecOPSD in five generations. No Teacher run, no post-editing.
Reference-to-video · greybox video + pictures → video (distilled 6 steps) · five generations · 768×1344, 737 frames (141 + 175 + 175 + 106 + 140) · 1× B200
Condition tokens, five parts: 278,256 → 89,535 (−68%)
Denoising on 1× B200: 67.1 + 79.0 + 82.6 + 50.8 + 65.4 = 344.9 s (five generations)
Parts 1–5 · conditions
Greybox video (priority-based)768×1344
First frame768×1344
Last frame768×1344
Effect / keyper part
Wound frontper part
Wound backper part
Identity mech, front1536×1024
Identity mech, back1536×1024
Identity monster1536×1024
Scene street1024×1536
Scene city from above1024×1536
Part 1draws its blade, charges, takes off141 frames
53,568 → 18,906 tokens (−65%)
denoising 67.1 s (B200)
−70%
Part 1 · first frame−13%
Part 1 · last frame−16%
Part 1 · thruster effectthruster effect−87%
Part 1 · identity: mech, front−53%
Part 1 · identity: mech, back−54%
Part 1 · identity: monster−65%
Part 1 · scene: street−18%
Part 1 · scene: city from above−32%
Part 2charges, slapped away by the right hand, recovers175 frames
63,648 → 17,458 tokens (−73%)
denoising 79.0 s (B200)
−79%
Part 2 · first frame−30%
Part 2 · last frame−24%
Part 2 · key pose: handkey pose: hand−52%
Part 2 · identity: mech, front−53%
Part 2 · identity: mech, back−54%
Part 2 · identity: monster−65%
Part 2 · scene: street−18%
Part 2 · scene: city from above−32%
Part 3giant-blade ultimate and the dive175 frames
62,112 → 18,961 tokens (−69%)
denoising 82.6 s (B200)
−75%
Part 3 · first frame−23%
Part 3 · last frame−23%
Part 3 · identity: mech, front−53%
Part 3 · identity: mech, back−54%
Part 3 · identity: monster−65%
Part 3 · scene: street−18%
Part 3 · scene: city from above−32%
Part 4the cut and its extreme-wide replay106 frames
45,072 → 15,816 tokens (−65%)
denoising 50.8 s (B200)
−72%
Part 4 · first frame−28%
Part 4 · slash effectslash effect−62%
Part 4 · wound, front−47%
Part 4 · wound, back−54%
Part 4 · identity: mech, front−53%
Part 4 · identity: mech, back−54%
Part 4 · identity: monster−65%
Part 4 · scene: street−18%
Part 4 · scene: city from above−32%
Part 5landing, push-in on the shield140 frames
53,856 → 18,394 tokens (−66%)
denoising 65.4 s (B200)
−70%
Part 5 · first frame−46%
Part 5 · ring effectring effect−82%
Part 5 · wound, back−54%
Part 5 · identity: mech, front−53%
Part 5 · identity: mech, back−54%
Part 5 · identity: monster−65%
Part 5 · scene: street−18%
Part 5 · scene: city from above−32%

MiniMax-H3-Image Multi-Reference Image Generation

6 references → 1 desk scene3.1× faster denoisingMulti-reference image · 6 pictures → image (distilled 6 steps) · 1664×2496 · 1× H200Put the “laptop”, “lamp”, “plant”, “mug”, and “headphones” onto the “desk” in the evening, in the same camera view, with a “CodecOPSD” logo printed on the mug.
Picture 1
Picture 1 −68%1536×1536
Picture 2
Picture 2 −86%2304×1536
Picture 3
Picture 3 −83%2304×1536
Picture 4
Picture 4 −67%1536×1536
Picture 5
Picture 5 −69%1536×1536
Picture 6
Picture 6 −80%1536×2304
Teacher (all tokens)
Teacher (all tokens) · 29.7 s
CodecOPSD
+ CodecOPSD · 9.5 s (3.1× faster)
Reference tokens 17,280 → 4,006 (−77%)
Denoising on 1× H200: 29.7 s → 9.5 s (3.1× faster)
5 references → woman with her cat3.4× faster denoisingMulti-reference image · 5 pictures → image (distilled 6 steps) · 2048×2048 · 1× H200
Picture 1
Picture 1 −83%2048×3072
Picture 2
Picture 2 −44%3072×2048
Picture 3
Picture 3 −88%2848×2048
Picture 4
Picture 4 −85%2048×2720
Picture 5
Picture 5 −74%2048×3072
Teacher (all tokens)
Teacher (all tokens) · 44.5 s
CodecOPSD
+ CodecOPSD · 12.9 s (3.4× faster)
Reference tokens 29,568 → 7,533 (−75%)
Denoising on 1× H200: 44.5 s → 12.9 s (3.4× faster)
16 references → 1 group photo7.6× faster denoisingMulti-reference image · 16 pictures → image (distilled 6 steps) · 2048×3072 · 1× H200
Picture 1
1 −78%3072×2048
Picture 2
2 −90%2048×3072
Picture 3
3 −86%2048×2144
Picture 4
4 −93%2048×3072
Picture 5
5 −87%3104×2048
Picture 6
6 −84%3072×2048
Picture 7
7 −89%2048×3072
Picture 8
8 −81%2048×3072
Picture 9
9 −92%2048×3552
Picture 10
10 −79%3072×2048
Picture 11
11 −76%3072×2048
Picture 12
12 −77%3072×2048
Picture 13
13 −82%3072×2048
Picture 14
14 −67%3072×2048
Picture 15
15 −87%2048×3072
Picture 16
16 −76%3648×2048
Teacher (all tokens)
Teacher (all tokens) · 302.9 s
CodecOPSD
+ CodecOPSD · 39.6 s (7.6× faster)
Reference tokens 98,624 → 17,108 (−83%)
Denoising on 1× H200: 302.9 s → 39.6 s (7.6× faster)

Cosmos3-Nano Transfer, Action, Continuation, and Audio

Multiple Controls in One Model

Robot handing over a cup6.2× faster denoisingMulti-control transfer · 4 controls + text → video (50 steps) · 832×1104, 121 frames · 1× H200
Edge −77%832×1104, 121 frames
Blur −95%832×1104, 121 frames
Depth −90%832×1104, 121 frames
Segmentation −81%832×1104, 121 frames
Teacher (all tokens) · 3952 s30 FPS
+ CodecOPSD · 633 s (6.2× faster)30 FPS
Condition tokens 112,840 → 16,098 (−86%)
Denoising on 1× H200: 3952 s → 633 s (6.2× faster)
Extreme setting: the four controls are fed sequence-wise, not ControlNet-style as in the standard Cosmos pipeline.

Video-to-Action

Moving a pot lid to the counter1.6× faster denoisingVideo-to-action · 3 camera views + instruction → 16 end-effector actions (30 steps, BF16 LoRA, CUDA graph for both) · 17 frames · 1× H200
Wrist camera −39%360×640, 17 frames (official input size)
Exterior camera 1 −79%180×320, 17 frames (official input size)
Exterior camera 2 −80%180×320, 17 frames (official input size)
Predicted end-effector x, y, z vs the robot log
Predicted end-effector x, y, z vs the robot log
Condition tokens 1,700 → 830 (−51%)
Denoising on 1× H200, after warm-up: 1.85 s → 1.14 s (1.6× faster)

Codec Pruning on Robotics Videos (Extension)

The kept tokens follow the arm and the gripper through the grasp.
Robot videosexterior camera → kept tokens (no model)
Picking up a cup (priority-based) −85%720×1280, 81 frames15 FPS
Picking up a candy bar (priority-based) −85%720×1280, 81 frames15 FPS

Continuation on Physics-IQ

Ball hits a rubber duck2.1× faster denoisingVideo continuation · 73 given frames + caption → next 120 frames (35 steps) · 720×1280 · 1× H200
Given frames (the first 73) −93%720×1280, 73 frames
Teacher (all tokens) · 337 s30 FPS
+ CodecOPSD · 163 s (2.1× faster)30 FPS
Denoising on 1× H200: 337 s → 163 s (2.1× faster)

Video-to-Audio

Chopping an onion2.2× faster denoisingVideo-to-audio · video + caption → soundtrack (35 steps) · 480×832, 81 frames · 1× H200
Input video (priority-based) −70%480×832, 81 frames30 FPS
Teacher (all tokens) · 31.48 s30 FPS
+ CodecOPSD · 14.00 s (2.2× faster)30 FPS
Denoising on 1× H200: 31.48 s → 14.00 s (2.2× faster)

Our All-in-One Video Model

Switch off Codec pruning to see each input before pruning.

A corgi jumps onto the sofa3.1× faster denoisingMulti-condition video · 6 conditions → video (distilled 8 steps) · 512×896, 121 frames, results 2× upscaled · 1× H200
Room Photo (First Frame)
Room Photo (First Frame) −82%512×896
Sketch (priority-based) −88%512×896, 121 frames
Human Pose (Two People) −87%512×896, 121 frames
Motion Track (Corgi) −98%512×896, 121 frames
Identity (Corgi)
Identity (Corgi) −60%1024×1024
Identity (Man, Multi-View)
Identity (Man, Multi-View) −81%1024×1824
Teacher · 26.11 s30 FPS
+ CodecOPSD · 8.55 s (3.1× faster)30 FPS
Condition tokens 24,800 → 2,728 (−89%)
Denoising on 1× H200: 26.11 s → 8.55 s (3.1× faster)
Volleyball juggling on the beach3.3× faster denoisingMulti-condition video · 4 conditions → video (distilled 8 steps) · 512×896, 121 frames, results 2× upscaled · 1× H200
Sketch (Beach) −96%512×896, 121 frames
Human Pose −91%512×896, 121 frames
Motion Track (Ball) −99%512×896, 121 frames
Identity (Man)
Identity (Man) −87%1024×1024
Teacher · 24.15 s30 FPS
+ CodecOPSD · 7.22 s (3.3× faster)30 FPS
Condition tokens 22,528 → 1,146 (−95%)
Denoising on 1× H200: 24.15 s → 7.22 s (3.3× faster)

16 Condition Modalities

Red: the drop of this clip; grey: the paper's average over the test set (66% over all conditions).

First + Last Frame
First + Last Frame −39%paper average −41%512×768, 2 frames
Multi-View Identity
Multi-View Identity −82%paper average −86%1024×1824
Sketch −64%paper average −58%512×768, 81 frames
Depth −66%paper average −61%512×768, 81 frames
Human Pose −88%paper average −81%512×768, 81 frames
Segmentation −88%paper average −85%512×768, 81 frames
Edge −55%priority-based · paper average −55%512×768, 81 frames
Bounding Box −95%paper average −93%512×768, 81 frames
Grayscale −75%paper average −41%512×768, 81 frames
Inpainting −50%paper average −50%512×768, 81 frames
Motion Track −95%paper average −95%512×768, 81 frames
Dense Track −58%paper average −59%512×768, 81 frames
Surface Normal −76%paper average −48%512×768, 81 frames
Outpainting −80%paper average −66%512×768, 81 frames
Blur −71%paper average −71%512×768, 81 frames
Continuation −33%paper average −29%512×768, 49 frames

Paper Details

Method Pipeline

Pipeline of CodecOPSD

More Conditions, More Savings

On MiniMax-H3 Ref2VA (top) and MiniMax-H3-Image (bottom), the speed-up grows with more references, higher resolution, and more frames, at the dense model's quality.

Speed-up and quality of CodecOPSD vs the dense model as the inputs grow

BibTeX

@article{wang2026codecopsd,
  title   = {On-Policy Codec Distillation for Efficient All-in-One Video Generation},
  author  = {Wang, Boyang and Blackburn-Matzen, Kevin and Saha, Oindrila and Gadelha, Matheus and Cheng, Zezhou},
  year    = {2026}
}