AI Glossary / Governance, ethics and safety / Intermediate
Sampling bias
Definition
Sampling bias is systematic distortion arising when the process used to collect a sample gives an unrepresentative view of the population or task of interest. In AI, it can affect training data, evaluation data, and conclusions about users. It differs from the ordinary random variation that occurs even in a well-designed sample.
What it means
Imagine evaluating a voice assistant using only recordings from employees in a quiet office, then claiming the result applies to customers using it outdoors. The collection process has favored particular conditions. Adding many more quiet-office recordings may make the estimate more precise for those conditions while leaving the broader conclusion misleading.
Google's machine-learning glossary treats sampling bias within the broader category of selection bias. The practical focus here is on who or what has a chance to enter the sample and how the collection mechanism affects the intended inference. A sample is never representative in the abstract; it is representative for a defined purpose.
How it works
Specify the target population, unit of observation, time period, and quantity you want to estimate. Examine the sampling frame, which is the set of units that can actually be selected. Then inspect how selection happens: random selection, convenience recruitment, quotas, voluntary participation, or another procedure.
Compare the collected data with the target on relevant characteristics and investigate why important units are absent or overrepresented. A probability design can support appropriate inference when its selection probabilities and other assumptions are handled correctly. Weighting may help with known differences, but it cannot manufacture information about missing conditions or automatically correct every unmeasured selection mechanism.
Three practical examples
- A transcription benchmark draws all speakers from one office even though the intended service covers many speaking environments.
- A demand model is trained on transactions from stores with complete digital records, excluding locations whose recording systems differ.
- A customer survey is distributed only through a mobile app, leaving customers who use other channels outside the collection frame.
Think of it this way
Think of tasting soup only from the surface when ingredients are unevenly distributed. A larger number of surface spoonfuls may still miss what is below. The analogy has limits: people and records cannot simply be stirred into a uniform population, and meaningful sampling designs must account for real access, consent, clustering, and response behavior.
Worked example
Suppose a fictional service has 600 desktop users and 400 mobile users. In a simplified example, satisfaction is 90% among desktop users and 60% among mobile users. The population satisfaction rate is 0.6 times 90% plus 0.4 times 60%, or 78%.
A convenience sample instead contains 90 desktop and 10 mobile users. If it reproduces the same within-group rates, its unweighted satisfaction estimate is 0.9 times 90% plus 0.1 times 60%, or 87%. The 9-percentage-point difference comes from the group mixture in this construction. Reweighting to the known 60:40 population split recovers 78%, but only under the assumption that sampled users adequately represent their groups. Hidden differences in who responds within each group could leave bias after weighting.
Illustrative case study
At fictional Harbor Learning, a team tests an AI tutor using volunteers from an advanced course. They initially describe the results as evidence for all beginning learners. A review identifies the mismatch between the recruitment pool and the intended audience.
The team redesigns its evaluation to include relevant learner backgrounds and access conditions, while documenting participation and missing responses. It reports which conclusions remain supported by the original sample. The case illustrates correcting the scope of an inference; it does not claim that demographic balancing alone establishes educational effectiveness or removes every source of bias.
Common misconceptions and mistakes
A large sample is not automatically an unbiased sample. Randomly splitting an already biased dataset into training and test portions also preserves much of the original selection problem. Good performance on that test set may therefore be a poor guide to deployment.
Conversely, intentionally oversampling a small subgroup is not automatically a mistake. It can improve subgroup measurement when the design and any population-level weighting are handled appropriately. The problem is the mismatch between the selection process and the inference, not merely unequal group counts. Sampling bias should also be distinguished from incorrect labels and from bias in an estimator under a specified statistical model.
Business use
Understanding sampling helps businesses judge whether pilot results support expansion. Before accepting an evaluation, ask who could enter the sample, who actually entered, what conditions were excluded, and how conclusions depend on the design. Budgeting for representative collection or targeted missing cases may be more valuable than simply purchasing a larger version of the same convenient dataset.
People also ask
Does random sampling guarantee perfect representation?
No. Random variation remains, and frame coverage or nonresponse can still create problems.
Can weighting fix sampling bias?
Sometimes it addresses known selection differences under assumptions, but missing information and unmeasured mechanisms may remain.
Is a balanced dataset always representative?
No. Balance can serve a training or evaluation purpose without matching the actual population proportions.
Check your understanding
A company collects ten times as many responses through the same app-only survey. Has it necessarily solved the exclusion of non-app customers?
Answer: No. The larger sample still uses the same coverage mechanism. More observations from the accessible group do not provide observations from the excluded group.
Related terms
- Selection bias
- Coverage bias
- Stratified sampling
- External validity
- nonresponse bias
- target population
- sampling frame
Learn next
Draw the path from a target population to a dataset. At each stage, write who can be excluded and why. Then identify which differences can be measured, which might be addressed by design or weighting, and which require narrowing the claims made from the data.
More in Governance, ethics and safety
- Robust AI - Robust AI is AI designed and evaluated to keep functioning acceptably when inputs, operating conditions, or other relevant circumstances vary.
- Robustness - Robustness is the ability of a model or system to maintain acceptable behavior when specified conditions change or disturbances occur.
- Safety - Safety is the condition and practice of preventing unacceptable harm from a system's operation, failures, or interactions with its surroundings.
- Scalability - Scalability is a system's ability to handle growth in workload while meeting defined performance, quality, and resource requirements.
- Security - Security is the protection of systems and information against unauthorized access, use, alteration, disruption, or other harmful interference.
- Selection And Sampling Bias - Selection And Sampling Bias is the combined label used in the Artificial Intelligence Ontology for distortion introduced by a selection process that fails...
Sources
Sources: Google Machine Learning Glossary, sampling bias and selection bias: https://developers.google.com/machine-learning/glossary#selection-bias . NIST SP 1270, Towards a Standard for Identifying and Managing Bias in Artificial Intelligence: https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=934464 . Artificial Intelligence Ontology, Selection And Sampling Bias: https://raw.githubusercontent.com/berkeleybop/artificial-intelligence-ontology/main/aio.owl .
Previous: Sampling Next: Sampling design