Skip to content
Query Feedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  1. Home /
  2. AI Glossaries /
  3. Machine Learning /
  4. What is Data Leakage in Machine Learning?
Machine Learning

What is Data Leakage in Machine Learning?

Updated October 2, 2026 Read 4 min

Data leakage is when information that would not be available at prediction time finds its way into training, producing models that score brilliantly in testing and fail in production.

Contents 12
  1. 01Key takeaways
  2. 02Data leakage explained in simple terms
  3. 03The main types
  4. 04A worked example
  5. 05Warning signs
  6. 06Prevention by type
  7. 07Leakage in LLM evaluation
  8. 08A practical checklist
  9. 09Limitations
  10. 10Common Use Cases
  11. 11Frequently Asked Questions
  12. 12Related Terms

Data leakage is when information that would not be available at prediction time finds its way into model training or evaluation. The result is a model that scores brilliantly in testing and fails in production. It is one of the most common and most expensive mistakes in applied machine learning, and it is dangerous precisely because the symptom, excellent validation performance, looks like success.

Key takeaways

  • The test: would this information genuinely be available at the moment of prediction?
  • Main types: target leakage, train-test contamination, temporal leakage, group leakage and preprocessing leakage.
  • The classic warning sign is performance that seems too good.
  • Prevention is structural: correct splits and pipelines, not vigilance alone.
  • Leakage also affects LLM evaluation, where it is called benchmark contamination.

Data leakage explained in simple terms

A student finds the exam answers while revising. They score 98% and everyone concludes they understand the subject. In the next exam, with different questions, they fail. The high score was never a measure of knowledge; it measured access to answers. Leakage gives models that same unearned advantage.

The main types

TypeWhat happensExample
Target leakageA feature encodes the answer or follows from it“Account closed date” when predicting churn
Train-test contaminationThe same or near-identical rows appear in both splitsDuplicated records, augmented copies split apart
Temporal leakageTraining uses data from after the prediction pointRandom splits on time-series data
Group leakageRows from the same entity appear on both sidesOne patient’s scans in both training and test
Preprocessing leakageStatistics computed over all data before splittingFitting a scaler or imputer on the full dataset
Feature selection leakageFeatures chosen using the whole datasetCorrelation screening before splitting
Tuning leakageRepeated tuning against the test setTreating the test set as a validation set

A worked example

A team builds a model to predict which customers will cancel next month. Validation accuracy reaches 97%, far above the business’s expectations.

Investigation shows one feature is `support_tickets_last_7_days`, computed at the time the dataset was exported, which is after cancellation for churned customers. Cancelling customers raise tickets just before leaving, so the feature effectively encodes the outcome. At real prediction time, that window has not happened yet.

Rebuilt with features computed strictly as of the prediction date, accuracy falls to 79%. That lower number is the real one, and it is still useful. The first model would have failed silently in production.

Warning signs

  • Accuracy far above what domain experts consider plausible.
  • One feature dominating importance scores inexplicably.
  • A sharp drop when the model is deployed or tested on newer data.
  • Near-perfect scores on a problem known to be hard.
  • Performance degrading when a single feature is removed.

Prevention by type

TypePrevention
Target leakageFor each feature, ask when the value becomes known; drop anything post-outcome
ContaminationDeduplicate before splitting, including near-duplicates
TemporalSplit by time; train on the past, test on the future
GroupUse group-aware splits in cross-validation
PreprocessingFit all transformations inside the training fold only, using pipelines
Feature selectionPerform selection inside the cross-validation loop
TuningKeep a test set untouched until the end

Leakage in LLM evaluation

The same problem appears as benchmark contamination: if evaluation questions appeared in pretraining data, scores overstate ability. Teams address it by decontaminating training corpora, using held-out or newly created benchmarks, and testing on private evaluation sets. A model that scores far better on public benchmarks than on your own fresh test questions may be benefiting from contamination.

A practical checklist

  1. List every feature and when its value becomes known in reality.
  2. Deduplicate before splitting.
  3. Split by time for time-dependent problems, by group where entities repeat.
  4. Put all preprocessing inside a pipeline fitted on training data only.
  5. Reserve the test set and use it once.
  6. Have someone else review the feature list, since leakage is easier to spot from outside.
  7. Compare offline results with early production results and investigate large gaps.

Limitations

  • Subtle leakage can survive careful review.
  • Domain knowledge is needed to judge what is knowable when.
  • Some leakage is only visible after deployment.
  • Fixing it usually lowers reported accuracy, which can be politically awkward.

Common Use Cases

01

Model validation

Verify that reported performance is trustworthy.

02

Churn and risk models

Check features for post-outcome information.

03

Forecasting

Enforce chronological splits to avoid future leakage.

04

Medical modelling

Keep patient groups together across splits.

05

Pipeline design

Fit preprocessing inside training folds only.

06

LLM evaluation

Detect and avoid benchmark contamination.

Frequently Asked Questions

When information unavailable at prediction time reaches training or evaluation, inflating performance estimates.

A feature that encodes or follows from the outcome, such as a cancellation date when predicting cancellation.

Be suspicious of implausibly high scores, dominant features, and large drops between offline and production performance.

Because the scores are measuring access to answers, not predictive ability, and the model will fail in production.

Leakage in LLM evaluation, where benchmark questions appeared in training data, inflating scores.

Related Terms

  • Cross-Validation
  • Training Dataset
  • Test Dataset
  • Validation Dataset
  • Feature Engineering
  • AI Benchmarking

Related AI Terms

What is Hyperparameter Tuning?Hyperparameter tuning is the process of systematically searching for the configuration values that make a model perform best…What is L2 Regularization?L2 regularization adds a penalty equal to the sum of the squared weights, shrinking all weights smoothly towards…What is L1 Regularization?L1 regularization, known as lasso in linear models, adds a penalty equal to the sum of the absolute…What is Cross-Validation in Machine Learning?Cross-validation is a technique that repeatedly splits data into training and validation parts, rotating which part is held…What is Stochastic Gradient Descent (SGD)?Stochastic gradient descent (SGD) updates a model's weights using one example or a small batch at a time…What is the Bias-Variance Tradeoff?The bias-variance tradeoff describes how a model's error splits into bias from overly simple assumptions and variance from…

Contents

  1. 01Key takeaways
  2. 02Data leakage explained in simple terms
  3. 03The main types
  4. 04A worked example
  5. 05Warning signs
  6. 06Prevention by type
  7. 07Leakage in LLM evaluation
  8. 08A practical checklist
  9. 09Limitations
  10. 10Common Use Cases
  11. 11Frequently Asked Questions
  12. 12Related Terms

AI Topic

  • Machine Learning

Related Terms

  • What is Hyperparameter Tuning?
  • What is L2 Regularization?
  • What is L1 Regularization?
  • What is Cross-Validation in Machine Learning?
  • What is Stochastic Gradient Descent (SGD)?
  • What is the Bias-Variance Tradeoff?

Quick Navigation

  • Common Use Cases
  • Frequently Asked Questions
  • Related Terms
  • Back to top

Details

Updated
October 2, 2026
Read
4 min
  • Forum
  • Submit a tool
  • Submit Guest Post
  • List Your Startup
  • Privacy Policy
  • Editorial Policy
  • Account
  • Contact
  • AI Productivity
  • AI Video
  • AI Coding
  • AI Chatbots
  • Sales
  • AI Business
  • View All Tools

Subscribe our Newsletter

Get weekly exclusive content - No spam.

Copyright © 2026 -  Query Feedz

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}