Large language models such as GPT and Llama are trained with a next-token prediction loss. In this work, we suggest that training language models to predict multiple future tokens at once results in higher sample efficiency. More specifically, at each position in the training corpus, we ask the model to predict the following n tokens using n independent output heads, operating on top of a shared model trunk. Considering multi-token prediction as an auxiliary training task, we measure improved downstream capabilities with no overhead in training time for both code and natural language models. The method is increasingly useful for larger model sizes and keeps its appeal when training for multiple epochs. Gains are especially pronounced on generative benchmarks like coding, where our models consistently outperform strong baselines by several percentage points. Our 13B parameter models solves 12 % more problems on HumanEval and 17 % more on MBPP than comparable next-token models. Experiments on small algorithmic tasks demonstrate that multi-token prediction is favorable for the development of induction heads and algorithmic reasoning capabilities. As an additional benefit, models trained with 4-token prediction are up to 3X times faster at inference, even with large batch sizes.
Figures & tables
Figure 1: Empirical weight histogram and Q-Q plot for Llama3-8B layer 8 attention weights.
Figure 2: Empirical weight histogram and Q-Q plot for Llama3-8B layer 8 Multi-layer Perceptron (MLP) weights.
Figure 3: Empirical weight histogram and Q-Q plot for Qwen2.5-7B layer 8 attention weights.
Figure 4: Empirical weight histogram and Q-Q plot for Qwen2.5-7B layer 8 Multi-layer Perceptron (MLP) weights.
Figure 5: Salient weights of WK matrix – Llama3-8B, Layer 0. The red line indicates the weight column with the highest average magnitude. The cyan column is the one with the highest average input activation.
Metric (Distribution)
Value
RMSE (Normal)
0.064997±0.015139
RMSE (Laplace)
0.129452±0.014876
RMSE (Logistic)
0.036828±0.006687
MAE (Normal)
0.049695±0.011627
MAE (Laplace)
0.096109±0.011544
MAE (Logistic)
0.017589±0.005429
Table 1: Quantile-space RMSE and MAE for LLaMA-3-8B.
Metric (Distribution)
Value
RMSE (Normal)
0.073840±0.037662
RMSE (Laplace)
0.126464±0.017551
RMSE (Logistic)
0.042664±0.026675
MAE (Normal)
0.057761±0.033243
MAE (Laplace)
0.093779±0.014479
MAE (Logistic)
0.025113±0.026512
Table 2: Quantile-space RMSE and MAE for Qwen-2.5-7B.
Quantization
Llama
Qwen
Unquantized (FP16)
0.4461
0.4474
AWQ 4-bit (w=4, g=128)
0.4344
0.4539
DACQ Hybrid
4-bit (w=4, g=128)
0.4108
0.4461
DACQ Logistic
4-bit (w=4, g=128)
0.4298
0.4455
Table 3: MMLU accuracy for Meta-Llama-3-8B and Qwen2.5-7B .
Quantization
Llama
Qwen
Unquantized (FP16)
6.136
6.848
AWQ 4-bit (w=4, g=128)
6.532
7.426
DACQ Hybrid
4-bit (w=4, g=128)
8.477
7.552
DACQ Logistic
4-bit (w=4, g=128)
15.748
7.758
Table 4: WikiText-2 perplexity for Meta-Llama-3-8B and Qwen2.5-7B .
Quantization
Throughput (tok/s)
Latency (ms/tok)
Unquantized
857.6
1.166
AWQ 4-bit
1398.0
0.715
DACQ Hybrid 4-bit
1022.5
0.978
DACQ Logistic 4-bit
975.05
1.025
Table 5: Efficiency metrics for Meta-Llama-3-8B.
Quantization
Throughput (tok/s)
Latency (ms/tok)
Unquantized
929.4
1.0759
AWQ 4-bit
1480.2
0.675
DACQ Hybrid 4-bit
1093.1
0.915
DACQ Logistic 4-bit
1035.4
0.966
Table 6: Efficiency metrics for Qwen2.5-7B.
Figure 6: AWQ quantization error on LLama-8B Layer 0
Figure 7: DACQ quantization error (lower than AWQ)