[CVPR 2026] L2P: Learnable Linear Predictor for Efficient Diffusion Models

July 13, 2026 Β· View on GitHub

[CVPR 2026] L2P: Learnable Linear Predictor for Efficient Diffusion Models

Beyond Fixed Formulas: Data-Driven Linear Predictor for Efficient Diffusion Models

Zhirong Shen1, Rui Huang1, Jiacheng Liu1, Chang Zou1, Peiliang Cai1, Shikang Zheng1, Zhengyi Shi1, Liang Feng1, Linfeng Zhang1

[πŸ“„ Paper] Β· [πŸ€— FLUX.1-dev] Β· [πŸ’» Code]

arXiv Conference License


πŸ”₯ News

  • 2026/04/29 πŸŽ‰ L2P is accepted by CVPR 2026! Paper is available on arXiv.
  • 2026/07/13 πŸš€ L2P-FLUX code is released β€” FLUX.1-dev inference, weight training, and evaluation scripts.
  • Coming soon πŸ”œ L2P for Qwen-Image and HunyuanVideo, along with full experiment reproduction.

πŸ“‹ Table of Contents


πŸ“– Abstract

To address the high sampling cost of Diffusion Transformers (DiTs), feature caching offers a training-free acceleration method. However, existing methods rely on hand-crafted forecasting formulas that fail under aggressive skipping.

We propose L2P (Learnable Linear Predictor), a simple data-driven caching framework that replaces fixed coefficients with learnable per-timestep weights. Rapidly trained in ~20 seconds on a single GPU, L2P accurately reconstructs current features from past trajectories.

L2P significantly outperforms existing baselines: it achieves a 4.55Γ— FLOPs reduction and 4.15Γ— latency speedup on FLUX.1-dev, and maintains high visual fidelity under up to 7.18Γ— acceleration on Qwen-Image models, where prior methods show noticeable quality degradation.


✨ Highlights

🧠 Data-drivenReplace fixed Taylor / reuse formulas with learnable linear weights
⚑ Ultra-fast training~20 seconds on a single GPU, no DiT fine-tuning required
🎯 Aggressive skippingStable quality where hand-crafted predictors break down
πŸ”Œ Plug-and-playDrop-in acceleration on top of existing DiT inference pipelines

πŸ”¬ Method

At each denoising step, L2P maintains a history of past output features. On cache steps, instead of running the full transformer, L2P predicts the current feature as a causal linear combination of history β€” weights are per-timestep and learned from data.

flowchart LR
    A[Past Features<br/>xβ‚€, x₁, …, xβ‚œβ‚‹β‚] --> B[Learnable Weights<br/>Wβ‚œ Β· lower-triangular]
    B --> C[Predicted Feature xΜ‚β‚œ]
    C --> D[Skip Transformer]

    E[Full Step] --> F[Run Transformer]
    F --> G[Update History]
    G --> A

Training objective: minimize MSE between predicted and ground-truth features over denoising trajectories. The weight matrix is lower-triangular (causal) and shared across spatial tokens after FFT decomposition.


πŸ“Š Main Results

FLUX.1-dev (this repo)

MethodFLOPs ↓Latency ↓Training Cost
Full compute1.00Γ—1.00Γ—β€”
L2P (Ours)4.55Γ—4.15Γ—~20 s / 1 GPU

Qwen-Image (coming soon)

MethodMax AccelerationQuality under Aggressive Skipping
Prior caching methodsβ€”Noticeable degradation
L2P (Ours)7.18Γ—High visual fidelity

Full benchmark tables, Geneval / ImageReward / DrawBench numbers, and comparison with TaylorSeer, ToCa, FORA will be released with the complete experiment suite.


πŸ—ΊοΈ Roadmap

ModuleStatusDescription
L2P-FLUXβœ…Inference, weight training, DrawBench200 eval
L2P-Qwen-ImageπŸ”œImage generation acceleration
L2P-HunyuanVideoπŸ”œVideo generation acceleration
Full ExperimentsπŸ”œAll main paper results & reproduction scripts

πŸ› οΈ Installation

Requirements

Python >= 3.10
CUDA >= 11.8
PyTorch >= 2.5

Setup

git clone https://github.com/Aredstone/L2P-Cache.git
cd L2P-Cache

python3.10 -m venv .venv
source .venv/bin/activate
pip install -e .

# Optional: PSNR / SSIM / LPIPS evaluation
pip install -e ".[eval]"

Model Weights

Download FLUX.1-dev and set environment variables:

export FLUX_DEV=/path/to/FLUX.1-dev/flux1-dev.safetensors
export AE=/path/to/FLUX.1-dev/ae.safetensors
export FLUX_MODEL_DIR=/path/to/FLUX.1-dev   # optional: local diffusers layout
export HF_HOME=/path/to/huggingface/cache   # optional

Tip: If FLUX_MODEL_DIR points to a diffusers-style folder, T5 (text_encoder_2/) and CLIP (text_encoder/) are loaded locally with their tokenizers. Otherwise they are fetched from HuggingFace.


⚑ Quick Start

Generate images with L2P acceleration on DrawBench200:

export PYTHONPATH=src

python src/sample.py \
  --prompt_file predictor/DrawBench200.txt \
  --output_dir outputs/samples \
  --interval 7 \
  --width 1024 --height 1024 \
  --num_steps 50 \
  --device 0

Compare against full-compute baseline (--interval 1) and evaluate with evaluate.py.


πŸ“– Usage

Inference

export PYTHONPATH=src

python src/sample.py \
  --prompt_file predictor/DrawBench200.txt \
  --output_dir outputs/samples \
  --interval 7 \
  --width 1024 \
  --height 1024 \
  --num_steps 50 \
  --seed 0 \
  --device 0
ArgumentDescription
--interval 1Full compute baseline (transformer at every step)
`--interval 7$\text{L2P} \text{accelerated} (~5 \times \text{faster} \text{in} \text{practice})
$--test_FLOPs`FLOPs profiling mode (no image output)

Supported intervals with tuned step schedules: 5, 6, 7, 8, 10, 16 β€” see FULL_STEP_SCHEDULES in src/flux/model.py.

GenEval evaluation
python src/geneval_flux.py \
  /path/to/evaluation_metadata.jsonl \
  --model_name flux-dev \
  --steps 50 --width 1024 --height 1024 \
  --output_dir outputs/geneval
``$

</\text{details}>

### \text{Train} \text{Predictor} \text{Weights}

\text{L2P} \text{learns} \text{a} **50 \times 50 \text{lower}-\text{triangular}** \text{weight} \text{matrix} \text{via} \text{MSE} \text{on} \text{feature} \text{trajectories}:

$``bash
python predictor/train.py \
  --weight_path predictor/weight.txt \
  --device cuda:0

Prerequisites: pre-extracted feature tensors at ./train/features.pt and ./valid/features.pt.

Training time: ~20 seconds on a single GPU.

Evaluation

Compare L2P outputs against a full-compute reference:

# 1. Generate L2P samples
python src/sample.py --interval 7 --output_dir outputs/l2p ...

# 2. Generate baseline samples
python src/sample.py --interval 1 --output_dir outputs/baseline ...

# 3. Compute metrics
python evaluate.py \
  --test_folder outputs/l2p \
  --reference_folder outputs/baseline \
  --prompt_file predictor/DrawBench200.txt
MetricDescription
PSNR / SSIM / LPIPSPixel-level quality vs. baseline
CLIP ScoreText-image alignment (optional)
ImageReward / PickScoreHuman preference proxies (optional)

πŸ—οΈ Project Structure

L2P-Cache/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ sample.py                  # Batch inference entry point
β”‚   β”œβ”€β”€ geneval_flux.py            # GenEval benchmark
β”‚   └── flux/
β”‚       β”œβ”€β”€ model.py               # L2P integration in FLUX forward
β”‚       β”œβ”€β”€ learnable_utils/       # Linear predictor (FFT + weight apply)
β”‚       β”œβ”€β”€ l2p_cache.py           # Step scheduling & cache state
β”‚       └── ideas/cache_denoise.py # Cache-aware denoising loop
β”œβ”€β”€ predictor/
β”‚   β”œβ”€β”€ train.py                   # Weight training (~20s)
β”‚   β”œβ”€β”€ weight.txt                 # Pre-trained FLUX weights
β”‚   └── DrawBench200.txt           # Benchmark prompts
β”œβ”€β”€ evaluate.py                    # Quality & alignment metrics
└── README.md

πŸ‘ Acknowledgements

This project builds upon the excellent open-source work of:

  • FLUX β€” inference framework
  • TaylorSeer Β· ToCa β€” prior feature caching methods that inspired this line of research

We thank the authors for their contributions to the community.


πŸ“Œ Citation

If you find L2P useful for your research, please cite:

@inproceedings{shen2026l2p,
  title     = {Beyond Fixed Formulas: Data-Driven Linear Predictor for Efficient Diffusion Models},
  author    = {Shen, Zhirong and Huang, Rui and Liu, Jiacheng and Zou, Chang and Cai, Peiliang and Zheng, Shikang and Shi, Zhengyi and Feng, Liang and Zhang, Linfeng},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year      = {2026}
}