Temporal Weight Surgery: Repairing Video Grounding with LLM Editors
Organizations: Department of Computer Science Virginia Tech
Abstract
A surgeon first finds what is wrong, then fixes only that part. We use this idea for video grounding, where video-language models often find the right moment in a long video but write its time wrong. In Temporal Weight Surgery (TWS), a general-purpose LLM reads the model's weights and activations, finds where the error arises and repairs it there, without gradients. Separate sessions find the same cause, and this diagnosis of where and why the model fails is our main contribution. Three GPT-6 Astra sessions trace a dropped digit in TimeLens-8B to one MLP layer, and the largest edit gains 7.9 mIoU on 1,215 unseen questions and 18.3 on videos of 30 minutes or more. Two Claude Opus 5.5 sessions trace minutes written as seconds in Qwen3-VL-8B to the separator and gain 2.9 and 1.3. Before any edit, its answers often have the right minute and the wrong separator, and fixing only the separator lifts their mIoU from 13.1 to 19.2. Every improving edit beats a random edit of its size, and the edited models run as fast as before.
Figures & tables
| Run | Editor | Base model | Calls | Weight update | Practice mIoU | Test mIoU | Edit vs. control mIoU |
|---|---|---|---|---|---|---|---|
| 17 | GPT-6 Astra | TimeLens-8B | 50 | rank-1 MLP output, layer 34 (0.15) | |||
| 15 | GPT-6 Astra | TimeLens-8B | 50 | rank-1 MLP output, layer 34 (0.09) | |||
| 16 | GPT-6 Astra | TimeLens-8B | 50 | rank-1 MLP output, layer 34 (0.04) | |||
| 4 | Claude Opus 5.5 | Qwen3-VL-8B | 10 | value/output edit, layer 35 | |||
| 3 | Claude Opus 5.5 | Qwen3-VL-8B | 10 | query edit, layers 31–35 | |||
| 12 | GPT-6 Astra | Qwen3-VL-2B | 50 | two head outputs, layers 16, 20 |
| TimeLens-8B | Qwen3-VL-8B | Qwen3-VL-2B | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Method | TR | V2 | All | TR | V2 | All | TR | V2 | All |
| Base model | 34.6 | 25.9 | 29.5 | 29.8 | 20.9 | 24.6 | 25.3 | 18.4 | 21.3 |
| Output rule ∗ | 40.4 | 31.2 | 35.1 | 30.4 | 21.3 | 25.1 | 27.7 | 18.8 | 22.5 |
| Random edit | 34.5 | 26.1 | 29.7 | 29.7 | 21.1 | 24.7 | 24.9 | 17.9 | 20.8 |
| Steering, no LLM | 38.8 | 31.1 | 34.3 | 31.5 | 23.2 | 26.7 | 27.2 | 18.5 | 22.2 |
| TWS (ours) | 42.7 | 33.5 | 37.4 | 33.3 | 23.2 | 27.5 | 27.5 | 20.4 | 23.4 |
| Repair | GPU h (session h) | Tensors | Test mIoU |
|---|---|---|---|
| Qwen3-VL-8B | |||
| TWS (ours), Claude | 3.7, 4.3 (11.5, 14.0) | 5, 2 | , |
| Steering, no LLM | 4.2 | 10 | |
| LoRA, same questions | 2.9 | 144 | |
| Format prompt | none | 0 | |
| TimeLens-8B | |||
Appendix figures & tables29 assets
Supplementary material from the paper’s appendix.
Appendix
| (a) Steering candidates and evaluation of the selected candidate | ||||||||
|---|---|---|---|---|---|---|---|---|
| Development mIoU | Selected candidate | |||||||
| Base model | Layers | Held-out | Test | 95% CI | ||||
| Qwen3-VL-8B | 31–35 †‡ | |||||||
| Qwen3-VL-2B | 22–26 † | |||||||
| 16–20 ‡ | ||||||||
| TimeLens-8B | 18–22 † | |||||||
| Submitted edit | Practice | ||||||||||
| Run | Editor | Base model | Access | Weights | Layers | Tensors | Turns | Calls | mIoU | Test mIoU | |
| 1 | Claude | TimeLens2-8B + LoRA | LoRA | top LoRA component removed | adapter | 120 | 139 | 10 | 478 | ||
| 2 | Claude | TimeLens2-8B | Attn. | attention output, rank 1 | 30, 32–34 | 4 | 258 | 10 | 240 | ||
| 3 | Claude | Qwen3-VL-8B | Attn. | query | 31–35 | 5 | 189 | 10 | 246 | ||
| 4 | Claude | Qwen3-VL-8B | Attn. | value and output | 35 | 2 | 277 | 10 | 246 | ||
| 5 | Astra | Qwen3-VL-8B | Attn. | none | – | – | 28 | 10 | 240 | – | |
| Edit strength | Practice subset | mIoU |
|---|---|---|
| 234 dev. | ||
| (submitted) | 246 held-out | |
| all 480 | ||
| all 480 | ||
| 234 dev. | ||
| (sign reversed) | all 480 |
| Practice (120) | Test (1,215) | |||
|---|---|---|---|---|
| Decoding method | mIoU | Hit token limit | mIoU | mIoU |
| Thinking mode | 15.03 | 48 | 18.67 | |
| answers within the limit | 25.04 | 29.54 | ||
| Non-thinking mode | 12.84 | – | 15.36 | |
| Budget forcing | 17.95 | 0 | 21.27 | |
| Repetition penalty 1.1 | 17.89 | 32 | 19.59 | |
| Base model and editor | Sessions | Mean mIoU | Best mIoU |
|---|---|---|---|
| TimeLens-8B | 5 | ||
| Qwen3-VL-8B with Claude Opus 5.5 | 2 | ||
| Qwen3-VL-8B with GPT-6 Astra | 3 | ||
| Qwen3-VL-2B | 3 | ||
| Qwen3.5-0.8B in thinking mode | 2 | ||
| Qwen3.5-0.8B in non-thinking mode | 1 |
| Answers | Ceiling of a repair | ||||||
|---|---|---|---|---|---|---|---|
| Base model | mIoU | collapse to start | no overlap | centre | length | scale | frame index |
| Qwen3-VL-8B | 24.62 | 27.2% | 43.1% | ||||
| TimeLens-8B | 29.54 | 14.7% | 40.8% | ||||
| Qwen3-VL-2B | 21.30 | 26.0% | 42.5% | ||||
| InternVL3.5-8B | 21.90 | 8.8% | 44.4% | ||||
| Qwen3.5-0.8B, non-thinking | 15.36 | 14.7% | 47.2% | ||||
| All 1,215 | Changed 294 | |
|---|---|---|
| Base model | 24.62 | 13.10 |
| Base answers read as minutes | – | 9.75 |
| Separator only (decoding rule, ) | 26.09 | 19.20 |
| Query edit | 26.53 | 16.52 |
| Value/output edit | 27.47 | 18.84 |
| Steering | 26.69 | 14.68 |
| Model | mIoU | Collapse to start | No span | Scale ceiling | Centre correction |
|---|---|---|---|---|---|
| TimeLens2-2B | 41.17 | 6.2% | 0.5% | ||
| TimeLens2-4B | 43.71 | 4.5% | 0.7% | ||
| TimeLens2-8B | 44.13 | 5.2% | 0.0% | ||
| Qwen3-VL-4B | 21.23 | 4.3% | 30.7% | ||
| Qwen3-VL-8B | 16.00 | 48.7% | 12.9% | ||
| Qwen3-VL-30B-A3B | 31.05 | 12.5% | 14.1% |
| Qwen3-VL-8B | TimeLens-8B | MiMo-VL-7B | |
| Peak inside a true span, answers without overlap | |||
| all | 44.6% (271) | 41.8% (294) | 55.5% (373) |
| event under 2% of the video (chance 0.7%) | 34.6% (182) | 27.9% (190) | 44.3% (237) |
| event 2 to 10% of the video (chance 5%) | 65.5% (58) | 68.4% (76) | 77.8% (99) |
| no overlap after any tested rescaling | 40.1% (187) | 11.9% (118) | 52.5% (282) |
| mIoU on all questions | |||
| Integer digits | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| TimeLens-100K target times | 29,526 | 140,488 | 23,158 | 0 |
| Dropped digit, base answers | 273 of 489 (55.8%) | |||
| Query edit (run 3) | Value/output edit (run 4) | |||||
|---|---|---|---|---|---|---|
| Answer change | share | share | ||||
| New separator, times within 1 s | 1 | 0% | 1 | 0% | ||
| New separator, same first number, other changes | 83 | 46% | 177 | 39% | ||
| New separator, different first number | 63 | 49% | 116 | 35% | ||
| Same separator | 1,068 | 5% | 921 | 27% | ||
| Model | Weights | [email protected] | [email protected] | [email protected] | mIoU |
|---|---|---|---|---|---|
| TimeLens-8B | base | 37.94 | 29.14 | 20.16 | 29.55 |
| run 16 edit | 42.14 | 32.35 | 22.39 | 32.68 | |
| run 17 edit | 47.24 | 36.30 | 26.34 | 37.44 | |
| LoRA | 49.63 | 38.85 | 27.90 | 38.94 | |
| Qwen3-VL-8B | base | 32.35 | 23.37 | 16.21 | 25.02 |
| query edit | 34.16 | 24.61 | 16.71 | 26.32 |
| Patched block | LD | 95% interval |
|---|---|---|
| Layer 35 MLP | ||
| Layer 30 MLP | ||
| Layer 34 MLP (edited) | ||
| Layer 22 MLP | ||
| Layer 33 attention | ||
| Layer 32 MLP |
| Change at layer 34 | Failures | Correct decimals |
|---|---|---|
| Run 17’s edit | 63.3% | 2.5% |
| Random selector | 0% | 0% |
| Mean selector | 0% | 0% |
| Constant bias | 2.5% | 0.8% |
| Constant bias | 9.2% | 0.8% |
| Constant bias | 98.3% | 52.5% |
| Weights | mIoU | base | run 17 control | 30 min |
|---|---|---|---|---|
| Base model | 29.59 | |||
| Run 17’s edit | 36.93 | |||
| Constant bias | 31.88 | |||
| Constant bias | 10.21 | |||
| Random selector | 28.74 |
| Model | Weights | Charades | ActivityNet | QVHighlights |
|---|---|---|---|---|
| TimeLens-8B | base | 55.23 | 52.78 | 65.32 |
| run 17 | ||||
| run 16 | ||||
| Qwen3-VL-8B | base | 48.34 | – | 59.38 |
| query edit | – | |||
| value/output | – |
| Weights | mIoU | base | 30 min |
|---|---|---|---|
| Base model | 29.55 | 6.79 | |
| Run 17’s edit | 37.44 | 25.06 | |
| LoRA | 38.94 | 29.69 | |
| LoRA + run 17’s edit | 36.62 | 27.85 |
| Run | Weight update | Test mIoU | Edit vs. control |
|---|---|---|---|
| 27 | rank-1 MLP output, layer 34 (0.06) | ||
| 28 | rank-1 MLP output, layer 32 (0.05) |
Temporal Video Grounding
Temporal video grounding locates the moments in a video that match a natural-language query, enabling precise search and evidence-based understanding.
See all 186 papers