From If-Statements to ML Pipelines: Revisiting Bias in Code-Generation

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Bui, Minh Duc, Heilmann, Xenia, Cerrato, Mattia, Mager, Manuel, von der Wense, Katharina
Format: Preprint
Veröffentlicht: 2026
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866917431260217344
author Bui, Minh Duc
Heilmann, Xenia
Cerrato, Mattia
Mager, Manuel
von der Wense, Katharina
author_facet Bui, Minh Duc
Heilmann, Xenia
Cerrato, Mattia
Mager, Manuel
von der Wense, Katharina
contents Prior work evaluates code generation bias primarily through simple conditional statements, which represent only a narrow slice of real-world 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 general-instruction 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.
format Preprint
id arxiv_https___arxiv_org_abs_2604_21716
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle From If-Statements to ML Pipelines: Revisiting Bias in Code-Generation
Bui, Minh Duc
Heilmann, Xenia
Cerrato, Mattia
Mager, Manuel
von der Wense, Katharina
Computation and Language
Software Engineering
Prior work evaluates code generation bias primarily through simple conditional statements, which represent only a narrow slice of real-world 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 general-instruction 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.
title From If-Statements to ML Pipelines: Revisiting Bias in Code-Generation
topic Computation and Language
Software Engineering
url https://arxiv.org/abs/2604.21716