LLM Benchmark Leakage: Can Public Leaderboard Scores Still Be Trusted?
A newly released foundation model was found to reproduce most questions and answers from a public code benchmark, with a 96% leakage rate. Its score fell from a perfect 100 to 3.66 after memorized questions were removed. This article explains how public test sets can enter training data, distinguishes mild task-pattern contamination from parameterized memorization, and offers practical guidance for developers to build private, dynamic, and adversarial evaluations that reflect real model capability.
Introduction: A Case of “Open-Book Exam”
In a recent evaluation of the code capabilities of a newly released foundation model, we observed a striking phenomenon. We input question 66 from a well-known code benchmark. The model not only produced the correct answer but also, without any follow-up instruction, automatically “recited” the statements, example code, and official reference answers for questions 67 through 70. More surprisingly, it even copied a typo that the original author had made.
We tested the full 164-question evaluation set. The model was able to reproduce the complete content and answers for 158 questions from memory, a leakage rate of 96%. In a standard standardized evaluation, the model received a perfect score of 100 on code capability. However, after we removed the questions that had been “recited,” its true code-generation score dropped sharply to 3.66. This was not problem solving; it was pure memorization of the test set.
This phenomenon is not an isolated case. It reflects a serious problem in the large-model industry: Are high scores the result of generalization ability to solve real problems, or simply because the model has “seen the exam” during training?
1. How LLMs Are Trained and Why Data Contamination Happens
To understand why benchmark scores can be misleading, it is necessary to understand how a large model “goes to school.” From birth to becoming a usable assistant, a large model typically goes through three stages:
- Pre-training: This is like reading through a vast library. Developers feed the model massive amounts of web pages, books, and open-source code to produce a base model. At this stage, the model is knowledgeable but not good at following instructions.
- Post-training: This is like onboarding training. Through supervised fine-tuning (SFT) and reinforcement learning from human feedback (RLHF), the model is taught to follow human instructions, write code for specific functions, or operate specific tools, turning it into a chat assistant or agent.
- Benchmark evaluation: The industry usually uses a public standardized exam to score models. The various score tables presented at launch events come from this process.
The root of the problem is that the exam is public. Because pre-training and post-training require absorbing massive amounts of internet corpus, the original data from public evaluation sets can easily mix into training materials when data cleaning is not thorough. Once the original questions and answers are “eaten” by the model during training, evaluation no longer serves its purpose of testing capability.
2. Levels of Test-Set Leakage and Typical Symptoms
In deep technical practice, we found that “data mixing” also has different levels of severity and different symptoms:
- Mild contamination (task-pattern generalization): During training, the model has seen many code problems of similar types and has become familiar with the evaluation set’s patterns and naming conventions. This is similar to a student who has thoroughly practiced past exam questions. The student has not memorized the original questions, but has grasped the patterns. In this case, the model’s score may be somewhat inflated, but it can still reflect some logical reasoning ability.
- Severe contamination (parameterized memorization): The model directly read the full statements and reference answers of the evaluation set during training and even memorized them into the neural network’s weight parameters. The phenomenon described above—copying even a typo—is a typical example. In this state, the model does not generate code through algorithmic logic; it retrieves its own memory and reproduces it. Once a question is slightly modified or removed from its original benchmark, the model’s capability immediately fails.
It is worth noting that some models in the industry can still maintain high accuracy after all potentially memorized questions are removed. This proves that strong code evaluation results can also be achieved without relying on “memorizing questions,” through genuine data structures and algorithmic reasoning ability.
3. A Developer’s Guide to Avoiding Leaderboard Traps and Building Trustworthy Evaluations
For enterprise developers and architects, blindly trusting public benchmark scores for model selection can easily bring data-contaminated models into production environments, leading to business logic errors or reduced development efficiency. To avoid this trap, we need to build a scientific, isolated internal evaluation system:
1. Build dynamic and private evaluation baselines
Enterprises should avoid relying solely on public static test sets. The most effective approach is to build private evaluation sets based on real business scenarios. This data should cover internal business logic, proprietary API calls, code completion for specific technology stacks, and similar tasks, and should never be made public. At the same time, private evaluation sets need to be updated and rotated regularly to prevent the model from overfitting within the same batch of tests.
2. Introduce adversarial testing and instruction perturbation
To address data leakage, you can verify a model’s true capability by applying “isomorphic substitutions” to public test sets. For example, modify the natural-language description of a question, replace variable names, or add distracting information and irrelevant context to the prompt. If the model performs well on the original question but its performance drops sharply on a paraphrased version, data contamination is highly suspected.
3. Focus on process evaluation and intermediate reasoning steps
Current benchmark scores often only check whether the final output passes unit tests. However, a strong model should have chain-of-thought capability. During evaluation, developers should require the model to output detailed reasoning steps and comments and assess their logical consistency. A model that relies on memorized answers often cannot explain the design logic behind its code, while a model with genuine capability can provide a reasonable decomposition approach when facing complex, unknown problems.
4. Multi-dimensional robustness testing
In addition to static benchmarks, introduce automated evaluation frameworks to run generation tests across multiple rounds and multiple temperature parameters. Under the same input, observe the variance of the model’s output. A model that relies excessively on memory is highly likely to output completely different and incorrect answers when facing minor prompt changes, showing low robustness.
Conclusion
Test-set leakage in large models is an inevitable byproduct of the industry’s rapid growth in data volume. A 96% leakage rate is not only a warning for one model but also a challenge to the entire AI industry’s evaluation system. For developers and enterprises, the only correct way to identify a model’s true capability is to look beyond public leaderboards and build an objective, dynamic internal evaluation system that fits real business scenarios. Returning to the essence of capability and rejecting “exam-memorizing” AI is how artificial intelligence can truly create value in business deployments.
