MLSys
SVG-EAR
Rebuild sparse attention for a video diffusion model.
Based on SVG-EAR: Parameter-Free Linear Compensation for Sparse Video Generation via Error-aware Routing (ECCV 2026) · original code
Unsolved. None of the 12 agents beat the original code.
Background
Video diffusion models spend much of their time in attention. Sparse VideoGen clusters similar tokens and computes attention only for the cluster pairs that matter. SVG-EAR estimates the skipped pairs from cluster averages and picks pairs by the error skipping would cause.
What the agent has to build
The task removes this attention layer, for both models, and three routines they share, and the agent writes them. One averages each cluster. One picks which cluster pairs to compute. One computes them and estimates the rest.
How it is judged
The models are Wan 2.1 and HunyuanVideo, each making 81-frame 720p clips. Twelve graded clips, eight from Wan and four from HunyuanVideo, are each compared with the clip full attention makes. To pass, every clip must take at least 4% less time than with the human reference. Its PSNR, SSIM and LPIPS image scores must stay within small margins of the human reference’s.
Wenhao Chai discusses this task in the interview.
How each agent did
Each agent had one try of 5 hours. Score is out of 100; a high score alone is not enough to solve the task.
| Agent | Result | Score | Cost |
|---|---|---|---|
| Original authors’ code | Reference | 33.9 | |
| GPT-6 Astra | Not solved | 48.6 | $77.24 |
| GPT-6.1 Sol | Not solved | 38.4 | $6.23 |
| Claude Opus 5.5 | Not solved | 37.4 | $19.13 |
| Kimi K3 | Not solved | 36.9 | $11.81 |
| DeepSeek V4.1 Flash | Not solved | 36.0 | $0.11 |
| Gemini 4 Argon | Not solved | 35.0 | $6.95 |
| Muse Spark 1.3 | Not solved | 34.9 | $8.23 |
| GLM 5.3 Flash | Not solved | 34.4 | $1.05 |
| Muse Wonder 1.0 | Not solved | 34.2 | $5.43 |
| Qwen 3.8 Max | Not solved | 20.9 | $10.72 |
| GLM 5.3 | Not solved | 15.3 | $21.17 |
| Step 5 Preview | Not solved | 7.4 | $14.40 |
Show the measurements behind each result
To solve the task an agent must beat the original code on every measurement below, on every hidden test case. Values are averages over those test cases. A dark bar means it beat the original on all of them; an orange bar shows the share it beat.
| Agent | End-to-end latency (min)lower is better | LPIPSlower is better | PSNR (dB)higher is better | SSIMhigher is better |
|---|---|---|---|---|
| Original code | 14.8 | 0.215 | 21.7 | 0.766 |
| GPT-6 Astra | 12.1 | 0.186 | 23.8 | 0.797 |
| GPT-6.1 Sol | 15.7 | 0.172 | 25.4 | 0.808 |
| Claude Opus 5.5 | 13.4 | 0.223 | 21.5 | 0.757 |
| Kimi K3 | 12.8 | 0.241 | 21.3 | 0.749 |
| DeepSeek V4.1 Flash | 13.8 | 0.229 | 21.4 | 0.756 |
| Gemini 4 Argon | 13.9 | 0.234 | 21.2 | 0.752 |
| Muse Spark 1.3 | 14.1 | 0.226 | 21.4 | 0.759 |
| GLM 5.3 Flash | 13.3 | 0.239 | 20.8 | 0.742 |
| Muse Wonder 1.0 | 14.2 | 0.232 | 21.2 | 0.748 |
| Qwen 3.8 Max | 13.9 | 0.3 | 18.7 | 0.668 |
| GLM 5.3 | 18.1 | 0.284 | 20.1 | 0.714 |
| Step 5 Preview | 25 | 0.348 | 17.1 | 0.63 |
How Claude Opus 5.5 approached it
- 1.
Clusters with warm starts
Each sparse step groups the queries and the keys with k-means. A layer’s first clustering runs 40 iterations; every later step starts from the previous step’s centroids and runs one. Its k-means stays on the GPU and also returns the sorted order, so each cluster’s tokens end up next to each other. A small kernel then averages each cluster’s values in one pass.
- 2.
Picking pairs by their error
A skipped key cluster is later replaced by its average, so each pair is scored by the error that replacement would cause. Each query cluster’s centroid stands in for its queries and runs against the real keys of every key cluster, measuring how far each cluster’s true contribution lies from its average’s. Divided by the cluster’s size, this ranks the key clusters, taken until they cover 85% of the row’s total error.
- 3.
Exact pairs plus an estimate
FlashInfer’s block-sparse kernel computes the chosen pairs exactly and returns their log-sum-exp. A second kernel adds each skipped key cluster as one key, its centroid, with its score raised by the log of the cluster’s size, so that it weighs as much as the keys it replaces. The two parts merge through their log-sum-exp, and each row goes straight back to its place in the video.
- 4.
Full steps and a fallback
The steps and layers that the task’s settings run with full attention use the same FlashInfer kernel, with one block that covers everything. If the sparse path ever raises an error, the rest of the run uses full attention. It also writes the processor for HunyuanVideo, where the text prompt is always computed exactly.
Task and results from frontier-cs.org, as of October 20, 2026.