Compared to What? Baselines and Metrics for Counterfactual Prompting

· Source: cs.CL updates on arXiv.org · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Data Science & Analytics · Depth: Expert, extended

Summary

A new study argues that counterfactual prompting, widely used to evaluate LLM bias and Chain-of-Thought faithfulness, often misattributes observed output changes to targeted factors. The authors contend that every counterfactual edit is a compound treatment, bundling the variable of interest with incidental surface-form variation, which violates treatment variation irrelevance. For instance, a 14.9% prediction flip rate on MedQA when changing patient gender was statistically indistinguishable from the 14.1% flip rate induced by simple paraphrasing. To address this, they propose a framework that compares targeted interventions against "meaning-preserving" modifications, like token-adjusted paraphrasing, using statistical testing. Applying this to the MedPerturb dataset, they found that previously reported sensitivities to patient demographics and stylistic cues largely dissipated, with only 5 of 120 tests reaching significance. However, the framework successfully detected significant directional gender bias in occupational biography classification using the Bias-in-Bios dataset.

Key takeaway

For AI Engineers and Research Scientists evaluating LLM behavior, your counterfactual prompting experiments must include magnitude-matched paraphrase baselines. Relying solely on aggregate metrics like flip rate can obscure true effects or lead to false positives. Instead, integrate per-sample distributional metrics (JSD, KL) and regression analysis for directional hypotheses to robustly identify and characterize genuine model sensitivities, ensuring your conclusions are statistically sound and not merely reflecting general prompt sensitivity.

Key insights

Counterfactual prompting requires baselines of "meaning-preserving" text modifications to avoid misattributing LLM output changes.

Principles

Method

Compare targeted intervention effects to a magnitude-matched paraphrase baseline via statistical tests (paired t-test for per-sample, bootstrap for aggregate, t-test for regression coefficients).

In practice

Topics

Code references

Best for: AI Engineer, NLP Engineer, Research Scientist, AI Scientist, Machine Learning Engineer, AI Ethicist

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by cs.CL updates on arXiv.org.