Divergent Token Metrics: Measuring degradation to prune away LLM components - and optimize quantization

Björn Deiseroth, Max Meuer, Nikolas Gritsch, Constantin Eichenberg, Patrick Schramowski, Matthias Aßenmacher, Kristian Kersting · DOI

Introduction

As Large Language Models (LLMs) scale to hundreds of billions of parameters, the hardware requirements for deployment become increasingly prohibitive. Compression techniques such as sparsification (weight removal) and quantization (precision reduction) are essential for efficiency. However, traditional evaluation metrics like Perplexity (PPL) often fail to capture the "butterfly effect" of iterative text generation, where a single early error can derail an entire sequence.

The Problem with Perplexity

Perplexity measures how well a model predicts a sequence on average. While useful, it can mask significant local failures. A compressed model might maintain a reasonable PPL while suffering from early-onset hallucinations or grammatical errors. Because LLMs generate text token-by-token, a "divergent" token early in a sentence can lead the model down a completely different, often nonsensical, path. We need a metric that captures this discontinuous failure mode.

Divergent Token Metrics (DTMs)

To address this, researchers propose Divergent Token Metrics (DTMs), which compare a compressed model ($F'$) directly against its original baseline ($F$).

  • First Divergent Token (FDT): The index of the first token where the compressed model’s greedy output deviates from the baseline.
  • Share of Divergent Tokens (SDT): The percentage of tokens in a sequence that differ from the baseline.
  • Divergent Perplexity (DPPL): Perplexity calculated using the baseline model's output as the ground truth.
Figure 1: The First Divergent Token (FDT) identifies the exact point where a compressed model's output begins to deviate from the original baseline, capturing failures that average metrics like Perplexity might miss.

Applications in Pruning and Quantization

By using FDT to rank the sensitivity of individual model components (attention heads, MLP layers), the authors developed an iterative pruning algorithm. This approach identifies "safe" components for aggressive compression and "critical" components that must be preserved.

Key insights include:

  • Redundancy in Attention: Up to 25% of attention components can be pruned by over 90% with minimal impact.
  • Sensitivity Mapping: Middle layers are generally more robust to compression than the first and last layers, acting as a "buffer."
  • Outlier Management: FDT helps identify the 80% of components that can undergo "naive" 8-bit quantization without specialized outlier handling.

Key Results

The FDT-guided approach significantly outperforms uniform pruning strategies. For example, a 75% sparse version of Llama-2-13B was achieved while maintaining stable performance.

Figure 4: Comparison of training loss between uniform pruning and the proposed FDT-guided pruning. As sparsity (dashed line) increases, the FDT-based method maintains significantly lower loss.

In head-to-head discriminative tests, FDT successfully distinguished between effective and ineffective pruning strategies in scenarios where standard Perplexity was essentially indifferent.

Conclusion and Future Work

Divergent Token Metrics provide a more granular and generation-aware method for evaluating LLM compression. Future research will explore these metrics in multilingual contexts, under different sampling strategies (e.g., Top-p), and their impact on safety guardrails to ensure compression does not "prune away" model alignment.

Summary updated

BibTeX
@inproceedings{deiseroth2024divergent,
  author = {Björn Deiseroth and Max Meuer and Nikolas Gritsch and Constantin Eichenberg and Patrick Schramowski and Matthias Aßenmacher and Kristian Kersting},
  title = {{Divergent Token Metrics: Measuring degradation to prune away LLM components - and optimize quantization}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-long.377},
}
Figure