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
TL;DR
The paper addresses the challenge of evaluating compressed large language models by introducing Divergent Token Metrics (DTMs), including First Divergent Token Metric (FDTM) and Share of Divergent Tokens Metric (SDTM). These token-centric metrics align with the actual greedy sampling process and provide advantages over perplexity, enabling principled, component-wise sparsification and quantization on Llama-2 models. Empirical results show that 25% of attention components can be pruned beyond 90% sparsity and that around 80% of parameters can be naively quantized to int8 without severe degradation, underscoring the potential of DTMs to guide efficient compression. By directly measuring generation divergence, the approach improves upon traditional NLP benchmarks and supports targeted compression strategies with practical impact for deploying compact LLMs.
Abstract
Large Language Models (LLMs) have reshaped natural language processing with their impressive capabilities. However, their ever-increasing size has raised concerns about their effective deployment and the need for LLM compression. This study introduces the Divergent Token Metrics (DTMs), a novel approach to assessing compressed LLMs, addressing the limitations of traditional perplexity or accuracy measures that fail to accurately reflect text generation quality. DTMs measure token divergences that allow deeper insights into the subtleties of model compression, in particular, when evaluating components' impacts individually. Utilizing the First Divergent Token Metric (FDTM) in model sparsification reveals that 25% of all attention components can be pruned beyond 90% on the Llama-2 model family, still keeping SOTA performance. For quantization, FDTM suggests that more than 80% of parameters can be naively transformed to int8 without special outlier management. These evaluations indicate the necessity of choosing appropriate compressions for parameters individually -- and that FDTM can identify those -- while standard metrics result in deteriorated outcomes.
