Statistical Modes
Fair Forge metrics that perform statistical aggregation accept a pluggablestatistical_mode parameter. The same computation — estimating a rate, measuring distribution divergence, aggregating sub-metrics — can be performed either as a point estimate (Frequentist) or as a full posterior distribution with credible intervals (Bayesian).
Which Metrics Support Statistical Modes
The Four Primitives
StatisticalMode defines four abstract primitives. Every metric composes these to compute its final result — it never contains its own statistical logic.
rate_estimation(successes, trials)
Estimates a proportion from count data.
Used by: Bias (bias rate per attribute), Toxicity (toxicity rate per group), Agentic (success rate p = c/n)
distribution_divergence(observed, reference)
Measures how far an observed distribution is from a reference.
Used by: Toxicity (DR — demographic representation)
aggregate_metrics(metrics, weights)
Combines multiple named sub-metrics into one weighted score.
Used by: Toxicity (DIDT = weighted average of DR, DTO, ASB)
dispersion_metric(values, center)
Measures how spread out a set of values is around their center.
Used by: Toxicity (DTO — toxicity rate dispersion across groups, ASB — sentiment dispersion across groups)
Frequentist Mode
The default mode. Returns a single float for every primitive — no uncertainty, no samples.Usage
When to Use
- Large datasets (100+ samples) where point estimates are reliable
- Production systems where speed matters
- Quick exploratory analysis
Bayesian Mode
Returns full posterior distributions. Every primitive producesmean, ci_low, ci_high, and raw samples (MC draws). The CI width reflects how much uncertainty remains given the observed data.
BayesianMode Parameters
Usage
When to Use
- Small datasets (fewer than 50–100 samples) where point estimates can be misleading
- Auditing and compliance contexts where uncertainty must be communicated
- Research applications requiring rigorous statistical reporting
- Any scenario where a wide CI should trigger a “collect more data” decision
How the CI Width Tells You When to Trust a Result
- Small Sample (n=10)
- Large Sample (n=200)
- Agentic pass@K
With 10 interactions and 3 flagged as biased:
- Frequentist: bias rate = 0.30 (single number, no context)
- Bayesian: bias rate = 0.30 CI = [0.09, 0.57]
Priors in Bayesian Mode
Beta Prior (for rate_estimation)
Used in Bias (bias rate) and Agentic (success rate). The Beta(a, b) prior expresses beliefs before seeing any data.
Dirichlet Prior (for distribution_divergence)
Used in Toxicity (DR — demographic representation). The dirichlet_prior scalar sets concentration across all categories.
Custom Statistical Modes
ImplementStatisticalMode to plug in your own strategy (e.g., Wilson score intervals, KL divergence):
Next Steps
Toxicity Metric
Statistical modes with group profiling (DR, DTO, ASB, DIDT)
Bias Metric
Beta-Binomial posteriors for protected attribute bias rates
Agentic Metric
Credible intervals for pass@K and pass^K