Definition
The group outcome disparity test compares how often each protected group (for example, each gender or age band) receives a favorable outcome, such as an approval or a selection. For every group it computes the favorable-outcome rate, the impact ratio against a reference group, and the rate difference, and it can test whether the gap is statistically significant. Each run produces a table with one row per group plus a handful of headline measurements, such as the lowest impact ratio across groups. You set thresholds on those measurements, and the test passes or fails like any other Openlayer test. You can combine up to 3 protected attributes to test intersections, such as gender and age band together.Taxonomy
- Task types: LLM, tabular classification, tabular regression, text classification.
- Availability: and .
Pipelines backed by BigQuery or Snowflake are not yet supported by the
fairness tests. The test is skipped on them.
Why it matters
- Differences in favorable-outcome rates between groups are the starting point of an adverse-impact analysis for decisions about people, such as hiring, lending, insurance, and claims. The impact ratio and the four-fifths rule are the screening numbers most reviewers ask for first.
- A raw ratio is noisy for small groups. The significance layer and the small-sample guard keep a tiny group that happens to have a 100% rate from becoming the yardstick, and keep a three-row group from failing the test by chance.
- Intersections surface disparities that single attributes hide, such as a group that is disadvantaged only in combination with another attribute.
- On a monitoring schedule, the test catches disparities that appear after a model, prompt, or population change, not only at launch.
- The result names the exact groups behind a failure, so reviewers see the evidence instead of a single number.
The four-fifths flag is an adverse-impact indicator: a screening heuristic
that tells you where to look. It is not a legal determination. A ratio above
or below 0.8 is not, on its own, evidence that a model is or is not
discriminatory.
How it works
The test follows these steps on the rows of each evaluation window:- Drop incomplete rows. Rows with no outcome are excluded first. Among
rows with an outcome, rows with a missing value in any protected attribute
column are excluded. A blank or whitespace-only value counts as missing.
missingAttributeRateis the share of rows with an outcome that were excluded for a missing attribute. - Form groups. Rows are grouped by the distinct values of the protected attribute columns. With several columns, each combination is its own group, and the group is the same whatever order you list the columns in.
- Set small groups aside. A group is sufficient when it has at least
min_group_sizerows and at leastmin_group_shareof the evaluated rows. Insufficient groups are still listed and counted ininsufficientGroupCount, but they are never the reference group, never fail, and are left out of the group extremes and failing counts. - Compute the rate. The rate of a group is its favorable rows divided by its rows.
- Choose the reference group. With
highest(the default) it is the sufficient group with the highest rate. Withnamedit is the group you set inreference_value. - Compare each group to the reference. The impact ratio is the group rate
divided by the reference rate, and the rate difference is the group rate
minus the reference rate. Every sufficient group with an impact ratio below
0.8 gets the four-fifths flag, whatever
impact_ratio_thresholdis. - Test significance. Each group is tested against the reference group, as described in Statistical significance.
- Decide which groups fail. A group fails when its impact ratio is below
impact_ratio_threshold. Whenrequire_significanceis on, it must also be a statistically significant disparity.
F and F, only the displayed spelling appears
in the drill-down. Confidence intervals help you interpret uncertainty but do
not affect pass or fail.
Statistical significance
Thesignificance_test parameter sets the test that compares each group with
the reference group:
Whatever you choose, every run also reports an omnibus chi-square test across
all sufficient groups as
chiSquarePValue.
Comparing many groups at once, especially intersections, makes some false
positives likely. Use p_value_adjustment to correct for it:
none(default) uses the raw p-values.holmapplies the Holm step-down correction, which controls the chance of any false positive.benjamini_hochbergapplies the Benjamini-Hochberg correction, which controls the share of false positives among the groups flagged.
significantDisparityCount when its
adjusted p-value is below alpha and its rate is below the reference rate.
A small p-value says a gap is unlikely to be chance. It does not say whether the
gap is justified.
Intersections
List up to 3 columns inprotected_attribute_columns to test every combination
of their values, for example gender and age_band. Intersections split each
window into many small groups, so a short evaluation window can leave several of
them below min_group_size. Those groups are reported as insufficient rather
than judged. If you want them judged, evaluate a longer window or lower
min_group_size, and consider holm or benjamini_hochberg so the extra
comparisons do not raise false alarms.
A test that exceeds 1,000 groups is skipped, since the attribute combination is
probably high-cardinality. The result stores up to 100 groups, worst first.
Required columns
To compute this metric, your dataset must contain the following columns:- Protected attributes: 1 to 3 columns holding the attribute values, such as
genderorage_band. - Outcome: The column holding the decision or result, such as
approved.
favorable_values are matched as text, so ["1"] matches an integer
column holding 1, and ["true"] matches a boolean column. An integer written
with a decimal point, such as "1.0", matches the same way, and the values 1
and 1.0 in a text attribute column form one group. Rows whose outcome matches
none of the favorable values count as unfavorable.
The test is skipped, not failed, when it cannot be computed. This happens when
a column is missing or empty in the window, when fewer than 2 groups are
sufficient, when
favorable_values matches no rows, when the reference group
has no favorable outcomes, when a named reference group has no rows or falls
below the minimum size or share, when the protected attributes form more than
1,000 groups, and when control_columns have 1,000 or more combinations. The
skip message says which.Parameters
Measurements
Thresholds are set on one of the measurements below.
With
control_columns, each group is also compared with the reference within
every combination of the control columns, such as region, and the comparisons
are pooled with Mantel-Haenszel weights. This shows whether a gap remains when
groups are compared like for like. Combinations where the group or the
reference has no rows are left out. The adjusted impact ratio is a pooled ratio
of favorable rates, so it reads like the impact ratio and the 0.8 convention
applies to it. The adjusted odds ratio is a different quantity that sits
further from 1 for the same gap, so do not read it against 0.8. Which groups
fail is still decided on the unadjusted impact ratio.
Test configuration examples
If you are writing atests.json, here are a few valid configurations for the group outcome disparity test:
Related
- Group score disparity test - Compare a numeric score across protected groups.
- Group performance parity test - Compare error rates and performance metrics across protected groups.
- Group metric parity test - Compare model metrics and column statistics across protected groups.
- Group by column statistic test - Check a simple statistic for each value of a column.
- Bias test - Detect bias in LLM outputs with an LLM-as-a-judge.