Compression Represents Intelligence Linearly

Yuzhen Huang, Jinghan Zhang, Zifei Shan, Junxian He

TL;DR

This paper provides compelling empirical evidence for the long-standing hypothesis that intelligence is fundamentally linked to compression. The authors demonstrate a remarkably strong, near-linear correlation between the performance of large language models (LLMs) on various downstream intelligence benchmarks and their ability to compress external text corpora. This suggests that compression efficiency could serve as a reliable, unsupervised metric for evaluating LLM intelligence.

What Problem Does This Paper Address?

The idea that intelligence and compression are deeply intertwined has been a recurring theme in AI research, with some theories even positing their equivalence. Large Language Models (LLMs), through their success in language modeling, have implicitly shown strong compression capabilities. However, despite this theoretical connection and the practical success of LLMs, there has been a lack of direct empirical evidence demonstrating this relationship. This paper aims to bridge this gap by systematically investigating whether an LLM's ability to compress data is a reliable indicator of its "intelligence," as measured by performance on diverse downstream tasks.

Methods

The core methodology involves treating LLMs as data compressors and evaluating their compression efficiency using "bits per character" (BPC). This metric quantifies how effectively an LLM can encode text data. To measure "intelligence," the authors use the average scores across a suite of 12 diverse downstream benchmarks, covering knowledge and commonsense, coding, and mathematical reasoning. They then analyze the correlation between these two measures.

Key aspects of their approach include:

  • Offline Compression: LLMs are used in an "offline" setting, meaning they are pretrained on general data and then applied to compress new, unseen corpora.
  • Context Window Unification: To ensure fair comparison, a consistent context window size of 1900 tokens is used for both compression and benchmark evaluations, mitigating potential advantages of longer context windows in compression.
  • Sliding Window for Compression: A sliding window approach is employed for compression to capture more contextual information and reduce initial metric spikes.
  • MIN-K% PROB for Overfitting Detection: To address potential benchmark overfitting, the MIN-K% PROB method is used to identify models that might have been exposed to benchmark data during pretraining.

Datasets

The study utilizes a variety of datasets for both compression and evaluation:

Compression Corpora:

  • Knowledge and Commonsense: Common Crawl dump (September 21st - October 5th, 2023).
  • Coding: Python code from popular GitHub repositories, filtered using the CodeParrot pipeline.
  • Mathematical Reasoning: LaTeX source files from ArXiv papers with a "math" tag.

Evaluation Benchmarks:

  • Knowledge and Commonsense: NaturalQuestions (NQ), TriviaQA, ARC-Challenge (ARC-C), HellaSwag, and MMLU.
  • Coding: HumanEval, MBPP, and DS-1000.
  • Mathematical Reasoning: GSM8K, MATH, SAT-Math, and MMLU-Math.

The paper emphasizes that the compression corpora are designed to be recent and to avoid direct overlap with the models' pretraining data to prevent data leakage.

Key Insights and Ideas

  • Intelligence is Compression: The most striking finding is the near-linear correlation between LLM intelligence (as measured by benchmark scores) and their compression efficiency. This provides strong empirical support for the theoretical link between these two concepts.
  • Compression as a Universal Metric: The linear correlation holds across a diverse set of 31 LLMs with varying sizes, architectures, tokenizers, and pretraining data. This suggests that compression efficiency is a general principle, not specific to certain model families.
  • Unsupervised Evaluation Potential: Compression efficiency offers a promising unsupervised metric for evaluating LLMs. It is flexible, can be easily updated to avoid data contamination, and is less susceptible to benchmark overfitting issues.
  • Domain Alignment Matters: The strength of the compression-intelligence correlation is significantly higher when the compression corpus is aligned with the domain of the intelligence being tested (e.g., using code for coding benchmarks).
  • Overfitting is Detectable and Impactful: The MIN-K% PROB method successfully identified potential overfitting in some models, particularly on math benchmarks, leading to outliers in the correlation plots. This highlights the importance of robust evaluation methods.

Key Results

The paper reports remarkably strong negative Pearson correlation coefficients (indicating that as compression efficiency increases (BPC decreases), intelligence increases) across various domains:

  • Overall Intelligence vs. Compression: Pearson correlation coefficient of -0.93 with an RMSE of 3.1%.
  • Knowledge and Commonsense: Average Pearson correlation of -0.935. Individual benchmarks show correlations as high as -0.951 (TriviaQA).
  • Coding: Average Pearson correlation of -0.937. Individual benchmarks show correlations as high as -0.946 (DS-1000).
  • Mathematical Reasoning: Average Pearson correlation of -0.953. Individual benchmarks show correlations as high as -0.953 (GSM8K).

The study also found that a compression corpus size of around 3 million characters is sufficient to achieve stable correlation results.

Limitations and Future Work

The authors acknowledge several limitations and suggest future research directions:

  • Focus on Base Models: The study primarily focuses on base LLMs, as fine-tuned models may not be general-purpose compressors. Future work could explore the relationships for fine-tuned models.
  • Short- to Medium-Context Regimes: The current evaluation is limited to shorter context windows. Investigating long-context scenarios for both compression and intelligence is a key area for future research.
  • Well-Trained Models: The findings are based on well-trained models. It's unclear if these correlations hold for models where abilities have not yet emerged.
  • Compression Corpus Selection: While the current approach uses simple heuristics for corpus selection, future work could focus on automatically identifying the most appropriate compression corpora for specific benchmarks.
  • Cross-Ability Tasks: The study mainly examines single-ability tasks. Exploring tasks that require multiple abilities (e.g., programming for reasoning) and their correlation with mixed-domain compression is an open question.

Summary updated

BibTeX
@inproceedings{huang2024compression,
  author = {Yuzhen Huang and Jinghan Zhang and Zifei Shan and Junxian He},
  title = {{Compression Represents Intelligence Linearly}},
  booktitle = {COLM},
  year = {2024},
  url = {https://openreview.net/forum?id=SHMj84U5SH},
}
Figure