When to Lock Attention: Training-Free KV Control in Video Diffusion
Organizations: Shanghai Jiao Tong University, Shanghai, China · Tongji University, Shanghai, China · The University of Texas at Austin, Austin, TX, USA · Peking University, Beijing, China ·
Abstract
Maintaining background consistency while enhancing foreground quality remains a core challenge in video editing. Injecting full-image information often leads to background artifacts, whereas rigid background locking severely constrains the model's capacity for foreground generation. To address this issue, we propose KV-Lock, a training-free framework tailored for DiT-based video diffusion models. Our core insight is that the hallucination metric (variance of denoising prediction) directly quantifies generation diversity, which is inherently linked to the classifier-free guidance (CFG) scale. Building upon this, KV-Lock leverages diffusion hallucination detection to dynamically schedule two key components: the fusion ratio between cached background key-values (KVs) and newly generated KVs, and the CFG scale. When hallucination risk is detected, KV-Lock strengthens background KV locking and simultaneously amplifies conditional guidance for foreground generation, thereby mitigating artifacts and improving generation fidelity. As a training-free, plug-and-play module, KV-Lock can be easily integrated into any pre-trained DiT-based models. Extensive experiments validate that our method outperforms existing approaches in improved foreground quality with high background fidelity across various video editing tasks.
Figures & tables
| Method | VBench Metrics | Background | User Study | Inf. Time | |||||||||
| SC | BC | MS | AQ | IQ | Ave. | SSIM | PSNR | PF | FC | VQ | Ave. | ||
| FateZero ( Qi et al., 2023 ) | |||||||||||||
| FLATTEN ( Cong et al., 2023 ) | |||||||||||||
| TokenFlow ( Geyer et al., 2023 ) | |||||||||||||
| CFG-Zero* ( Fan et al., 2025 ) | |||||||||||||
| APG ( Sadat et al., 2024 ) | |||||||||||||
| Method | VBench Metrics | Background | ||||||
| SC | BC | MS | AQ | IQ | Ave. | SSIM | PSNR | |
| Variance KV schedule only | ||||||||
| CFG schedule only | ||||||||
| CFG schedule only | ||||||||
| CFG and schedule | ||||||||
| Variance KV and CFG schedule | ||||||||
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Value | Note |
| Hallucination threshold | ||
| Total diffusion timestep | - | |
| Hallucination detection window size | ||
| Hallucination detection final step ( Aithal et al., 2024 ) | ||
| Origin CFG scale ( Jiang et al., 2025 ) | ||
| Clamp boundar |
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 732 papers