In 2023, a high-profile audit revealed that a commercial recidivism risk assessment model misclassified Black individuals as high-risk at exactly twice the rate of white individuals, despite identical criminal profiles. The algorithm was technically accurate in terms of global precision. The problem ran deeper: in the data shaped by human history before anyone wrote the first line of code.
This isn’t an example from the distant past, nor is it a problem exclusive to large models. Every company deploying an LLM, RAG, or AI agent today operates on data with a history. That history leaves traces.
Where algorithmic bias in AI systems comes from
#Bias has several independent sources that can act together or separately.
Historical data. The model learns correlations that existed in the past. If, for decades, candidates from one demographic group were selected for a position, the model will treat features of that group as success signals—not because it’s racist, but because it optimizes a goal defined by history.
Sample selection bias. Data collected for convenience or availability doesn’t represent the population the system will operate on. A model trained on patient records from large academic hospitals may perform poorly in regional clinics, where demographic profiles and access to specialists differ.
Labeling and interpretation bias. Labels in training datasets are created by humans. If the person labeling the data systematically favors a certain type of response, that preference enters the model as a truth signal.
Representation bias in embedding spaces. Language models and embedding models (like BGE-M3) learn from text corpora that reflect underrepresentation of specific languages, dialects, or social groups. Result: semantic similarity calculated by the model can be asymmetric for underrepresented groups in the training data.
Bias in RAG knowledge bases. A RAG system is only as good as the database it indexes. If the database contains only documents from one period, one author, or one perspective, the answers will reflect that narrowness—even with correct retrieval.
Two types of harm: measurable and unmeasurable
#Before diving into detection methods, it’s worth distinguishing what we’re looking for.
Measurable bias manifests as metric discrepancies between groups. A classifier with 90% precision for group A and 72% for group B is measurably biased. Tools like Fairlearn (Python), fairmodels (R), or built-in metrics in Amazon SageMaker Clarify allow quantifying this discrepancy numerically.
Unmeasurable bias is harder to pin down. It affects the choice of questions: what we measure, whose needs define a “correct” answer, which scenarios we deemed edge cases and omitted in testing. This type of bias requires diverse teams that, at the design stage, ask questions a homogeneous team wouldn’t.
Both types demand active work. They don’t disappear with the deployment of a new base model.
How to measure bias in practice
#Below is the audit framework we apply before production deployment:
| Stage | What we measure | Tools / methods |
|---|---|---|
| Data analysis | Demographic distribution of the sample, data gaps per group | descriptive statistics, correlation heatmaps |
| Model evaluation | Precision, recall, F1 per subgroup | Fairlearn, per-segment metrics |
| Sensitivity analysis | Whether the result changes after removing protected attributes | counterfactual fairness, SHAP values |
| Synthetic data testing | Whether the model treats identical profiles differently when one feature changes | paired tests |
| Embedding audit | Whether group representations are symmetrically distributed in vector space | WEAT (Word Embedding Association Test), semantic analogies |
| Production monitoring | Whether metric discrepancies grow over time | decision logs, per-segment dashboard |
Global model accuracy is an insufficient indicator. A model can have 94% overall accuracy while systematically harming 15% of users.
Mitigation measures: before, in, and after the model
#Interventions work at different levels. There’s no single method that addresses all sources of bias.
Before the model: data. Diversifying training datasets is a necessary starting point—but insufficient. A larger dataset with the same historical inequalities only amplifies those inequalities with greater statistical certainty. Diversification must be intentional: which groups are underrepresented, which scenarios are missing, whether labels were assigned consistently.
For RAG bases: review thematic coverage, document dates, author range, and perspectives. A knowledge base not updated since 2021 doesn’t account for 30 months of legal and technological changes. See the article RAG knowledge updates.
In the model: fairness-aware design. Regular classifier testing on datasets with controlled demographic distribution. Cross-validation with diverse validation sets. In prompt-based systems: system tests checking whether changing one feature (name, gender) alters the response in an unjustified way.
Guardrails can block responses directly based on protected attributes. But guardrails operate at the output level—they don’t remove bias from the inference layer. They’re a safety net, not a fundamental solution.
After the model: oversight and logs. Every high-risk system decision should be logged with sufficient context for verification. This isn’t about storing personal data—it’s about an audit trail: what response the system issued, based on which inputs, in which model version. Without this, you can’t prove bias didn’t occur, and in case of an incident, you can’t locate it.
Human oversight on irreversible decisions isn’t bureaucracy. It’s the only correction mechanism when bias slips through all previous safeguards. See the human-handoff pattern in the glossary.
AI Act and bias: what became law in 2026
#The AI Act rolls out gradually, but key obligations for high-risk systems are already in force in 2026. High-risk categories where bias is directly regulated include:
- recruitment and employee evaluation
- creditworthiness and insurance risk assessment
- education and service access decisions
- justice and recidivism risk assessment
- biometric systems
For these systems, the AI Act requires technical documentation, mandatory DPIA, a decision log with timestamps and model versions, decision explainability mechanisms, and the right to challenge decisions affecting individuals.
Detailed obligations are described in the article AI Act high-risk systems.
Notably: even systems outside the high-risk category are subject to general transparency principles. If a system evaluates people or their behavior, the obligation to explain that evaluation exists regardless of risk classification.
Bias in RAG systems: rarely discussed specifics
#The classic discussion on algorithmic bias focuses on classification models. In 2026, most business deployments are RAG systems, where the model generates answers based on retrieved documents. Here, the bias mechanism differs.
Retrieval bias. The retrieval system decides which documents are “most relevant.” If vector similarity is asymmetric for certain groups or topics (because embedding training data was unbalanced), some perspectives will be systematically retrieved less often—even if they’re present in the database.
Source hierarchy bias. A system prioritizing sources (e.g., internal documents over external ones) may favor the organization’s perspective when questions touch on controversial or legally disputed areas.
Amplification effect through generation. The generative model can amplify bias retrieved from documents, adding linguistic certainty to uncertain claims. A “usually” qualifier in a source document may become an unqualified statement in the response.
Mitigation: regular calibration query tests checking whether the system responds symmetrically to comparable group queries. Retrieval logs showing which documents were fetched for each response. See AI agent quality monitoring.
Transparency and its limits
#Algorithmic transparency is a necessary condition for bias control—but not sufficient. We know systems that publish dataset documentation and fairness audit results yet still systematically harm certain groups because the fairness metrics they chose don’t measure what truly matters in their context.
Transparency is valuable when it’s complete: disclosing not just test results, but also which tests were conducted and which were omitted. Documentation describing a model under test conditions—but not informing about production data distribution or model drift over time—is selective transparency.
For companies deploying third-party models: ask for the training dataset documentation, bias audit methodology, subgroup results, and procedures for reporting and fixing identified issues. If the documentation doesn’t exist or doesn’t answer these questions, deploying in a high-risk area is unjustified.
Tools for self-assessment: AI readiness assessment and agent blueprint.
Try it live
#Provide a description of a decision-making system (e.g., application classifier, credit scoring, HR recommendation system) and receive a list of bias risk areas and specific audit control questions (environment: playground, PII masked, zero retention):
FAQ
#Does algorithmic bias always stem from bad data?
#No. Data is one source, but bias can also result from the choice of optimization goal (what the model should maximize), the definition of a “correct” answer set by designers, omitting certain scenarios in testing, or which populations were deemed reference groups during design. Poor-quality data worsens the problem, but good-quality data doesn’t guarantee the absence of systemic bias.
How does the AI Act treat algorithmic bias?
#For high-risk systems, the AI Act imposes obligations to document and monitor system operations for direct and indirect discrimination. It requires pre-deployment testing, decision logging, decision explanation mechanisms for affected individuals, and correction procedures when bias is detected. Obligations apply to both the system creator and the deploying entity. Details in the article AI Act and RODO in 2026.
Are guardrails sufficient to control bias?
#No. Guardrails operate at the model output level and can block certain categories of harmful responses. They don’t remove bias from the inference layer, embedding representations, or the RAG knowledge base. Guardrails are an important part of layered defense but don’t replace data audits, subgroup testing, or human oversight on high-risk decisions.
How often should a production system’s bias audit be conducted?
#At least once a year, and additionally with every significant change: new model version, new data in the knowledge base, changes in user profile or system decision scope. High-risk systems under the AI Act require continuous monitoring and documented review cycles. A useful pattern is regularly sampling system decisions and verifying them through human review before error distribution escalates.
Does a smaller company need to worry about algorithmic bias?
#Yes, if the system makes or supports decisions about people—regardless of scale. The scale of operations changes the scope of harm, not its nature. A model classifying 50 applications monthly and systematically harming one demographic group does so with the same regularity as a system handling 50,000. The AI Act doesn’t tie obligations to company size, but to the risk category of the application.