Skip to content
Eval Suites50

Slice-based testing for LLMs with a flat overall score

Sources checked 2 min read · By the Eval Suites editors

In brief

Slice-based testing applies the same pass rule to named groups of cases. Compare candidate and baseline on the same case IDs, then look at changes inside groups that carry different user risks. A flat overall score can hide a failure that warrants holding the release.

Define slices from inputs reviewers can tag

A slice is a group of cases selected by a rule you can write, such as every request that asks about a holiday exception. Define a few groups before seeing candidate results and record how each case qualifies. The Slice Finder research describes a different workflow that searches for groups with unexpectedly poor model performance. Treat a newly discovered group as a hypothesis and check it on held-out cases before using it as a release gate.[1]

Start with a capability that matters to users. The CheckList paper pairs capabilities such as negation and temporal reasoning with test types, including label-preserving changes. For a library assistant, give a reviewer enough information to tag holiday exceptions from the question and its reference. The tag should survive changes to how the assistant phrased its answer.[2]

  • Name the membership rule and store the matching case IDs. A case may be in both the mobile and holiday-exception slices.
  • Choose one pass rule for both runs. In this example a response passes only if its instructions include the correct pickup place and any exception that applies.
  • Record missing tags separately. Keep cases with unknown slice membership in the overall count when they still have scorable answers.

Work through the Juniper Library release

This illustrative fixture has 20 cases. J01 through J16 are routine holds. J17 through J20 all ask about a holiday exception. The baseline fails J02, J05 and J11. The candidate fixes J02 and J05, still fails J11, and introduces failures on J18 and J20. Every ID outside each failure list passes.

Paired Juniper Library results with fixed case membership
SliceBaseline passesCandidate passesChange
All holds17 / 20 (85%)17 / 20 (85%)0 percentage points
Routine holds13 / 16 (81.25%)15 / 16 (93.75%)+12.5 percentage points
Holiday exceptions4 / 4 (100%)2 / 4 (50%)−50 percentage points

At Juniper Library, J18 and J20 require directions to an alternate pickup desk. If the release rule allows zero new failures on that requirement, hold this candidate and attach both case IDs. Four holiday cases give the reviewer evidence about these inputs. Estimating the failure rate across all holiday requests takes a larger, representative sample.

Decide what the slice can support

  1. Check the two outputs for each changed case against the same reference. Confirm that the holiday tag and the expected pickup instructions are still valid.
  2. Send confirmed failures to the release owner with both answers and the condition the candidate missed in each answer. Add new cases for other ways a reader might phrase the same exception.
  3. Keep the overall denominator separate from slice totals. If groups overlap, show each group's numerator and denominator and count every case once in the overall score.

A critical fixture can enforce a release rule with a single reproducible failure. When the question is whether a change improved the broader pass rate, use the case-by-case switches to assess the paired evidence. Compare paired pass and fail results with McNemar’s test.

Related suites

    Related reading

    Sources

    1. 1. Slice Finder: Automated Data Slicing for Model Validation · Google Research · Paper · Sources checked
    2. 2. Beyond Accuracy: Behavioral Testing of NLP Models with CheckList · Association for Computational Linguistics · Paper · Sources checked