TL;DR
This paper challenges the prevailing linear relationship between code compression (measured by bits-per-character, BPC) and code intelligence in Large Language Models (LLMs). By introducing a novel evaluation framework and a comprehensive benchmark, the authors reveal a fundamental logarithmic relationship, suggesting previous linear observations were likely artifacts of limited data or specific model regimes.
What Problem Does This Paper Address?
The field of AI has increasingly viewed LLMs as powerful compressors, and this compression capability has been linked to general intelligence. Prior research suggested a linear relationship between compression (quantified by BPC) and intelligence, particularly in natural language. However, code, with its formal syntax and unique structures, presents a distinct challenge. Existing benchmarks and evaluation methods for code intelligence are often limited (e.g., Python-only, focused on completion) and can be influenced by model-specific training artifacts. This paper aims to bridge this gap by rigorously investigating the compression-intelligence relationship specifically for code LLMs, using a more comprehensive and fair evaluation approach.
Methods
The authors introduce two key methodological innovations:
- Format Annealing: A lightweight training technique designed to improve the format compliance of LLM outputs. This is crucial because models often produce "empty strings" or malformed code, hindering accurate evaluation. Format Annealing helps ensure that models are evaluated on their intrinsic code understanding and generation capabilities, rather than their ability to adhere to specific output formats.
- OmniCodeBench: A comprehensive, multi-lingual, and multi-task benchmark for evaluating code intelligence. It goes beyond simple code completion to include tasks like code generation, explanation, reasoning, and repair, across various programming languages.
- Sliding Window BPC: To account for varying context window lengths of different LLMs, they propose a sliding window approach for calculating BPC, ensuring a more consistent and fair comparison.
Datasets
- Proprietary Corpus: A high-quality, internal dataset curated for validation.
- Public Corpus: An open-source validation set derived from GitHub, filtered by timestamps to avoid leakage from existing LLM training data.
- Training Data for Format Annealing: A curated dataset integrating CommitPackFT, CodeSearchNet, and LeetCode, specifically designed to improve format compliance.
Key Insights and Ideas
- Logarithmic, Not Linear: The most significant finding is that code intelligence exhibits a logarithmic relationship with BPC, not a linear one as previously hypothesized. This suggests that as models become more compressed (lower BPC), their intelligence gains diminish logarithmically, rather than linearly.
- Linearity as an Artifact: The authors posit that previous observations of linearity were likely due to analyzing models in the "tail" of the logarithmic curve, where it can approximate linearity, or due to limitations in evaluation methodologies.
- Code is Different: The study reinforces that code's unique characteristics necessitate specialized evaluation, distinct from natural language.
- Format Matters: The effectiveness of "Format Annealing" highlights how output formatting issues can obscure true model capabilities, underscoring the need for robust evaluation techniques.
- Multitask & Multilingual Evaluation is Crucial: Analyzing performance across various tasks and languages reveals that models perform unevenly, making a holistic benchmark like OmniCodeBench essential for a fair assessment.
Key Results
- The study found a strong logarithmic correlation between code intelligence and BPC across multiple benchmarks and models, with Pearson coefficients generally above -0.8 and RMSEs around 9% for the overall metric.
- Figures 3 and 4 show clear logarithmic trends for the overall code intelligence metric on both open-source and closed-source validation sets.
- Format Annealing significantly reduced the occurrence of empty string outputs in models, improving the reliability of evaluation (e.g., reducing empty strings from 136 to 1 for StarCoder2-3B).
- Task-specific analyses (Figure 5) show varying degrees of correlation, with code generation and explanation exhibiting stronger logarithmic relationships than code fix, which has higher variance.
Limitations and Future Work
- Benchmark Limitations: While OmniCodeBench is comprehensive, the paper notes that some individual benchmarks (e.g., McEval) can still exhibit issues like generating lengthy invalid continuations or being disproportionately influenced by specific language performance (e.g., C++).
- BPC as a Proxy: While BPC is a valuable metric, it's acknowledged that it's a proxy and not a direct measure of all aspects of code intelligence. The current fitting accuracy might not be sufficient for precise BPC-based intelligence calculation yet.
- Future Work: The authors suggest their approach can enable more precise modeling of the compression-intelligence relationship, facilitate rapid performance estimation for smaller models, and aid in predictive scaling for larger models. They also highlight the potential for BPC to serve as a simpler, more maintainable standard for code intelligence estimation compared to constantly updating benchmarks.
Summary updated