Faster Language Models with Better Multi-Token Prediction Using Tensor Decomposition

Artem Basharin, Andrei Chertkov, Ivan V. Oseledets · DOI

Introduction

Standard Large Language Models (LLMs) generate text autoregressively, producing one token at a time. This process is computationally expensive as each token requires a complete forward pass through the transformer network. Multi-token prediction (MTP) has emerged as a promising solution, aiming to predict the next $n$ tokens simultaneously. However, traditional MTP methods often assume conditional independence between future tokens—a "rank-1" approximation that fails to capture complex linguistic dependencies. This research introduces a novel approach using rank-$r$ tensor decomposition to model the joint probability of future tokens, significantly improving prediction accuracy and inference speed.

Methodology: The Tensor Decomposition Approach

The core innovation lies in treating the joint probability of the next $n$ tokens as an $n$-dimensional tensor. Rather than assuming each token is independent (rank-1), the authors employ Canonical Polyadic (CP) tensor decomposition.

Rank-$r$ Modeling

In this framework, the joint distribution is modeled as a weighted sum of $r$ independent predictions. This can be conceptualized as a "Mixture of Experts" (MoE) where each expert predicts a coherent sequence of tokens. By increasing the rank $r$, the model can capture intricate relationships between tokens (e.g., ensuring that if "San" is predicted first, "Francisco" follows with high probability).

Architecture of the multi-token prediction head using CP tensor decomposition.

Architectural Integration

To implement this, the researchers add $n$ prediction heads to the transformer's latent state $z_t$. A dedicated linear layer computes the mixture weights $w$. To ensure stable training and prevent "expert collapse," an auxiliary load balancing loss is introduced, ensuring all components of the decomposition are effectively utilized. For larger models, a "reduced" head design is used to minimize parameter overhead by sharing weights with the base model.

Experimental Results

The approach was evaluated across various benchmarks, including TinyStories for architectural validation and FineWeb for scaling analysis.

Performance Gains

On the TinyStories dataset, moving from a rank-1 to a higher-rank model resulted in a 30% increase in accepted draft tokens during speculative decoding. For a 1B parameter model, this translated to a 44% reduction in total execution time compared to standard autoregressive baselines.

Quality Preservation

A critical finding is that increasing the rank of the multi-token predictor does not compromise the performance of the base model. The accuracy of the immediate next token remains stable, ensuring that the speedups do not come at the cost of text quality.

Smoothed loss for the first token across different ranks, showing consistent convergence.

Discussion and Future Work

The research highlights a deep mathematical connection between multi-token prediction and Mixture of Experts. By identifying that previous MTP efforts were limited rank-1 cases, the authors provide a generalized framework for more accurate speculative decoding.

While the rank-$r$ sampling is slightly more complex than rank-1, the overhead remains minimal relative to the gains in acceptance rates. Future work may involve integrating these high-quality draft models with advanced tree-based speculative decoding strategies like Medusa or Eagle to push inference speeds even further.

Summary updated

BibTeX
@misc{basharin2024faster,
  author = {Artem Basharin and Andrei Chertkov and Ivan V. Oseledets},
  title = {{Faster Language Models with Better Multi-Token Prediction Using Tensor Decomposition}},
  year = {2024},
  eprint = {2410.17765},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.17765},
}
Figure