Install Dependencies

May 17, 2026 · View on GitHub

Forcing-KV: Hybrid KV Cache Compression for Efficient Autoregressive Video Diffusion Models

Yicheng Ji1,2Zhizhou Zhong2,3Jun Zhang1Qin Yang2Xitai Jin2
Ying Qin4Wenhan Luo3Shuiyang Mao2Wei Liu2Huan Li1

1ZJU2Video Rebirth3HKUST4BJTU

arXiv Hugging Face project GitHub

✨ Highlights

  1. KV Compression Method: Forcing-KV is a hybrid KV cache compression method for autoregressive video diffusion models that accelerates inference, reduces cache memory, and even improves quality.
  2. Inference Toolkit:This repository is an inference-side toolkit providing inference scripts for multiple models (Self-Forcing, LongLive, Causal Forcing,Krea-realtime-14B, Raven, Rolling-Forcing) and various acceleration techniques (Forcing-KV, Dummy Forcing, TeaCache, FP8 Quantization), facilitating research and comparative studies.
  3. Easy Evaluation:We also provide evaluation scripts for conveniently assessing VBench, VBench-Long, Helios-Bench, and the Chunk Discontinuity Metric.

Over 29 FPS with 30% cache memory reduction, up to 1.35× and 1.50× speedups on LongLive and Self Forcing at 480P resolution, and 2.82× at 1080P resolution.


📣 Latest News!!

🎬 Video Demos

Longlive

Click to Open
Longlive +Forcing-KV

Causal Forcing

Click to Open
Causal Forcing +Forcing-KV

Krea-realtime-14b

Click to Open
Krea-realtime-14b +Forcing-KV

Raven

Click to Open
Raven +Forcing-KV

Self Forcing

Click to Open
Self Forcing +Forcing-KV

Click any preview to view the full MP4. All demo files are available under here. More at our demo page.

Method

We apply static structural pruning and dynamic similarity pruning to different heads, accelerating inference, reducing cache memory while improving quality.

⚙️ Requirements and Installation

Installation

# Create Environment
git clone https://github.com/zju-jiyicheng/Forcing-KV
cd Forcing-KV
conda create -n forcingkv python=3.10 -y
conda activate forcingkv

# Install Dependencies
pip install torch torchvision torchaudio
pip install -r requirements.txt
pip install flash-attn --no-build-isolation

# Optional: FP8 quantization
git clone https://github.com/thu-ml/SageAttention.git
cd SageAttention 
python setup.py install

Downloading Base Models

Downloading the base models ckpt to pretrained:

# Wan
hf download Wan-AI/Wan2.1-T2V-1.3B --local-dir pretrained/Wan2.1-T2V-1.3B

# Longlive 
hf download Efficient-Large-Model/LongLive-1.3B --local-dir pretrained/Longlive-1.3B 

# Self Forcing
hf download gdhe17/Self-Forcing --local-dir pretrained/Self-Forcing

# Causal Forcing
hf download zhuhz22/Causal-Forcing chunkwise/causal_forcing.pt --local-dir pretrained/Causal-Forcing

# Raven
hf download mvp-lab/RAVEN --local-dir pretrained/Raven # need to adapt

# Krea-realtime-14b
hf download krea/krea-realtime-video krea-realtime-video-14b.safetensors --local-dir pretrained/realtime   

# Rolling Forcing
hf download TencentARC/RollingForcing --local-dir pretrained/Rolling-Forcing

Also modify the absolute path in utils/wan_wrapper.py and the .yaml files under configs/.

🚀 Quick Inference

Inference Scripts

# Forcing-KV
python inference.py --config_path configs/forcing-kv/forcingkv_longlive_inference.yaml
python inference.py --config_path configs/forcing-kv/forcingkv_causal_forcing_inference.yaml
python inference.py --config_path configs/forcing-kv/forcingkv_realtime_inference.yaml
python inference.py --config_path configs/forcing-kv/forcingkv_self_forcing_inference.yaml
python inference.py --config_path configs/forcing-kv/forcingkv_raven_inference.yaml
python inference.py --config_path configs/forcing-kv/forcingkv_longlive_interactive_inference.yaml ## Interacrive prompts

# Base model
python inference.py --config_path configs/longlive/longlive_inference.yaml
python inference.py --config_path configs/causal-forcing/causal_forcing_inference.yaml
python inference.py --config_path configs/self-forcing/self_forcing_inference.yaml
python inference.py --config_path configs/krea-14b/realtime_inference.yaml
python inference.py --config_path configs/raven/raven_inference.yaml
python inference.py --config_path configs/longlive/longlive_interactive_inference.yaml ## Interacrive prompts

# Dummy Forcing
python inference.py --config_path configs/dummy-forcing/dummy_longlive_inference.yaml
python inference.py --config_path configs/dummy-forcing/dummy_self_forcing_inference.yaml

Args

  • Generation Length: Set the num_output_frames parameter in the config file to control generated length.
  • Resolution: Set the resolution parameter to generate videos at the target resolution (480P, 720P, 1080P).
  • Custom Prompts: Set the data_path parameter to the prompt file you want to use.
  • Quantization: Set the quantization_enabled parameter to enable or disable quantization.

🚀 Evaluation

  • VBench / VBench-Long: see the documents here.
  • Helios Bench: see the documents here.
  • Chunk Discontinuity Metirc: see the documents here.

Citation

If you find our work useful in your research, please consider to cite our paper and this framework📝:

@misc{ji2026forcingkvhybridkvcache,
      title={{Forcing-KV: Hybrid KV Cache Compression for Efficient Autoregressive Video Diffusion Models}}, 
      author={Yicheng Ji and Zhizhou Zhong and Jun Zhang and Qin Yang and XiTai Jin and Ying Qin and Wenhan Luo and Shuiyang Mao and Wei Liu and Huan Li},
      year={2026},
      eprint={2605.09681},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2605.09681}, 
}

Acknowledgement

Our repository is built on Self-Forcing, LongLive, Dummy Forcing, and Helios. Thanks for their wonderful work.