Introduction
Large Language Models (LLMs) have revolutionized natural language processing but face a significant bottleneck: inference speed. Because LLMs generate text auto-regressively—one token at a time—they are often bound by the "memory wall." This means the GPU spends more time moving model parameters from memory to the processor than it does performing actual calculations.
Clover is a novel speculative decoding framework that addresses this by re-introducing "sequential knowledge" into the drafting process. By using a regressive connection and a specialized attention decoder, Clover achieves up to a 146% speedup over vanilla decoding and outperforms previous state-of-the-art methods like Medusa by up to 57%.
The Challenge of Independent Speculation
Speculative decoding typically involves a lightweight "draft" mechanism that guesses several future tokens simultaneously, which a larger "target" model then verifies in parallel. However, existing integrated speculators, such as Medusa, utilize independent heads that do not communicate. Because the second head does not know what the first head predicted, the accuracy of these future guesses drops off sharply. This leads to a low "hit rate" and wasted computational effort.
The Clover Architecture
Clover introduces three key architectural innovations to restore sequentiality to the speculative process:
- Regressive Connection: Unlike independent heads, Clover's heads are linked. The prediction for the next-plus-one token depends on the embedding of the predicted next token.
- Attention Decoder: This component serves as the engine for the regressive connection. It uses a cross-attention mechanism to merge the hidden states of the main LLM with the embeddings of the tokens just speculated, allowing the model to "look back" at its own guesses.
- Augmenting Block: Standard LLMs are optimized for immediate next-token prediction. Clover appends a small, additional transformer block to the end of the target model specifically fine-tuned to extract features for long-range speculation.
Crucially, Clover shares the original Language Model (LM) head across all speculative heads, which reduces the parameter count and simplifies the training process.
Key Insights and Results
The researchers found that sequentiality is vital for high-quality speculation. By making draft heads aware of each other's guesses, the accuracy of the 2nd and 3rd speculated tokens increased by over 20% compared to Medusa. This results in a "denser" token tree with higher-quality guesses that are more efficient for GPUs to process.
Testing on Baichuan-Small (7B) and Baichuan-Large (100B+) models revealed significant performance gains:
- Throughput: Clover achieved a maximum throughput improvement of 2.56x over vanilla auto-regressive decoding.
- Efficiency: Clover generated 50% to 76% more accepted tokens per step than Medusa across various tasks, including coding, math, and medical reasoning.
- Scaling: The advantages of Clover became even more pronounced as model size increased, suggesting high effectiveness for frontier-scale LLMs.
Limitations and Future Work
While the regressive connection improves accuracy, it introduces a minor sequential dependency during the speculation phase. Additionally, Clover requires a brief fine-tuning phase (approximately 2 hours on 8-32 GPUs) to train the new heads and augmenting block. Future research may explore more complex regressive structures and broader model architecture compatibility beyond the Baichuan family.
Summary updated