Abstract
Current evaluation methods for Large Language Models (LLMs) are often fragmented, task-specific, and susceptible to data contamination. This research explores a fundamental link between information theory and LLM performance, proposing lossless data compression as a unified, task-agnostic metric. By demonstrating that model pre-training is mathematically equivalent to optimizing for compression length, we show that a model's compression ratio serves as a powerful proxy for its general intelligence and predictive capabilities across diverse natural language processing (NLP) tasks.
Introduction
The rapid proliferation of LLMs has outpaced the development of robust evaluation standards. Researchers currently rely on a battery of benchmarks (e.g., GLUE, MMLU) and metrics (e.g., ROUGE, F1-score) that are often domain-specific and fail to capture a model's fundamental understanding. Furthermore, the "data contamination" crisis—where test data leaks into massive training sets—inflates performance scores that do not reflect true understanding. We argue for a unified evaluation standard that measures a model's core ability to represent and predict information, independent of specific task formatting.
Theoretical Framework: Understanding as Compression
The core of our approach rests on the information-theoretic principle that understanding is equivalent to compression.
Arithmetic Coding and LLMs
We utilize Adaptive Arithmetic Coding, where an LLM serves as the entropy model. The model predicts the probability distribution of the next token, and the arithmetic coder allocates bits accordingly: high-probability tokens receive fewer bits, while rare tokens receive more. This setup bridges the gap between Shannon’s 1948 information theory and modern transformer models.
Mathematical Equivalence
We prove that the standard LLM training objective—minimizing cross-entropy loss—is mathematically equivalent to minimizing the compression length under arithmetic coding. The cumulative negative log probabilities of a sequence represent the theoretical lower bound of its compressed size. This allows for a "zero-overhead" metric: the compression ratio can be calculated directly from the model's predicted probabilities without performing physical compression.
Experimental Methodology
To validate the relationship between compression and performance, we evaluated five open-source models: Mistral 7B, LLaMA 2 7B, OPT-IML 1.3B, GPT-2-XL 1.5B, and GPT-2 774M.
Datasets
- Text8: A large corpus from English Wikipedia used to calculate the base compression ratio for each model.
- Downstream Tasks: Models were evaluated on HellaSwag (common-sense reasoning), BoolQ (reading comprehension), and the Winograd Schema Challenge (coreference resolution) to test generalization.
Results and Analysis
Our experiments reveal a strong positive correlation between a model's ability to compress general text and its accuracy on specific NLP benchmarks.
As shown in Table 1, Mistral 7B achieved the highest compression ratio of 9.266, followed by LLaMA 2 7B at 8.663. This ranking directly mirrors the performance observed in downstream tasks.
Mistral 7B emerged as the top performer on HellaSwag with 81.3% accuracy, consistent with its superior compression capabilities. The results indicate a consistent linear relationship: as the compression ratio increases, so does the model's accuracy across various tasks like question answering and coreference resolution. This suggests that the compression ratio is a robust measure of the efficiency of a model's entire probability distribution, making it more resilient to the "gaming" of specific benchmarks through data contamination.
Conclusion
This study demonstrates that the pre-training phase of an LLM is essentially the process of learning the optimal coding length for human language. A model's compression ratio provides a task-agnostic, contamination-resistant metric for ranking general intelligence. The better the compressor, the better the thinker. Future work will expand this evaluation to a broader range of architectures and larger-scale proprietary models to further refine this unified standard.
Summary updated