Introduction
Standard Large Language Models (LLMs) operate on an autoregressive (AR) principle, generating text one token at a time. While effective, this sequential nature creates a significant bottleneck: high-performance GPUs often remain underutilized as they wait for the next token's calculation, leading to high latency in real-time applications.
To address this, researchers have previously explored speculative decoding, which uses a smaller "draft" model to predict future tokens for a larger "target" model to verify. However, this introduces the complexity of managing and aligning two separate models. This paper introduces Smart Parallel Auto-Correct dEcoding (SPACE), a framework that allows a single model to act as both the speculator and the verifier, achieving speedups of 2.7x to 4.0x without compromising output quality.
Methodology
SPACE eliminates the need for auxiliary draft models through two core innovations:
1. Semi-Autoregressive Supervised Fine-Tuning (SAR-SFT)
Models are fine-tuned to understand and process "mask" tokens. During training, $k$ mask tokens are inserted into the input sequence. The model is trained to predict the immediate next token and simultaneously fill these masks with future token guesses. A weighted loss function ensures the model maintains its standard autoregressive capabilities while developing the intuition required for look-ahead prediction.
2. Auto-Correct Decoding Algorithm
During inference, the model performs a single forward pass using a specialized attention mask. It is fed the current sequence, $k$ candidate tokens (guesses), and $k+1$ groups of mask tokens. This allows the model to simultaneously:
- Verify the accuracy of previous guesses.
- Generate a new set of candidate tokens for the subsequent step.
If the guesses are verified as correct via rejection sampling, the model "jumps" forward multiple tokens. If a guess is incorrect, the system "auto-corrects" and resumes from the last valid token, ensuring the final output is mathematically identical to standard sequential decoding.
Experimental Setup
The authors evaluated SPACE using models ranging from 6B to 70B parameters (including LLaMA-2 and Qwen). Training utilized a diverse mix of ~167k samples from datasets like Alpaca-GPT4 and CodeAlpaca. Performance was benchmarked across several domains:
- XSum: Document summarization.
- HumanEval-X: Python code generation.
- MT-Bench: Multi-turn conversational quality.
- CIP: General instruction following.
Key Results and Insights
SPACE demonstrates that "self-drafting" provides a significant advantage by avoiding the memory overhead and distributional misalignment inherent in two-model systems.
- Task-Specific Gains: The most substantial improvements were observed in highly structured tasks. For instance, SPACE achieved a 4.04x speedup on LLaMA-2-70B for coding tasks (HumanEval-X), where token patterns are more predictable.
- Model Scaling: Larger models (e.g., 70B) generally saw higher speedup ratios than smaller models (7B), suggesting that increased parameter counts correlate with better predictive "guessing" capabilities.
- Lossless Acceleration: Because the framework relies on rejection sampling, the output distribution remains identical to the original model, providing speed without sacrificing intelligence.
Conclusion
SPACE represents a major step forward in LLM efficiency, outperforming existing methods like Medusa and standard speculative decoding. By integrating with the Text Generation Inference (TGI) framework, the authors have demonstrated that SPACE is ready for production environments. Future work will focus on expanding these gains to multilingual contexts and further optimizing the computational cost of individual forward passes.
Summary updated