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.
Hackathon build · fairness in hiring
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.
01 The audit
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
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
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
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 = 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
Share of CV–job pairs whose PASS/FAIL decision changes when only that attribute changes. The dashed line is the 1% tolerance.
Magnitude
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.
| 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.
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.
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.
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
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.
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.
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.
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%.
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.
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.
03 The eraser
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
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.
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
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.
Preparing the model…
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
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
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