Guided project
Bias Meter
Build a meter that measures whether a small language model leans towards "he" or "she" after school sentences, writing the measuring code yourself, and report what it learned from its training text in numbers you can check.
About 1.5 h ·
4 stages · 12 steps
What you'll make
In 15 minutes: A meter that reads a real model's chances of " he" and " she" after your own school sentence, word by word.
What you'll find out about AI: "AI thinks nurses should be women" goes beyond the numbers it was given.
Make it yours: Build three new templates from the parts (add a school opener of your own with the agent if you like), pick new roles and a new baseline, and see which of your findings stay steady.
When you share: My bias meter measures what a small AI learned from its training text.
Step by step
Stage 1
See the meter work (minutes 0-20)
A real model's chances of ' he' and ' she' after your own school sentence, and your first line of code turning them into one number.
- Your sentence on the meter — The meter shows the ' he' and ' she' chances for a template you wrote.
- Swap one word — You saw one swapped word move the chances, and you know where the code reads them.
- Write ratio — Your `ratio` turns two chances into one number, and every row shows ✓.
Stage 2
Make it fair (minutes 20-45)
A baseline, several templates and a verdict, each in your own code: the three habits that make one number a measurement.
- Against a baseline — Every word is compared with the baseline word on the same template.
- Several templates — Each word has a range and a middle over your templates, from your own `summarise`.
- Steady or not — Your `verdict` says whether a word leans the same way against the baseline on every template.
Stage 3
Test it, then break it (minutes 45-70)
Your findings tested two new ways, and a hole in the checks found and closed.
- Change the baseline — You know which of your verdicts survive a different baseline.
- Test it further — The feature you chose is on the page, and you used it on your words.
- Break it on purpose — You know whether the checks catch a verdict from one template, and you added a rule and a check if they didn't.
Stage 4
Report it, and share (minutes 70-90)
An honest bias report, a headline you judged against it, and someone else re-running your meter.
- Judge a headline — Your decision on what your numbers do and don't show, and a finding line in your report.
- Name the limits and save — Your report is saved with its numbers, your finding and its limits.
- Someone else tries it — Someone used your meter without help, and you changed one thing because of what they did.
Guardrails
- You build your templates from the meter's parts (school openers and plain endings, in English: the model only learned English), and the words come from its own list: school roles and everyday jobs. Nothing typed freely goes to the model: no names, no real people, no personal details.
- Gender is more than he and she, and bias is more than pronouns: this meter measures one simple gendered-pronoun signal (the chance of ' he' against ' she'), not bias in general. Your report's finding and limits are your own words: they stay in your own copy and are not shown in a published one.
- Every number is what one small model learned from its training text, never a fact about real people. Report numbers, not verdicts about anyone.
- You write the measuring code; the agent explains and reviews. Ask it to write a line only after you tried, and it will say when it did.
- Nothing is downloaded or installed. The models, distilgpt2 and all-MiniLM-L6-v2, are already in your workspace.