Evaluating Large Language Models for Generalization and Robustness via Data Compression

Yucheng Li, Yunhao Guo, Frank Guerin, Chenghua LinarXiv 2024 · DOI

Abstract

Standard benchmarks for Large Language Models (LLMs) often suffer from data contamination and prompt sensitivity, leading to inflated performance metrics. This paper introduces a novel evaluation framework that treats LLMs as probability engines for lossless data compression. By measuring compression rates on data released after a model's training cutoff, we can quantify true generalization and robustness. Our findings reveal a significant performance drop post-cutoff, highlighting the prevalence of memorization in current benchmarks and providing a cleaner, "contamination-proof" metric for model evaluation.

1. Introduction

The rapid advancement of LLMs has outpaced our ability to evaluate them reliably. Current benchmarks like MMLU or GLUE are plagued by three primary issues: data contamination, where models memorize test sets during training; prompt sensitivity, where minor phrasing changes lead to inconsistent results; and the high cost of maintaining static benchmarks. To address these, we propose an evaluation method based on the fundamental link between probability and compression in information theory.

2. Methodology: Compression as Prediction

If a model accurately predicts the next token in a sequence, it assigns it a high probability, which an arithmetic coding algorithm can then use to represent the sequence with fewer bits. We leverage this by using LLMs to provide probability distributions for arithmetic coding, achieving lossless compression.

Our evaluation focuses on:

  • Temporal Evaluation: Splitting data into a pre-2023 training period and a 2023 testing period to observe performance shifts relative to training cutoffs.
  • Generalization: Measured by the compression rate on unseen, post-cutoff data.
  • Robustness: Measured by the "gap" or divergence in compression performance between the training and testing periods. A small gap indicates a model that handles new information well without relying on memorization.

3. Experimental Setup

We utilized a diverse dataset spanning 83 months (2017–2023), including Wikitext, BBC News, GitHub code, ArXiv papers, and multi-modal byte streams (images and audio). This temporal breadth allows for precise identification of training cutoff effects across different domains.

4. Key Results and Analysis

4.1 The Contamination "Smoking Gun"

A key finding is the sharp increase in compression rates (indicating worse performance) immediately following a model's training cutoff. This "cutoff effect" serves as a clear indicator that high scores on older data are often a result of memorization rather than true reasoning.

Figure 1: Compression rates over time for LLaMA models on Wikitext and BBC News, showing the performance jump at training cutoffs.

4.2 Generalization vs. Robustness Trade-offs

Our analysis of various 7B-parameter models reveals a trade-off between raw compression performance and robustness. While some models achieve low compression rates (strong performance), they may exhibit a large "gap" between training and testing data, suggesting a reliance on memorization.

Figure 5: Robustness (gap between train/test performance) vs. Compression Rate for various 7B models. Lower compression rates and smaller gaps are preferred.

Models like Mistral-7B and Llama-2-70B emerged as top performers, balancing high compression efficiency with strong robustness. Conversely, specialized models like CodeLlama showed excellent performance on code but lower robustness when encountering entirely new 2023 codebases. Interestingly, models generalized better on ArXiv papers than on news or code, likely due to the highly consistent nature of scientific writing styles.

5. Discussion and Conclusion

While compression provides a cleaner metric for generalization, limitations remain. Vocabulary size can bias bits-per-token metrics, and current models struggle significantly with non-textual multi-modal data, failing to outperform traditional codecs like PNG or FLAC. Future work should focus on improving byte-level awareness for more effective multi-modal compression. Ultimately, this approach offers a more objective, scalable, and robust alternative to traditional LLM benchmarks by bypassing the need for human-curated questions entirely.

Summary updated

BibTeX
@misc{li2024evaluating,
  author = {Yucheng Li and Yunhao Guo and Frank Guerin and Chenghua Lin},
  title = {{Evaluating Large Language Models for Generalization and Robustness via Data Compression}},
  year = {2024},
  eprint = {2402.00861},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.00861},
}
Figure