ACL Findings2026
From If-Statements to ML Pipelines: Revisiting Bias in Code-Generation
Minh Duc Bui, Xenia Heilmann, Mattia Cerrato, Manuel Mager, Katharina von der Wense
Abstract
Prior work evaluates code generation bias primarily through simple conditional statements, which represent only a narrow slice of realworld programming and reveal solely overt, explicitly encoded bias. We demonstrate that this approach dramatically underestimates bias in practice by examining a more realistic task: generating machine learning (ML) pipelines. Testing both code-specialized and generalinstruction large language models, we find that generated pipelines exhibit significant bias during feature selection. Sensitive attributes appear in 87.7% of cases on average, despite models demonstrably excluding irrelevant features (e.g., including "race" while dropping "favorite color" for credit scoring). This bias is substantially more prevalent than that captured by conditional statements, where sensitive attributes appear in only 59.2% of cases. These findings are robust across prompt mitigation strategies, varying numbers of attributes, and different pipeline difficulty levels. Our results challenge simple conditionals as valid proxies for bias evaluation and suggest current benchmarks underestimate bias risk in practical deployments.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
- A Study of LLMs' Preferences for Libraries and Programming Languages cites Uncovering and Quantifying Social Biases in Code Generation
- A Study of LLMs' Preferences for Libraries and Programming Languages cites The Invisible Hand: Unveiling Provider Bias in Large Language Models for Code Generation
Builds on4
- MLAgentBench: Evaluating Language Agents on Machine Learning ExperimentationQian Huang, Jian Vora, Percy Liang, Jure LeskovecICML 2024 · 209 citations
- Uncovering and Quantifying Social Biases in Code GenerationYan Liu, Xiaokang Chen, Yan Gao, Zhe Su et al.NeurIPS 2023 · 47 citations
- The Invisible Hand: Unveiling Provider Bias in Large Language Models for Code GenerationXiaoyu Zhang, Juan Zhai, Shiqing Ma, Qingshuang Bao et al.ACL 2025 · 6 citations
- A Study of LLMs' Preferences for Libraries and Programming LanguagesLukas Twist, Jie M. Zhang, Mark Harman, Don Syme et al.ACL Findings 2026 · 5 citations
Related papers
- DSCodeBench: A Realistic Benchmark for Data Science Code GenerationShuyin Ouyang, Dong Huang, Jingwen Guo, Zeyu Sun et al.AAAI 2026 · 10 citations
- Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?Bonan Kou, Shengmai Chen, Zhijie Wang, Lei Ma et al.FSE 2024 · 8 citations
- DOMAINEVAL: An Auto-Constructed Benchmark for Multi-Domain Code GenerationQiming Zhu, Jialun Cao, Yaojie Lu, Hongyu Lin et al.AAAI 2025 · 25 citations
- The Invisible Lottery: How Subtle Cues Steer Algorithm Choice in LLM Code GenerationAkanksha Narula, Mofasshara Rafique, Laurent BindschaedlerICML 2026
- A Simple, Yet Effective Approach to Finding Biases in Code GenerationSpyridon Mouselinos, Mateusz Malinowski, Henryk MichalewskiACL Findings 2023 · 6 citations
