Skip to content
elevatedevco

Machine Learning

Bias in data and AI

Learn Bias in data and AI: 34 practice questions and answers with an interactive quiz — from the offline AI Learning app.

Intermediate34 questions34 quiz questions

Questions & Answers

Tap a question to reveal its answer. Written for self-study and interview preparation.

What is data bias in AI?

Data bias in AI occurs when the data used to train a model does not fairly or accurately represent the real world. For example, if a model learns from data collected mostly in one city, it may not work well in other cities. Biased data leads to AI systems that make unfair or inaccurate predictions for certain groups of people.

What does 'training data' mean in machine learning?

Training data is the set of examples an AI model learns from before it is used in the real world. Just like a student studies textbooks to prepare for an exam, an AI studies training data to find patterns. The quality, size, and diversity of training data have a huge impact on how accurately and fairly the model works.

What does 'garbage in, garbage out' mean in AI?

'Garbage in, garbage out' means that if you feed an AI model poor-quality or biased data, its outputs will also be poor-quality or biased. No algorithm, no matter how powerful, can produce reliable results from bad input data. This principle highlights why collecting clean, balanced, and representative data is the first step to building fair AI.

If a face recognition system is trained only on photos of people with light skin, what problem is likely to occur?

The system will perform much worse on people with darker skin tones because it has rarely seen such examples during training. This is a form of representation bias. Real-world studies, such as the MIT Gender Shades project, found that commercial face recognition tools had error rates up to 34 percentage points higher for darker-skinned women compared to lighter-skinned men.

What is an imbalanced dataset?

An imbalanced dataset is one where some categories have many more examples than others. For instance, if a model for detecting a rare disease is trained on 99 healthy patients and only 1 sick patient, it can score 99% accuracy by predicting 'healthy' every time — yet it misses every sick patient. Imbalanced data causes AI to be poor at recognizing underrepresented groups or events.

What is a 'label' in machine learning, and how can biased labeling cause problems?

A label is the correct answer attached to a training example — for example, tagging a photo as 'cat' or 'dog.' Human annotators assign these labels, and if they carry personal biases or make systematic errors, the model learns those biases too. This is called label bias, and it can cause an AI to consistently make unfair decisions even when the underlying data looks reasonable.

Can simply removing columns like 'race' or 'gender' from a dataset always prevent AI bias?

No — removing sensitive attributes does not always prevent bias. Other variables in the data, called proxy variables, can still encode the same information indirectly. For example, a postal code can strongly correlate with race due to historical housing patterns, so a model using postal codes can still produce racially biased results even without a 'race' column.

What is automation bias?

Automation bias is the tendency for people to over-trust and follow the decisions of an automated system, even when the system is wrong. For example, a doctor might accept an AI's incorrect diagnosis without questioning it because the suggestion came from a computer. This is especially dangerous when the AI itself is biased, since the human who should catch the error simply agrees with it instead.

What is the key difference between an AI making a random mistake and an AI being biased?

Random mistakes happen occasionally to any system and affect everyone roughly equally. Bias, on the other hand, creates systematic errors that consistently disadvantage certain groups — for example, a biased model might misclassify job applicants from one ethnic group at a much higher rate than others. Bias is therefore not just an accuracy problem but also a fairness and ethics problem.

Why does having diverse training data matter for building fair AI?

Diverse training data ensures that an AI learns from many different types of people, places, and situations, which helps it work accurately and fairly for everyone. If training data mainly represents one group, the model will be better at handling that group and may fail or behave unfairly for others. Diversity in data is one of the most important steps toward building inclusive AI systems.

What is selection bias in data collection?

Selection bias occurs when the data collected is not a representative sample of the real world — certain groups or situations are more likely to be included than others. For example, if a health AI is trained only on data from wealthy hospitals, it may not work well for patients from rural or low-income areas. Selection bias can make a model appear accurate in testing but fail badly in real-world use.

What is historical bias in AI, and why is it hard to fix?

Historical bias occurs when training data reflects past inequalities or prejudices from society, which the AI then learns and perpetuates. For example, if past hiring records show fewer women in engineering due to historic discrimination, an AI trained on those records may score women's resumes lower — not because women are less qualified, but because the data is unfair. It is hard to fix because the biased pattern is real in the data, even though its underlying cause is injustice.

What is a feedback loop in AI bias, and why can it be dangerous?

A feedback loop occurs when a biased AI makes decisions that change the world, and the new data created by those decisions is then used to retrain the model, making it even more biased over time. For example, if a predictive policing AI sends more officers to low-income neighborhoods, more arrests are recorded there, which makes the model send even more officers — a self-reinforcing cycle of bias.

What is representation bias in AI?

Representation bias happens when a dataset does not include enough examples of certain groups, so the AI learns much less about them. A medical AI trained mostly on data from male patients may not accurately diagnose conditions in female patients, since it was not given enough examples of that group. Ensuring all relevant groups are well represented is a key strategy for reducing this type of bias.

What is measurement bias in AI?

Measurement bias occurs when the tool or method used to collect data consistently produces inaccurate measurements for certain groups. For example, if a fitness tracker's optical heart-rate sensor is less accurate for people with darker skin, any AI trained on that data will have baked-in errors for that demographic. The flaw is not in the model's algorithm but in how the raw data was originally gathered.

What is a proxy variable, and how can it sneak bias into an AI model?

A proxy variable is one that is not itself a sensitive attribute (like race) but is strongly correlated with one. For example, a model might use 'distance from the nearest bus stop' as a feature, which correlates with race due to historical housing patterns. Even if race is never directly included, the model can still produce discriminatory decisions through such proxy features.

What is confirmation bias in AI development?

Confirmation bias in AI development happens when developers unconsciously choose datasets, run experiments, or interpret results in ways that support what they already believe. For example, a developer might only evaluate their model on easy cases where it works well, missing cases where it fails badly. This can lead to deploying systems that appear fair in testing but perform poorly and unfairly for certain groups in real-world use.

What is gender bias in Natural Language Processing (NLP)?

Gender bias in NLP occurs when language models associate certain words or roles with one gender more than another, often reinforcing stereotypes. A famous example is that word embedding models trained on large internet text learned to associate 'doctor' with 'man' and 'nurse' with 'woman.' When these biased models are used in translation, autocomplete, or resume-screening tools, they automatically reproduce those stereotypes at scale.

How can a biased AI hiring tool harm job seekers from certain groups?

A biased hiring AI might score resumes from women, minorities, or people from certain zip codes lower simply because past hires at a company came mostly from other groups. Amazon reportedly scrapped such a tool in 2018 after discovering it systematically downgraded resumes that included the word 'women\'s.' This means qualified candidates never get called for interviews, and the bias is nearly invisible to those harmed by it.

What is the difference between a model being accurate and a model being fair?

A model can be highly accurate overall yet deeply unfair to specific subgroups. For example, a model that predicts loan defaults might be 95% accurate because it works very well for the majority group but makes many wrong predictions for a minority group. High overall accuracy can hide poor performance for underrepresented groups, which is why fairness requires evaluating performance separately across different demographic groups.

How can you use Python to quickly check whether a dataset is imbalanced?

You can use the value_counts() method in pandas to count how many examples belong to each class. If the counts are very unequal, the dataset is imbalanced and may cause the model to perform poorly on the minority class. For example, 950 examples of 'not_fraud' and only 50 of 'fraud' means a model could score 95% accuracy by always predicting 'not_fraud' — which is misleading and useless for catching fraud.

import pandas as pd
df = pd.read_csv("data.csv")
print(df["label"].value_counts())
# Example output:
# not_fraud    950
# fraud         50
# dtype: int64
What is societal bias and how does it end up inside an AI system?

Societal bias refers to prejudices and inequalities that exist in the real world — such as gender pay gaps or racial disparities in the criminal justice system. When AI models are trained on data generated by human society (internet text, historical records, social media posts), they absorb these patterns automatically, even if no programmer intended this. The AI essentially acts as a mirror that reflects — and can amplify — the biases already present in society.

Why does having a diverse team of AI developers help reduce bias in AI systems?

A diverse team brings different lived experiences, cultural perspectives, and awareness of blind spots to the design process. When team members come from varied backgrounds, they are more likely to identify edge cases and groups that a less diverse team might overlook during design and testing. Research shows that diverse teams are significantly better at catching potential harms before a product is released to the public.

What is the 'filter bubble' or 'echo chamber' effect caused by recommendation algorithms?

Recommendation algorithms are trained to show you more of what you already like or believe in order to maximize your engagement. Over time, this creates a 'filter bubble' where you mainly see content that reinforces your existing views, while challenging or diverse perspectives are filtered out. This can amplify biases in public opinion and make it harder for users to encounter a balanced range of viewpoints.

What is the difference between statistical bias and ethical/social bias in AI?

Statistical bias is a technical property: the systematic deviation of a model's predictions from the true values it is trying to estimate, which can sometimes be reduced by collecting more data or choosing a better model. Ethical or social bias refers to unfair treatment of people based on characteristics like race or gender — a moral and societal problem, not just a mathematical one. A model can be statistically unbiased and still be socially harmful, or vice versa; the two concepts overlap but are not the same.

What is disparate impact, and how is it used to measure algorithmic fairness?

Disparate impact occurs when a decision-making system — even one with no discriminatory intent — produces outcomes that disproportionately disadvantage a protected group. It is often measured using the '80% rule': if the approval rate for the disadvantaged group is less than 80% of the rate for the most-favored group, disparate impact is considered to exist. For example, if a loan AI approves 60% of Group A's applications but only 40% of Group B's, 40/60 ≈ 67%, which is below the threshold, indicating disparate impact.

What is a confusion matrix, and how can it reveal hidden bias in a classification model?

A confusion matrix is a table that records true positives, true negatives, false positives, and false negatives for a classifier. Bias is revealed by computing separate confusion matrices for different demographic groups — for example, a face recognition model may have a 1% false positive rate for one racial group but a 35% false positive rate for another. This shows that overall accuracy metrics mask serious disparities, and that fairness requires examining performance broken down by group.

from sklearn.metrics import confusion_matrix
# Compare confusion matrices for two demographic groups
cm_A = confusion_matrix(y_true_A, y_pred_A)
cm_B = confusion_matrix(y_true_B, y_pred_B)
print("Group A:\n", cm_A)
print("Group B:\n", cm_B)
What is data augmentation, and how can it help reduce bias caused by underrepresentation?

Data augmentation means creating modified versions of existing training examples — for example, flipping, rotating, or color-shifting images — to artificially increase the variety and size of a dataset. When certain groups are underrepresented, augmentation can generate more examples of those groups to help balance the dataset. However, augmentation must be done carefully, as poorly designed augmentation can introduce new distortions or artifacts that create different kinds of bias.

What is word embedding bias, and how was it famously demonstrated?

Word embeddings are vector representations of words learned from large text datasets, where words used in similar contexts end up close together in a mathematical space. Researchers found that these embeddings encode human stereotypes: for example, the vector analogy 'man is to doctor as woman is to ___' completed with 'nurse' in models like Word2Vec, because that was the pattern in the training text. This landmark finding by Bolukbasi et al. (2016) triggered a wave of research into detecting and reducing gender and racial biases in language models.

Why is it mathematically impossible to satisfy all common fairness definitions at the same time when a model is imperfect?

Researchers have mathematically proven that several common fairness metrics — including calibration, equal false positive rates, and equal false negative rates — cannot all hold simultaneously unless the model makes perfect predictions or the outcome base rates are identical across groups. This result is sometimes called the 'impossibility theorem of fairness.' It means AI designers must consciously choose which fairness property matters most for their specific use case, knowing that optimizing for one may require compromising another.

What is transfer learning bias and why does it matter?

Transfer learning involves starting with a model pretrained on a large dataset and then fine-tuning it for a new task. However, if the original pretraining data was biased, those biases are embedded in the model's weights and are carried into the fine-tuned version — even if the fine-tuning data is carefully curated. This is dangerous because developers may trust a well-known pretrained model more than its actual fairness warrants, not realizing that hidden bias from the original training has been inherited.

What is the fairness-accuracy trade-off, and why does it challenge AI designers?

The fairness-accuracy trade-off refers to situations where explicitly enforcing fairness constraints — such as equalizing error rates across demographic groups — may require accepting a small reduction in overall accuracy on the majority group. Optimizing purely for accuracy often hides disparities, while enforcing fairness may reduce performance for some users. There is no single universally correct choice; the right balance depends on the stakes, the affected communities, and the specific application.

What is adversarial debiasing, and how does it work?

Adversarial debiasing trains two neural networks simultaneously: a predictor that tries to make accurate task predictions, and an adversary that tries to infer the sensitive attribute (such as race or gender) from the predictor's outputs. The predictor is trained to be accurate while also fooling the adversary, pushing it to make decisions that do not depend on sensitive or proxy features. This approach reduces bias without requiring the sensitive attribute to be removed from training data entirely.

What are the fundamental limits of purely technical debiasing techniques?

Technical debiasing methods — such as resampling data, reweighting training examples, or post-processing predictions — can reduce measurable statistical disparities in a model's outputs. However, they cannot fix the underlying social inequalities that caused the biased data in the first place; for example, debiasing a predictive policing model does not address unjust over-policing policies. They may also create a false sense of security, giving the impression that a system is fair when deeper structural injustices remain unaddressed.

Put it into practice with AI Learning

This topic — and hundreds more — comes from our free, offline AI Learning app. Practice Q&A, quizzes and cheat sheets anywhere, no account needed.

  • Free
  • No account
  • Works offline
Coming soon toGoogle Play