Skip to paper
Paulius RaubaResearch papers

NeurIPS 2024 · Model evaluation & reliability

Context-Aware Testing: A New Paradigm for Model Testing with Large Language Models

Paulius RaubaNabeel SeedatMax Ruiz LuytenMihaela van der Schaar

Conference paper · University of Cambridge

Paulius Rauba and Nabeel Seedat contributed equally.

Advances in Neural Information Processing Systems 37, 112505–112553 (2024) · DOI: 10.52202/079017-3574

Original abstract

The predominant de facto paradigm of testing ML models relies on either using only held-out data to compute aggregate evaluation metrics or by assessing the performance on different subgroups. However, such data-only testing methods operate under the restrictive assumption that the available empirical data is the sole input for testing ML models, disregarding valuable contextual information that could guide model testing. In this paper, we challenge the go-to approach of data-only testing and introduce context-aware testing (CAT) which uses context as an inductive bias to guide the search for meaningful model failures. We instantiate the first CAT system, SMART Testing, which employs large language models to hypothesize relevant and likely failures, which are evaluated on data using a self-falsification mechanism. Through empirical evaluations in diverse settings, we show that SMART automatically identifies more relevant and impactful failures than alternatives, demonstrating the potential of CAT as a testing paradigm.

Context-Aware Testing uses deployment context to decide which model failures are worth testing. SMART Testing turns that idea into an LLM-driven workflow that proposes hypotheses, tests them against data, and reports supported failures.

What should we test a machine learning model for?#

A model can have a reassuring average score while failing on the people or situations that matter most in deployment. Finding those failures is partly a search problem: which combinations of features should an evaluator examine? Searching every possible slice of a finite dataset can produce chance discoveries, while correcting for a very large number of tests can make real failures harder to detect.

Context-Aware Testing (CAT) uses information about the task and deployment setting to guide this search. A clinician, for example, may have reasons to inspect particular patient groups before looking at arbitrary combinations of unrelated variables. CAT formalizes the role of that context as an inductive bias for choosing candidate failure hypotheses. The paper’s question is therefore about selecting useful tests, as well as evaluating their outcomes.

How SMART Testing works#

SMART Testing proposes contextual failure hypotheses, tests their feasibility and empirical support, and produces an evaluation report.

Original Figure 1 from the NeurIPS paper. The workflow separates proposing a plausible failure from finding evidence that it occurs. Source: paper, Section 4, CC BY 4.0.

SMART Testing is the paper’s concrete implementation of CAT. An LLM receives a description of the data, contextual information, and any testing requirements. It then carries out four connected steps:

  1. Hypothesis generation. Propose meaningful groups on which the predictive model might underperform, with a justification for each proposal.
  2. Operationalization. Translate a proposal into a testable definition using the available features. A plausible idea is not useful if the dataset cannot represent it.
  3. Self-falsification. Evaluate the proposed failure against data and reject hypotheses that do not survive the checks.
  4. Reporting. Present the supported findings, performance differences, and explanations in a report that a human evaluator can inspect.

The model being tested does not have to be an LLM. In the main experiments, SMART uses GPT-4 to help audit tabular predictive models. The language model supplies contextual hypotheses; measured predictive performance supplies the evidence. These roles are separate.

What the experiments show#

The paper studies relevance, failure discovery, false negatives, and sensitivity to potential LLM biases. Its experiments include finance, healthcare, criminal-justice and education datasets, together with controlled simulations. These are evaluations of a testing method, rather than evidence that the evaluated predictive systems are ready for consequential deployment.

In the prostate-cancer experiment, SMART identifies slices with larger accuracy discrepancies on unseen data than the tested alternatives. The selected values below come from Table 3, which reports means and standard deviations over five runs. A larger discrepancy here means the testing method found a more pronounced failure; it does not mean the underlying predictor became more accurate.

Testing method Logistic regression: accuracy discrepancy XGBoost: accuracy discrepancy
Autostrat 0.24 ± 0.02 0.09 ± 0.09
Sliceline 0.26 ± 0.06 0.18 ± 0.09
SMART without self-falsification 0.17 ± 0.01 0.09 ± 0.05
SMART 0.37 ± 0.03 0.26 ± 0.06

Separate experiments add irrelevant features and deliberately corrupt subgroup predictions. Those interventions make it possible to examine whether the testing methods select irrelevant conditions or miss known failures. SMART performs favorably in these reported settings. The ablation also supports the importance of checking hypotheses against data rather than accepting an LLM’s initial suggestions. See Section 5 for the complete comparisons.

Where this approach is useful#

CAT is relevant when there is meaningful deployment knowledge that a purely numerical search would ignore: application requirements, likely sources of error, or groups that deserve explicit evaluation. It offers a way to turn that knowledge into tests that remain tied to observed model behavior.

It can also support a more inspectable evaluation process. A report that states a hypothesis, its operational definition, and the measured evidence gives a domain expert something concrete to challenge. The value is in connecting context to empirical testing, rather than treating a natural-language explanation as sufficient evidence.

Scope and limitations#

The quality of the proposed tests depends on the context, the LLM, and the features available in the dataset. A meaningful failure can still be missed if it is never proposed or cannot be expressed using those features. An LLM may also introduce its own biases. Self-falsification reduces unsupported claims, but it does not establish that every relevant failure has been found.

Statistical validity also depends on how candidate selection, validation, and final evaluation are separated. Repeatedly inspecting the same examples can undermine an evaluation even when the hypotheses sound reasonable. The paper’s testing procedure and data splits matter when reproducing its results.

Questions about the paper#

Is SMART Testing an LLM benchmark?#

SMART uses an LLM to help test another model. The central contribution is a context-guided model-testing procedure, with tabular prediction providing the main experimental setting.

Does CAT replace a held-out test set?#

No. Data remains necessary to establish whether a proposed failure is supported. Context helps decide what to test; it cannot substitute for the measurements.

How does this connect to Self-Healing Machine Learning?#

CAT focuses on finding meaningful failures. Self-Healing Machine Learning studies a wider loop that diagnoses degradation, proposes adaptations and tests them. The two papers address complementary parts of making deployed models more reliable.

Sources and implementation#

The explanation and selected results above are based on the NeurIPS 2024 paper, particularly Sections 3–5 and Table 3. The authors’ implementation is available in SMART_Testing. Paulius Rauba and Nabeel Seedat are marked as equal contributors in the paper.

Use in your work

Cite this paper

Cite the original research below. This generated explanation is a reading aid.

Rauba, P., Seedat, N., Ruiz Luyten, M., & van der Schaar, M. (2024). Context-Aware Testing: A New Paradigm for Model Testing with Large Language Models. Advances in Neural Information Processing Systems, 37, 112505–112553. https://doi.org/10.52202/079017-3574

BibTeX

@inproceedings{NEURIPS2024_cc4d9cfc,
 author = {Rauba, Paulius and Seedat, Nabeel and Ruiz Luyten, Max and van der Schaar, Mihaela},
 booktitle = {Advances in Neural Information Processing Systems},
 doi = {10.52202/079017-3574},
 editor = {A. Globerson and L. Mackey and D. Belgrave and A. Fan and U. Paquet and J. Tomczak and C. Zhang},
 pages = {112505--112553},
 publisher = {Curran Associates, Inc.},
 title = {Context-Aware Testing: A New Paradigm for Model Testing with Large Language Models},
 url = {https://proceedings.neurips.cc/paper_files/paper/2024/file/cc4d9cfc45325e460b455a820d5f212c-Paper-Conference.pdf},
 volume = {37},
 year = {2024}
}