Files
hips/HIPs/hip-0220-bias-detection-mitigation.md
zeekay ad5a010f79 Three words for what a proposal is, and a generator that refuses
The same fact lived in nine hand-kept places and they disagreed about 58
proposals. This makes the file the only authority and everything else a
projection of it.

ONE VOCABULARY, in vocabulary.json, read by the lint, the generator and the
doc site. Three words, each answering "can I rely on this?" and nothing else:

    Draft    nothing implements it yet, or its own text says the work is ahead
    Final    the thing it specifies exists in the code
    Living   governance and process: amended in place, never finished

Eight spellings folded in. `Active` was the one doing real damage: on four Meta
and Process HIPs it meant living, on 48 others it meant shipped, and one word
doing two jobs is why nothing agreed. `Review` and `Last Call` described a
queue rather than a document, and a proposal under review is still one you
cannot build against.

STATUS IS EARNED, not declared. Every Standards Track proposal was checked
against the estate: 235 have their implementation, and eight do not and say so.
HIP-0095 carries a twelve-week plan ending at "mainnet launch" and has no code.
HIP-0525 specifies an all-machine meeting while apps/meet refuses a machine a
seat. HIP-0078 names a prover at a "planned location" that does not exist.
HIP-0114 is the cog.* procedure set, and that procedure set returns nothing.
HIP-0003, HIP-0102, HIP-0305 and HIP-0901 likewise: looked, found nothing.

SIXTEEN TOMBSTONES DELETED rather than statused. A dead document kept alive in
the index is one concept wearing two names. Each successor exists and carries
the text, and the 90 references that pointed at a tombstone now point at it --
whole markdown links at once, so link text cannot outlive its target. Three of
the sixteen were pure compatibility: HIP-0028 specified a migration off a
Bitnami chart, HIP-0029 dual-engine MySQL, HIP-0030 a schema-deprecation
policy. We ship no backwards compatibility, so we do not specify it.

Nine links were already broken and had been since the corpus was renumbered:
short-form ./hip-5.md paths that never existed. Two named the wrong proposal --
one cited "HIP-1: Hanzo Multimodal Models" where multimodal is HIP-0003.

THE GENERATOR REFUSES more often than it writes, because a short table looks
exactly as authoritative as a complete one. Rows must equal files; a shrinking
index must say by how much; a section whose input is missing is an error, not
an omission; nothing is written until all of it validates. Its self-test breaks
the corpus eleven ways and requires each to refuse AND leave README byte-
identical -- a guard that reports after half-writing has protected nothing.
The lint's second implementation of the same comparison is gone.

The site rendered 52 proposals with a fallback grey badge and counted them
toward none of its three stat tiles, because docs/lib/source.ts declared a
status union by hand: it admitted a `Stagnant` no file has ever carried and
omitted the one 52 files did. Five components each kept their own copy of the
colours. All six now read vocabulary.json.
2026-08-28 18:05:41 -07:00

9.4 KiB
Raw Permalink Blame History

hip, title, tags, description, author, discussions-to, status, type, created, requires
hip title tags description author discussions-to status type created requires
220 Bias Detection & Mitigation
ai-ethics
fairness
bias
evaluation
Framework for detecting, measuring, and mitigating bias in AI systems. Hanzo AI Team (@hanzoai) https://github.com/hanzoai/hips/discussions Living Meta 2025-12-17 HIP-0200, HIP-0201

HIP-0220: Bias Detection & Mitigation

Abstract

This HIP establishes the framework for detecting, measuring, and mitigating bias in Hanzo AI systems. It defines bias categories, evaluation methodologies, fairness metrics, and remediation processes to ensure AI systems treat all users equitably.

Bias Framework

Definitions

Algorithmic bias: Systematic and repeatable errors in a computer system that create unfair outcomes for certain groups.

Fairness: The principle that AI systems should treat individuals and groups equitably, without discrimination based on protected characteristics.

Protected Characteristics

Category Characteristics
Demographic Race, ethnicity, nationality, religion
Personal Age, gender, sexual orientation, disability
Socioeconomic Income, education, occupation
Geographic Region, urban/rural, language

Bias Types

Pre-existing Bias

Type Source Example
Historical Past discrimination in data Hiring data reflecting past discrimination
Representation Underrepresentation in data Fewer examples of certain groups
Measurement How data is collected Sensors less accurate for certain skin tones

Technical Bias

Type Source Example
Aggregation One-size-fits-all models Medical model trained primarily on one population
Learning Algorithm amplification Feedback loops reinforcing initial bias
Evaluation Biased benchmarks Test sets not representative

Emergent Bias

Type Source Example
Deployment Context mismatch Model used in unintended population
Interaction User behavior patterns Different usage across groups
Temporal Changing contexts Society changes, model doesn't

Bias Detection

Detection Methods

Quantitative Analysis

Method Application Tools
Demographic parity Equal prediction rates Statistical analysis
Equalized odds Equal TPR/FPR across groups Fairlearn
Calibration Consistent probability meaning Reliability diagrams
Individual fairness Similar treatment for similar individuals Distance metrics

Qualitative Analysis

Method Application Approach
Output auditing Review generated content Human evaluation
Prompt testing Test with demographic markers Structured prompts
User studies Perception of fairness Surveys, interviews

Evaluation Datasets

Standard Benchmarks

Benchmark Bias Type Metrics
WinoBias Gender Accuracy parity
StereoSet Stereotype Language model score
CrowS-Pairs Multiple Preference score
BBQ Social bias Accuracy in ambiguous contexts

Custom Evaluation Sets

Dataset Coverage Size
Hanzo-Bias-1K Multi-category bias probes 1,000+
Regional-Fairness Geographic/cultural bias 500+
Intersectional-Set Intersecting identities 300+

Audit Process

Pre-Deployment Audit

1. Define evaluation scope (groups, use cases)
    ↓
2. Select appropriate metrics
    ↓
3. Run quantitative evaluation
    ↓
4. Conduct qualitative review
    ↓
5. Document findings
    ↓
6. Determine if thresholds met

Ongoing Monitoring

Activity Frequency Scope
Automated metrics Weekly Key fairness metrics
Sample audits Monthly Human review sample
Full audit Quarterly Comprehensive evaluation

Fairness Metrics

Group Fairness Metrics

Demographic Parity

Definition: Prediction rates equal across groups

Formula:

P(Ŷ=1|A=a) = P(Ŷ=1|A=b) for all groups a, b

Threshold: <10% difference across groups

Equalized Odds

Definition: Equal true positive and false positive rates across groups

Formulas:

P(Ŷ=1|Y=1,A=a) = P(Ŷ=1|Y=1,A=b)  (Equal TPR)
P(Ŷ=1|Y=0,A=a) = P(Ŷ=1|Y=0,A=b)  (Equal FPR)

Threshold: <15% difference in TPR, <10% difference in FPR

Predictive Parity

Definition: Equal precision across groups

Formula:

P(Y=1|Ŷ=1,A=a) = P(Y=1|Ŷ=1,A=b)

Threshold: <10% difference across groups

Individual Fairness Metrics

Consistency

Definition: Similar individuals receive similar treatment

Formula:

|f(x) - f(x')| ≤ d(x, x') for similar x, x'

Language Model Metrics

Stereotype Score

Definition: Tendency to associate groups with stereotypes

Measurement: Compare likelihood of stereotypical vs. anti-stereotypical completions

Target: Score ≈ 50% (no preference)

Representation Metrics

Metric Definition Target
Mention parity Equal mention rates Within 20%
Sentiment parity Equal sentiment No significant difference
Association Co-occurrence patterns No stereotypical clustering

Intersectional Analysis

Analyze bias at intersection of multiple characteristics:

Intersection Analysis
Gender × Race Check for compounded bias
Age × Disability Assess unique patterns
Region × Language Cultural intersections

Mitigation Strategies

Pre-Training Mitigations

Strategy Application
Data balancing Ensure representative training data
Data augmentation Add underrepresented examples
Data filtering Remove biased content
Source diversification Include diverse data sources

Training Mitigations

Strategy Application
Debiasing techniques RLHF, constitutional AI
Regularization Fairness constraints in loss
Adversarial training Train against bias detectors
Multi-task learning Include fairness objectives

Post-Training Mitigations

Strategy Application
Output filtering Flag biased outputs
Calibration Adjust outputs for fairness
Prompt engineering Include fairness instructions
Human review Manual review of sensitive outputs

Deployment Mitigations

Strategy Application
Use case restrictions Limit high-risk applications
User warnings Inform users of limitations
Feedback loops Collect bias reports
A/B testing Test mitigation effectiveness

Implementation

Bias Review Process

New Model Review

1. Complete bias assessment questionnaire
    ↓
2. Run standard benchmark suite
    ↓
3. Conduct demographic analysis
    ↓
4. Document known limitations
    ↓
5. Implement mitigations
    ↓
6. Verify mitigation effectiveness
    ↓
7. Obtain fairness sign-off

Periodic Review

Activity Frequency Owner
Metric monitoring Weekly MRM Team
Benchmark re-run Monthly Safety Team
Full audit Quarterly External + Internal
Process review Annual ESG Committee

Documentation Requirements

Fairness Card

Section Contents
Groups evaluated Demographic breakdown
Metrics used Fairness metrics applied
Results Metric values by group
Known limitations Identified bias patterns
Mitigations applied Steps taken to address

Threshold Standards

Model Risk Tier Demographic Parity Equalized Odds
Critical <5% difference <10% difference
High <10% difference <15% difference
Medium <15% difference <20% difference
Low <20% difference <25% difference

Governance

Fairness Oversight

Body Role
Fairness Lead Day-to-day oversight
Safety Team Evaluation execution
ESG Committee Policy and escalations
External Board Independent review

Escalation Process

Trigger Escalation
Threshold violation Fairness Lead → MRM Lead
User complaint Support → Fairness Lead
External report Communications → ESG Committee
Regulatory inquiry Legal → Board

Continuous Improvement

  • Track bias metrics over model versions
  • Research new evaluation methods
  • Engage with fairness research community
  • Update thresholds based on capabilities
  • HIP-200: Responsible AI Principles
  • HIP-201: Model Risk Management
  • HIP-210: Safety Evaluation Framework
  • HIP-230: AI Transparency & Explainability
  • HIP-240: AI Incident Response

Changelog

Version Date Changes
1.0 2025-12-17 Initial draft

Copyright and related rights waived via CC0.