The Bottleneck in LLM Inference
Standard Large Language Models (LLMs) generate text autoregressively (AR)—one token at a time. To produce a 100-token response, the model must perform 100 sequential forward passes. This sequential nature is the primary bottleneck in LLM serving.
Researchers have attempted to break this bottleneck using Jacobi decoding, a method that treats token generation as solving a system of non-linear equations. In theory, a model can guess $n$ tokens at once and iteratively refine them in parallel. However, "vanilla" Jacobi decoding is often disappointing in practice; it rarely predicts more than one correct token per iteration, resulting in a marginal 1.05× speedup.
While workarounds like Speculative Decoding (using a small "draft" model) or Medusa (adding extra prediction heads) exist, they increase system complexity, memory consumption, and engineering overhead.
The Solution: Consistency Large Language Models (CLLMs)
To address these limitations, researchers introduce CLLMs, which refine the target LLM itself to become "consistency-aware."
The core idea is inspired by Consistency Models used in image diffusion. In diffusion, a model learns to map any point on a noise-to-image trajectory directly back to the original image in a single step. CLLMs apply this concept to the "Jacobi trajectory"—the sequence of intermediate guesses the model makes while trying to reach the final, correct output (the "fixed point").
Key Innovations
- Consistency Training: The model is fine-tuned using a Global Consistency Loss ($L_{GC}$). This forces the model to take a "messy" sequence of $n$ tokens and predict the final, correct AR sequence in one go.
- Dual-Loss Objective: To ensure the model doesn't lose its core capabilities during fine-tuning, the consistency loss is combined with a standard Autoregressive Loss ($L_{AR}$).
- Data Augmentation: During training, correct tokens are randomly replaced with incorrect ones. This teaches the model how to "recover" and jump to the correct fixed point even when starting from a poor initial guess.
Key Insights: Collocations and Stationary Tokens
A major advantage of CLLMs is their ability to master collocations—words that naturally go together (e.g., SELECT and FROM in SQL, or if and else in Python). Because the model processes $n$ tokens simultaneously, it learns to "fast-forward" through these predictable structures.
Unlike standard models, CLLMs can correctly predict a token far down the line even if the tokens immediately preceding it are currently wrong. These "stationary tokens" act as anchors that help the rest of the sequence converge faster. Crucially, a CLLM achieves this with zero architectural overhead. It remains the exact same size as the original model, acting as a pure algorithmic optimization.
Performance and Results
CLLMs were evaluated across demanding domains, including text-to-SQL (Spider), code generation (CodeSearchNet), math (GSM8K), and general conversation (ShareGPT/MT-Bench).
- Significant Speedups: CLLMs achieved up to a 3.4× speedup on the Spider dataset and 2.4× on ShareGPT.
- Quality Preservation: On MT-Bench, the CLLM-7B model scored 6.4, nearly matching the original model's performance while operating significantly faster. Language fluency (perplexity) on WikiText2 and PTB was also maintained.
- Training Efficiency: Fine-tuning a LLaMA-7B model on the Spider dataset took only 2 hours on 8 A100 GPUs.
- Synergy: CLLMs can be combined with other techniques like Lookahead Decoding to achieve even higher performance (up to 3.6× on Spider).
Limitations and Future Work
While highly effective, CLLMs require a domain-specific fine-tuning step using a high-quality "Jacobi trajectory" dataset, unlike plug-and-play speculative decoding. Additionally, the current approach focuses on greedy sampling (picking the most likely token). Adapting this consistency approach to non-greedy, stochastic sampling for creative writing remains an open challenge. Finally, while CLLMs generalize well, the most dramatic speedups occur in structured domains (like code or math) where collocations are particularly strong.
Summary updated