Unpacking Bias in LLMs: A Causal Testing Perspective
Large Language Models (LLMs) – the backbone of modern Natural Language Processing applications (NLP) - are notoriously subject to biases that reflect stereotypes present in their training. Fairness testing typically aims to expose bias by generating texts that should yield equivalent outputs, yet differ only in protected attributes such as gender or religion. However, fairness testing for LLMs is more complex than it seems. Bias depends not only on variations in the protected attribute, but also on its causal interactions with non-protected attributes and their combined influence on the output. Ignoring these dependencies risks producing unrealistic scenarios or misleading conclusions about bias. We introduce CFTA ( Causal Fairness Testing and Analysis ), a causality-driven technique for generating test datasets that uncover multiple forms of bias while enabling fine-grained decomposition of (real or apparent) bias-inducing paths. We evaluate CFTA on nine LLMs on a sentiment analysis task, exposing contributions of both obvious and hidden biases between models.
Authors
- Roberto Pietrantuono (ORCID: https://orcid.org/0000-0003-2449-1724)
- Luisa Ciniglio (ORCID: https://orcid.org/0009-0000-0586-2740)
- Claudio Spasiano (ORCID: https://orcid.org/0009-0006-4322-5121)
- Ilaria Picariello (ORCID: https://orcid.org/0009-0001-1864-9962)
- Sara Meglio (ORCID: https://orcid.org/0009-0000-3508-6965)
Institutions
- University of Naples Federico II (IT)
Publication Details
- Journal
- ACM Transactions on Software Engineering and Methodology
- Published
- 2026-11-05
- DOI
- https://doi.org/10.1145/3858420
- Primary Topic
- Ethics and Social Impacts of AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00