Eval
Aware · M134 · lesson 134 of 149 · queued
Preview — browse every lesson free. Enroll to mark lessons complete, open partner links and save your progress. Login & enroll →
📖
in this lesson

Segment Before Celebrate

15 min

The Aggregate Score Trap

Your model hits 91% accuracy on your evaluation benchmark. The team celebrates. You deploy to production. Within a week, customer complaints roll in from your Spanish-language users, the model is failing on 40% of their queries. How did your evaluation miss this? Because 91% was an aggregate across all languages, and your test set was 85% English. The aggregate score masked a catastrophic failure in a critical user segment. This pattern, celebrating an aggregate number that hides segment-level disasters, is one of the most common and most damaging mistakes in AI evaluation. Segmenting your results before drawing conclusions is not a nice-to-have analysis step. It is the difference between an evaluation that protects your users and one that gives you false confidence while real people suffer poor experiences.

Why Aggregate Metrics Systematically Mislead

Aggregate metrics are not just imprecise. They are systematically biased toward your largest segments. If 80% of your test data represents one user type, that group dominates the overall score. Smaller segments could be failing entirely and barely move the needle. This is Simpson's paradox in action: the overall trend can be the opposite of what is happening in every individual group. A model can improve in aggregate while getting worse for every demographic segment, simply because the mix of segments shifted. Consider a customer service bot evaluated on resolution rate. Overall: 78% resolution. But segmented by issue type: billing questions resolve at 92%, technical troubleshooting at 61%, and account security at 34%. The aggregate 78% would justify deployment. The segmented view reveals that your model is effectively broken for the highest-stakes category: account security. Every aggregate number in your evaluation report should be treated as a hypothesis, not a conclusion, until you have examined the segments beneath it.

How to Choose the Right Segmentation Axes

Not all segmentation is useful. Splitting your results by random categories wastes time. Choose segmentation axes that align with three criteria: user impact, known risk, and distribution shift likelihood. User impact segments reflect how different groups of people experience your system: language, geography, demographic attributes, accessibility needs, expertise level. Known risk segments come from domain knowledge: if you are evaluating a medical model, segment by disease prevalence (common vs. rare conditions), because rare conditions are systematically underrepresented in training data. Distribution shift segments target dimensions where production data likely differs from training data: query length, input complexity, time-of-day patterns, device type. Start with 3-5 segmentation axes maximum. For each, define the segments and ensure your test set has at least 50 examples per segment, fewer than that and your per-segment metrics will have confidence intervals too wide to be actionable. If your test set lacks coverage for critical segments, that is a finding in itself: you cannot evaluate what you cannot measure.

Simpson's Paradox: When Every Segment Tells a Different Story

Simpson's paradox is not a theoretical curiosity. It appears constantly in AI evaluation. A model update improves overall accuracy from 85% to 87%. Celebration seems warranted. But segmented by input length: short queries improved from 90% to 95%, medium queries held steady at 84%, and long queries dropped from 78% to 71%. The aggregate improvement was driven entirely by the growing proportion of short queries in your test set, while the model actually degraded on complex inputs. This paradox arises whenever your segment proportions differ between test sets, model versions, or time periods. To detect it, always report per-segment metrics alongside aggregates. When you see an aggregate improvement, immediately check: did every segment improve, or did the mix shift? Use a fixed-weight aggregate that holds segment proportions constant across comparisons. If your test set is 30% short, 40% medium, and 30% long queries, apply those weights consistently even if the actual proportions in a new test set differ. This weighted aggregate neutralizes mix effects and reveals true performance changes.

A Practical Segmentation Workflow

Here is a concrete workflow you can implement immediately. Step 1: Before running your evaluation, define your segmentation axes and annotate every test case with its segment labels. Do not try to segment after the fact. You will miss cases and introduce bias. Step 2: Run your evaluation and compute the overall metric as you normally would. Step 3: Compute the same metric for each segment independently. Step 4: Calculate the performance gap, the difference between your best-performing and worst-performing segments. If the gap exceeds a threshold you define (a common starting point is 15 percentage points), flag it for investigation. Step 5: Compute segment-weighted aggregates using fixed proportions that reflect your production traffic distribution, not your test set distribution. Step 6: Visualize with a segment performance heatmap: segments as rows, metrics as columns, color-coded by performance level. This heatmap becomes the centerpiece of your evaluation report, replacing the single-number summary. Step 7: For any segment below your minimum quality threshold, document it as a known limitation with a mitigation plan.

Setting Minimum Quality Thresholds Per Segment

An overall accuracy target of 90% says nothing about the experience of your worst-served users. Instead, set minimum quality thresholds at the segment level. Define a floor below which no segment's performance is acceptable, regardless of the overall score. For example: overall target is 90% accuracy, but no language segment may fall below 75%, and no user demographic may fall below 80%. This approach borrows from fairness-aware machine learning, where worst-group performance is often more important than average performance. When evaluating a model update, check two conditions: Does the aggregate improve (or at least not regress)? Does every segment remain above its floor? If the aggregate improves but one segment drops below its floor, the update fails evaluation, period. This forces teams to address segment-level failures rather than papering over them with aggregate gains. Set floors based on the consequences of failure in each segment. A chatbot misunderstanding a casual query is annoying; the same chatbot misunderstanding a crisis-related query is dangerous. The crisis segment needs a higher floor.

Discovering Hidden Segments You Did Not Plan For

Sometimes the most important segments are ones you did not think to define. Error analysis can reveal hidden segmentation patterns. After running your evaluation, cluster the failure cases: do they share characteristics you did not segment on? Maybe your model fails disproportionately on queries that contain negation, or on inputs with mixed-case text, or on questions about events after a certain date. Use automatic error clustering to surface these patterns. Embed your failure cases using the model's own representations, then cluster them. Examine each cluster for shared attributes. A team evaluating a legal document AI discovered that their failures clustered around documents with nested conditional clauses, a structural property they had never segmented on but which explained 60% of their errors. Once you discover a hidden segment, add it to your standard segmentation axes for all future evaluations. Your segmentation framework should grow over time as you learn which dimensions matter for your specific system. The goal is not to segment on every possible axis but to continuously refine your understanding of where your model succeeds and where it struggles.

How to Report Segmented Results Without Overwhelming Your Audience

Segmenting across 5 axes with 4 segments each produces 20 individual metrics, potentially overwhelming for stakeholders. Use a layered reporting approach. The executive summary shows the aggregate metric plus the performance gap (best segment minus worst segment) and names the worst-performing segment. This takes one sentence: 'Overall accuracy is 89%, with a 23-point gap between English (95%) and Vietnamese (72%).' The detailed report shows per-segment metrics for each axis, with segments color-coded as green (above target), yellow (above floor but below target), or red (below floor). The appendix contains full cross-tabulations, confidence intervals, and segment sizes. Tailor depth to your audience. Executives need the gap number and worst segment. Engineers need the full segment breakdown to prioritize improvements. Researchers need the cross-tabulations and statistical tests. Never present only the aggregate. Even when your audience is non-technical, including the worst-segment performance alongside the aggregate takes five extra seconds and prevents the most dangerous misinterpretation of your results.

Tracking Segment Performance Over Time

A single segmented evaluation is valuable. A time series of segmented evaluations is transformative. Track per-segment metrics across every model version, data update, and configuration change. Plot segment-level trends on the same chart to see whether improvements are broad or narrow. Watch for segment divergence, when your best segments improve while your worst segments stagnate or decline. This pattern indicates that model updates are optimizing for the majority at the expense of the tail. In 2025-2026, leading teams maintain segment-level dashboards that update automatically with every evaluation run. These dashboards trigger alerts when any segment crosses below its floor or when the performance gap exceeds a threshold. Build your time series with consistent segment definitions and test sets. If you change your segmentation scheme, back-fill previous evaluations with the new segments so the time series remains continuous. This historical segment data becomes invaluable for understanding long-term trends, predicting where future failures might emerge, and demonstrating to stakeholders that you are monitoring quality with the granularity it deserves.

Try This Now

Take your most recent evaluation result, any aggregate metric you have reported. Choose two segmentation axes relevant to your system. If you evaluate a language model, try segmenting by query length (short/medium/long) and topic category. If you evaluate a vision model, try segmenting by image complexity and lighting conditions. Recompute your metric for each segment. Calculate the performance gap between your best and worst segments. If the gap is less than 5 points, your model may genuinely perform consistently, but verify your segments are meaningful and your per-segment sample sizes are adequate. If the gap exceeds 15 points, you have found a segment-level problem that your aggregate score was hiding. Write one sentence describing the gap and what it means for your users. That sentence is more informative than any aggregate score you have ever reported.

Key Takeaways

Aggregate evaluation metrics are systematically biased toward your largest segments and can hide catastrophic failures in smaller but critical groups. Simpson's paradox means an aggregate improvement can coexist with degradation in every individual segment, always check segment-level trends. Choose segmentation axes based on user impact, known risk, and distribution shift likelihood, with at least 50 test cases per segment. Set minimum quality floors at the segment level, not just aggregate targets, a model update that drops any segment below its floor fails evaluation regardless of aggregate gains. Use error clustering to discover hidden segments your initial framework missed. Report results in layers: aggregate plus gap for executives, per-segment breakdowns for engineers, full cross-tabulations for researchers. Track segment performance over time to detect divergence between your best-served and worst-served users.