How do you measure demographic or stereotyping bias in an LLM using a standardized eval?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Describe two standardized approaches for measuring demographic or stereotyping bias in an LLM. What are the benchmark suites available and how do counterfactual methods work?
Measure bias two ways: counterfactual augmentation swaps a demographic attribute and checks if outputs diverge, and benchmark suites like BBQ and WinoBias score stereotyped versus neutral choices.
Imagine testing whether a hiring manager is fair. You hand them two identical resumes that differ only in the name at the top, one says John and one says Aisha, and you watch whether the decisions change. If the advice or tone differs, the difference itself is the bias, because nothing else changed. That is the counterfactual idea: swap one attribute, hold everything else fixed, and measure the gap. The second way uses ready-made test packs. Someone has already written hundreds of tricky questions where a fair answer is known in advance, like 'the doctor told the nurse that she was late, who was late?' A fair model says we cannot tell from the sentence. A biased model jumps to the stereotype. You just count how often the model picks the stereotype.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 min: counterfactual data augmentation and pair construction, BBQ ambiguous versus unambiguous design, WinoBias coreference, the per group metrics, and why aggregate scores and public benchmarks mislead.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Reporting a single aggregate bias score. Bias must be measured per demographic group and per context condition, because ambiguous and unambiguous cases reveal opposite failure modes.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.