Hackathon build · fairness in hiring

Same résumé.
Same skills.
Different city.
Different answer.

We rebuilt an applicant tracking system with MiniLM, ran it over 2,484 résumés and 120 US job posts, then re-scored every CV with only the address changed. Location alone flips 15.3% of decisions. Then we erased the location subspace — in closed form — with LEACE, and shipped both models to the browser so you can take it apart yourself.

Résumés audited
2,484
Counterfactual copies
17,058
Location flip rate
15.3% → 10.4%

01 The audit

Hold everything fixed. Change one thing.

A résumé is a long document. One name, one address, one degree — each is a tiny signal among a thousand words. So we never compared different people. We compared a CV with itself: two gendered names, three addresses, three degree levels, then scored every copy against the jobs in its own field — jobs the person should be able to get.

Two lenses, one test: activational-space bias — what the embedding encodes about who the applicant is — and behavioural bias — what the system decides. The audit measures the decision; the eraser edits the activation.

Attribute 01

Location

Every City, State placeholder filled with one city, plus a matching header. US, UK/Europe and Asia cities, held out from the debiasing fit.

The finding.

Attribute 02

Gender

Two names sharing a surname plus one pronoun, so only the gendered part changes. Ten pairs from mixed ethnic backgrounds.

Small effect — see below.

Attribute 03

Education

Degrees rewritten inside the Education section only, checked against what the job actually requires. A fail below a stated requirement is legitimate, not bias.

Requirement-aware.

Result

Pass rate on own-category jobs

PASS = cosine similarity to the job above the calibrated threshold (0.4357 original · 0.4182 LEACE). Bars are pass rates over 12,420 gender/location pairs and 7,730 requirement-eligible education pairs. ■ Original ■ After LEACE

Stability

Decision flip rate

Share of CV–job pairs whose PASS/FAIL decision changes when only that attribute changes. The dashed line is the 1% tolerance.

Magnitude

Location score gap

Mean cosine gap versus a US address, with 95% confidence intervals, across >12,000 paired comparisons. Negative = penalised.

1,338 CV–job pairs pass with a US address and fail with an Asian one. Only 148 go the other way.
Location audit, original model · 12,420 pairs
Audit summary, original model versus LEACE
Attribute Pass rates Impact ratio Flips Verdict
Location US 63.1UK 55.8Asia 53.5 0.85 15.3% Biased
Gender F 64.5M 64.4 1.00 0.8% No bias
Education Assoc 66.0Bach 66.2Master 66.1 1.00 0.8% No bias

Verdict rule: impact ratio below 0.80 (the EEOC four-fifths rule), flip rate above 1%, or a statistically significant score gap of at least 0.005. 632 education fails below a stated requirement were excluded as legitimate.

Why location leaks

All 120 job posts are US-based. Their text is dense with “Chicago, IL”, state names and US spellings, so a CV that says “Austin, TX, USA” simply overlaps more with the job text. The embedding moves closer. Nothing about the candidate's qualifications changed.

Why gender barely registers

One name and one pronoun among ~1,000 words, averaged over ~6 chunks, is a rounding error in a 384-dimensional vector: a gap of 0.0003, far below the 0.005 practical cutoff. Real names carry more signal than our injected header — a limit, not a clean bill of health.

Why education holds

The encoder reads “Bachelor of Science” and “Master of Science” as near-synonyms, and we only count jobs where the level is not disqualifying. Where a degree really is required, the app says so instead of calling it bias.

02 The pipeline

Scan → Score → Audit → Debias → Ship

A pretrained sentence encoder plays the ATS. No classifier was trained, no labels were invented. Every number on this page comes from the artefacts in the repository.

  1. 01

    Scan

    2,484 résumés · 120 postings

    Kaggle résumés across 24 fields, matched to US LinkedIn postings longer than 500 characters. Five postings per field, fixed seed.

    95.1% of CVs hide their real city behind “City, State” — the gap that makes a counterfactual audit possible.

  2. 02

    Score

    MiniLM-L6 · 384 dimensions

    The model reads 256 tokens, so each CV is cut into 180-word chunks, embedded, then averaged into one 384-number document vector. Score = cosine against the job.

    0.4357 pass mark, calibrated by Youden's J on own-category vs other-category pairs. AUC 0.784.

  3. 03

    Audit

    17,058 counterfactual copies

    Gender ×2, location ×3, education ×3 per CV, scored against the five jobs of its own category. Pass rates, impact ratios, flip rates, paired score gaps with 95% CIs.

    15.3% of location pairs flip. Gender and education stay under 1%.

  4. 04

    Debias

    LEACE · closed form

    9,900 embeddings from 300 CVs × 33 cities with gender alternating. The eraser is solved once, in closed form: a 384×384 matrix plus a bias vector.

    Flips 15.3% → 10.4%; matching AUC 0.784 → 0.780, essentially untouched.

  5. 05

    Ship

    One ONNX graph, two outputs

    MiniLM, mean pooling and the eraser live in one file with biased_emb and fair_emb outputs. This site runs the same weights in your browser.

    ONNX vs PyTorch: max difference 2×10⁻⁷. Both screener thresholds re-calibrated separately.

Encoderall-MiniLM-L6-v26 layers · 22M params
Embedding384-dunit-norm document vector
Chunking180 wordsmean of chunk vectors
Eraser384 × 384one matrix + bias, 590 KB
Runtime hereint8 · WASMonnxruntime-web, no server

03 The eraser

Erase the direction, keep everything else.

LEACE (Belrose et al., 2023) removes a concept from an embedding space with a guarantee: after the transform, no linear classifier can tell the concept apart — while moving each vector as little as possible. For location and gender, that is exactly the signal we do not want a screener to use.

Closed form

W = ΣXX−½ P = projcol(W ΣXZ) r(x) = x − W⁺PW(x − μ) = xA + b

X = 9,900 embeddings. Z = one-hot city (33 values) + gender. Whitening makes the covariance spherical; the projection removes every direction that correlates with the labels. Fitted once, no training loop, no hyper-parameters beyond an eigenvalue cutoff.

9,900 training embeddings
300 CVs × 33 cities
33 city labels, not 3 regions
the first attempt used regions and barely moved
0.85 → 0.92 location impact ratio
four-fifths rule: still short of 1.0
−0.031 → −0.016 Asia vs US score gap
about half the penalty removed

The honest part

LEACE removes the linear component of location. 10.4% flips is better than 15.3% but still five times the 1% target: the rest of the signal is non-linear, exactly the failure Gonen & Goldberg (2019) warned about. Redaction, a location-blind encoder, or fine-tuning with a fairness objective are the next steps — not “solved”.

04 The bias lab

Take a real CV. Move it around the world.

Pick a CV from the audit, choose a job, and watch the same text get a different decision. The sample CVs use embeddings computed offline with this exact pipeline. Paste your own and MiniLM runs locally in your browser — nothing is uploaded.

Sample CVs are instant. Your own text downloads the 23 MB int8 model once.

Awaiting input

Pick a CV and a job, then screen it. Both screeners run side by side: the original MiniLM embeddings and the same embeddings after the LEACE eraser.

Scores are cosine similarities, PASS when above the calibrated threshold. The six twins vary only the name header and the address — never the content. A twin that changes the decision is the definition of bias we use throughout: the same candidate, treated differently for something that isn't a qualification.

05 The data

What's actually inside 2,484 résumés

Before scoring anything we scanned the corpus for protected-attribute cues. Most gendered and geographic signal is masked; the rest is sparse and uneven. That is the reality any audit has to work with.

Education level

Countries mentioned in CVs

Résumés per field

Other cues, counted not audited

    06 Limits & reproduction

    What this build does not prove

    • Three attributes, not nine. Race, age, religion, nationality, disability and others are counted but not audited or erased. The original brief named racism; the measurable, repeatable finding in this data was location.
    • Injected names are a weak probe. A real name carries more signal than a one-line header. Gender's null result should be read as “this probe is too small”, not “this model is gender-blind”.
    • Browser numbers are int8. The demo runs a quantised model: scores differ from the fp32 reference by about ±0.005 (mean −0.004). The before/after comparison is same-model, same-run.
    • US-only jobs, small encoder. All 120 postings are US-based and MiniLM is a 22M-parameter similarity model, not a production ATS. Absolute pass rates will not transfer to another stack.
    • Not a hiring tool. This is an audit harness and a demonstration of erasure; the honest headline is “bias reduced, not eliminated”.

    Reproduce

    # scan, score, audit the original
    python -m src.scan
    python -m src.audit --method biased
    
    # fit the eraser, audit again
    python -m src.audit --method leace
    
    # export both screeners to one ONNX graph
    python -m src.export_onnx
    
    # the Streamlit version of this demo
    streamlit run app.py

    Artefacts: audit_biased_metrics.json · audit_leace_metrics.json · leace.npz

    References

    1. Belrose et al. (2023). LEACE: Perfect linear concept erasure in closed form. arXiv:2306.03819.
    2. Bolukbasi et al. (2016). Man is to Computer Programmer as Woman is to Homemaker? NeurIPS.
    3. Gonen & Goldberg (2019). Lipstick on a Pig: Debiasing Methods Cover up Systematic Gender Biases. NAACL.
    4. Kusner et al. (2017). Counterfactual Fairness. NeurIPS.
    5. Wilson & Caliskan (2024). Gender, Race, and Intersectional Bias in Résumé Screening via Language Model Retrieval. AIES.