esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

Data Bias vs Model Bias

Where bias comes from in a machine learning system: the data the model learns from, or the model's own limits, with a worked example for your AI interview.

In short

Data bias is when the examples a model learns from do not match the real world, through skipped, old or one-sided records. Model bias is systematic error from a model too simple to capture the pattern, so it misses in the same direction even on its own training data.

13 min readBeginnerCommon · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Data bias is when the examples a model learns from don't match the real world: old, skipped or one-sided records. Model bias is error from a model too simple to capture the pattern, so it's wrong even on its own training data. I tell them apart by checking where the errors show up. High error everywhere points to the model. Fine overall but bad on one group or route points to the data. The fixes are different, so I diagnose first.

What are data bias and model bias, in plain words?

Bias here means a lean: the model gets things wrong in the same direction again and again, as a steady tilt. The word has several meanings in machine learning, and teams mix them up. This page uses two of them and keeps them apart.

Data bias means the examples the model learns from don't match the real world. Model bias means the model itself is too simple for the pattern, so it misses even when the data is good.

Think of a triage nurse who has only ever worked in one city clinic. Her idea of a normal patient comes from that clinic alone. That skew is like data bias. A nurse who judges every patient by one rough rule, however many patients she has seen, has model bias. The first problem is in what she has seen. The second is in how she thinks.

A courier model trained only on logs of short trips is the same problem. It has never seen a long route, so the data is the first place to look.

Key words

Training data
The examples a model learns from.
Systematic error
A mistake that leans the same way every time, not random noise.
Underfitting
A model too simple to fit the real pattern.
Sampling
The way examples get picked into the data.

What is data bias, and where does it come from?

Data bias starts before any model is trained. Google's machine learning glossary has an entry for bias in ethics and fairness. One form in that entry is a systematic error introduced by a sampling or reporting procedure.

  • “Systematic error introduced by a sampling or reporting procedure.”

    Google Machine Learning Glossary

  • “Machine learning (ML) models are not inherently objective.”

    Google fairness course

  • Sampling

    Who gets picked

    Examples are chosen without proper randomisation, or a survey leaves a group out. The model then only knows the people it was shown.

  • Coverage

    Cases left out

    Data is not selected in a representative fashion, so whole kinds of cases never appear.

  • Historical

    The past, copied

    Old records reflect the inequities of their time, such as past lending rules. The model learns to repeat them.

  • Reporting

    What gets written down

    For example, unusual events get logged more than ordinary ones, so the data over-represents the extremes.

How data bias creeps in

Real world: every route

short and long trips, all seasons

Collection

Long routes skipped

far jobs rarely get logged

Old records kept

last decade's rules still stored

Training data

what the model learns from

Model

learns the skewed picture

Wrong on unseen cases

biggest misses where data is thin

  1. 1Long, hard trips are left out of the logs.
  2. 2Old records are kept, with their old rules.
  3. 3Only what was logged reaches the training data.
  4. 4The old rules shape what the model learns.
  5. 5The model learns the skewed picture from that data.
  6. 6On cases it never saw, it guesses and misses most.
Real trips reach the model only after collection drops some of them. The model learns from what is left, so its biggest misses fall on cases that were never logged.

Data bias is often a coverage problem. A model only learns from the cases the data holds, so the cases the data never holds are where it guesses. Google's fairness course says that human involvement in curating the data can make a model's predictions susceptible to bias.

What is model bias, and how is it different?

Model bias, in the statistical sense, is error that comes from the model's own shape. A model that is too simple cannot follow a real pattern, however clean the data. Google's glossary defines the result as underfitting. scikit-learn's underfitting example makes the same point with a straight line, which is not sufficient to fit the training samples. In scikit-learn's bias-variance split, bias is the average gap between the model's predictions and those of the best possible estimator.

  • “Producing a model with poor predictive ability because the model hasn't fully captured the complexity of the training data.”

    Google Machine Learning Glossary

Causes include training on the wrong set of features (the input columns the model sees, such as route length), or a regularisation rate (a penalty that stops a model from fitting too wildly) set too high. Set too strong, that penalty leaves the model too simple. The glossary also uses bias for a line's y-intercept. That is a different thing, so the intercept in the code later on is not the model bias discussed here.

  • Data bias

    Wrong picture of the world

    The model learns a skewed picture, so it fits the data it has and fails where the data is thin.

  • Model bias

    Too simple a shape

    The model cannot bend to fit the pattern, so it misses even the data it learned from.

Model bias: the shape is too simple

Real trip times

rise faster on long routes

Straight-line model

cannot bend with the curve

What shows

Wrong on logged routes

even on the data it learned from

Misses the curve's shape

too low at the ends, too high midway

Try a shape that can bend

for example a km x km column

Test on new routes

measure before you trust the fix

  1. 1The straight line is fitted to curved trip times.
  2. 2Its errors show up on routes it trained on.
  3. 3Its errors also follow the curve's shape.
  4. 4Errors on logged routes point at the model's shape.
  5. 5A shape misfit calls for a richer model or features.
  6. 6The fix is tested on routes it has not seen.
A straight line is fitted to a curved pattern. It misses even the routes it learned from, so the error comes from the model's shape, and more data would not fix it.

Model bias is one half of the bias-variance trade-off. The other half, variance, is covered on its own Interview Kit page, so here I only need the bias side. Favouritism toward groups of people, the fairness sense from the same glossary entry, is covered on its own Interview Kit page.

How do you tell them apart in a real project?

Look at where the error shows up. High error everywhere, including on the training data, points to the model. Fine overall but bad on one slice of cases, or bad only once the model is live, points to the data. Good training error does not clear the data, though: a model can learn biased past labels perfectly, so check those labels against fresh outcomes for each group.

Tip

Split the errors by group, region or route length before you change anything. One overall score hides both problems.

Here is the courier model in a few lines of plain Python. The true trip time bends upward on long routes. The same straight-line model is trained twice, once on all routes and once on short routes only.

Python
# A made-up city courier predicts delivery minutes from route length.
# Real trips slow down faster on longer routes, so the true curve bends.
def true_minutes(km):
    return 10 + 1.0 * km + 0.02 * km * km

def fit_line(xs, ys):
    # Least-squares straight line, returned as (intercept, slope).
    n = len(xs)
    mx, my = sum(xs) / n, sum(ys) / n
    slope = sum((x - mx) * (y - my) for x, y in zip(xs, ys)) / sum((x - mx) ** 2 for x in xs)
    return my - slope * mx, slope

def predict(line, km):
    return line[0] + line[1] * km

all_routes = list(range(5, 51, 5))                  # logged routes, 5 to 50 km
short_only = [km for km in all_routes if km <= 20]  # logs that miss the longer routes

for name, routes in [("All routes logged", all_routes), ("Only short routes logged", short_only)]:
    line = fit_line(routes, [true_minutes(km) for km in routes])
    for km in (5, 20, 50):
        print(f"{name}, {km} km: predicted {predict(line, km):.0f} min, true {true_minutes(km):.0f} min")

Output

All routes logged, 5 km: predicted 10 min, true 16 min
All routes logged, 20 km: predicted 41 min, true 38 min
All routes logged, 50 km: predicted 104 min, true 110 min
Only short routes logged, 5 km: predicted 15 min, true 16 min
Only short routes logged, 20 km: predicted 38 min, true 38 min
Only short routes logged, 50 km: predicted 82 min, true 110 min

Read the output. With all routes logged, the line is off even on routes it trained on: 10 minutes predicted for 16 true at 5 km. That is model bias. With only short routes logged, the 50 km prediction misses by 28 minutes. That is data bias: the model never saw long trips, and the error lands exactly where the data is missing.

The fixes differ. For model bias, give the model a shape that can bend, such as a squared term (a route length squared column that lets the line bend), or better features. For data bias, collect the missing cases. Google's mitigation guide says the same thing in its own words: once a bias is found in the training data, steps are taken to reduce its effects. Adding more trips of the lengths already logged would not help here.

How would you check a loan model for both?

A bank's loan model rejects far more applicants from one region than its risk team expects. Before anyone blames the model, you split its errors by region and by the year each past loan was written.

  1. 1

    Check how much data each group has

    Count the past loans from that region. If the count is thin, suspect data bias first.

  2. 2

    Check the error on the training data

    If the model is also wrong on past loans from every region, its shape is too simple. That is model bias.

  3. 3

    Check the labels for history

    Old decisions made under past lending rules can teach the model to repeat them. That is historical bias, and a count will not show it.

  4. 4

    Score each group on its own

    Google's fairness course says that evaluating model performance by subgroup ensures fairness and equal performance across different characteristics. Re-test on fresh data after every change.

What does the interviewer want to hear?

A strong answer covers

  • A plain split: data bias is the examples, model bias is the model's own shape.
  • Examples of data bias: sampling, coverage, historical and reporting bias.
  • Model bias means underfitting: wrong even on the training data.
  • Diagnosis by error on training data and by slice, before any change.
  • The fairness meaning, and that the word bias has several senses.
  • The fixes differ: a richer model or features, or the missing data.

Common traps

  • Trap"Bias is always the data, so cleaning the data fixes it."

    BetterCleaning only helps if the data is the problem. If the model is wrong on its training data, its shape is too simple.

  • Trap"A bigger model removes the bias."

    BetterA more flexible shape can fix model bias. No model can learn cases that were never logged, so check which bias you see first.

  • Trap"Model bias and data bias are the same thing."

    BetterOne is the examples, the other is the model's shape. The fixes differ, so name which one you see.

Can you spot the cause?

Spot the cause

A fraud model scores well overall, but it misses more fraud in one region, where few past cases were ever logged. What is the most likely cause?

Quick check

A straight line predicts trip time badly even on the routes it trained on. Which fix is most likely to help?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q412Bias vs variance?12 min
  2. Q413Overfitting vs underfitting?10 min
  3. Q422Train/validation/test splits?11 min
  4. Q424What is data leakage?11 min
  5. Q425How do you handle class imbalance?12 min
  6. Q457How do you measure fairness?13 min

Last updated on 27 November 2026

Building a model that makes decisions about people?

I design and build AI products and agents, the interface and the system behind it. Book a short call and tell me what your model decides and who it affects.