Skip to main content

Definition

The group metric parity test compares one metric across protected groups, such as each gender or age band. You can compare model-quality metrics such as AUC, log loss, MAE, or R², or the mean, median, p95, or rate of a column such as a judge score, latency, cost, refusal flag, or tool-error flag. For every group, the test computes the metric’s value, its direction-aware ratio to a comparison point, and its gap from that point. A ratio below 1 always means that the group is worse, whether higher or lower values are better. You can compare each group with a reference group or with the metric over all rows, and you can combine up to 3 protected attributes to test intersections.

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

  • Aggregate quality can hide a model that performs well overall but has a much higher error or loss for one group.
  • The column metrics extend parity checks beyond model accuracy. For example, you can compare judge scores, latency, cost, refusals, or tool errors to find a quality-of-service gap that affects only one group.
  • The ratio gives you a scale-independent screen, while the gap shows the shortfall in the metric’s own units.
  • The small-group guard and significance options help you distinguish a repeatable disparity from noise in a short evaluation window.
  • On a monitoring schedule, the test catches group-level changes before they are visible in the overall metric.

Metrics by task type

The available metrics depend on the project’s task type: The classification metrics use a ground-truth column and the positive values you select. AUC reads a score column; log loss and Brier score read a predicted probability; NPV and false omission rate read a prediction column. MAE, RMSE, and R² read numeric prediction and ground-truth columns. The mean, median, p95, and rate options can use any suitable top-level column. For rate, you also select the values that count as positive. For all four column metrics, Direction is required and has no default: choose whether a higher or a lower value is better.

How it works

The test follows these steps on the rows of each evaluation window:
  1. Drop incomplete rows. Rows missing an input needed by the selected metric are excluded first. Among rows with the metric inputs, rows with a missing value in any protected attribute column are excluded. A blank or whitespace-only attribute counts as missing. missingAttributeRate is the share of rows with the metric inputs that were excluded for a missing attribute.
  2. Form groups and set small ones aside. Rows are grouped by the distinct values of the protected attribute columns. A group is sufficient when it has at least min_group_size rows and at least min_group_share of the evaluated rows. Insufficient groups are still reported, but they are never the reference group, never fail, and are left out of group extremes and failing counts.
  3. Compute the metric. The selected metric is computed separately for every group and over all evaluated rows.
  4. Choose the comparison point. With reference, each group is compared with the best sufficient group, or with the group you select when using a named reference. With overall, each group is compared with the metric over all evaluated rows. AUC and R² support reference only because their values over all rows are not averages of the groups’ values.
  5. Orient the ratio and gap. When higher is better, the ratio is the group value divided by the comparison value. When lower is better, it is the comparison value divided by the group value. For pass or fail, the gap is measured only on the worse side of the comparison point.
  6. Test significance. With significance_test set to auto, the test uses the statistical test appropriate for the selected metric. You can adjust p-values when comparing many groups and optionally require significance for a group to fail.
  7. Decide which groups fail. A group must be worse than the comparison point. It fails when its ratio is below min_ratio or its gap is greater than max_difference. When require_significance is on, the disparity must also be statistically significant.
Your thresholds are then evaluated against the headline measurements. The test result’s Analysis tab has three sections. Group breakdown shows a summary strip and a Key insights card with facts from the run. Bar graph view charts each group with its confidence interval. Table view lists every group’s numbers and has a Download CSV button. Selecting a group opens records in the Data tab using exact matches on the displayed attribute values and non-empty filters on the measured columns. If the analysis combines equivalent spellings, such as 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. The AI summary also covers the groups and comparison settings from the run.

Statistical significance

auto tests the quantity that the selected metric measures:
  • Fisher’s exact test for rate, npv, and false_omission_rate.
  • Welch’s t-test for mean, mae, log_loss, and brier, and on squared errors for rmse.
  • A pooled-quantile test for median and p95.
  • A Hanley-McNeil z-test for auc.
  • No significance test for r2.
Set significance_test to none when you want the ratio and gap alone to determine the result. Use p_value_adjustment to choose none, holm, or benjamini_hochberg. Verdicts use the adjusted p-value. require_significance is not available for R² because R² has no significance test.

Intersections and small groups

List up to 3 columns in protected_attribute_columns to test every combination of their values, such as gender and age_band. Intersections create more comparisons and can leave groups below min_group_size or min_group_share. Those groups remain visible but are marked insufficient instead of failing. When you test intersections, consider holm or benjamini_hochberg so the extra comparisons do not raise false alarms. A test that exceeds 1,000 groups is skipped, and the result stores up to 100 groups, worst first.

Required columns

Every configuration needs 1 to 3 protected attribute columns. The other required columns depend on parity_metric: Column parameters must refer to top-level columns. Fields nested inside a dict or JSON column are not available, so promote them to their own column first. Values in positive_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.
The test is skipped, not failed, when it cannot be computed. This happens when a required column is missing, empty, or not numeric where a number is required; when a selected positive class does not occur where the metric requires one; when fewer than 2 groups are sufficient; when the metric is undefined for every sufficient group; and when the protected attributes form more than 1,000 groups. The skip message says which.
A ratio needs a positive comparison point. If a worse group has an undefined ratio and Max allowed gap is not set, the test skips and tells you to set max_difference. This commonly matters for lower-is-better rates when the reference value is 0.

Parameters

Measurements

Thresholds are set on one of the measurements below.

Test configuration examples

If you are writing a tests.json, here are a few valid configurations for the group metric parity test: