Identity or Prompt Noise? A Calibrated Invariance Audit of LLM Code Generation
- Source
- arxiv.org
- Author
- Maksim E. Eren, Ryan Barron, Eric Michalak, Charles Nicholas, Manish Bhattarai
- Date

Context
Changing identity cues in a programming prompt can alter generated code without establishing that a group receives worse solutions. This audit holds programming tasks fixed while varying assigned gender, country and occupation personas, then compares observed variation with a randomized baseline. The authors report small, reproducible occupation-related changes in code form. In six high-pass-rate test settings, those differences extended to properties such as length and complexity, while differences in test-passing rates were not statistically significant. Country differences that looked large before did not show the same excess, and gender effects could not be separated from wording. The supported finding concerns code presentation and structure, with no established stable disadvantage to named identities.
- The audit covers 30.73 million executed Python generations from seven checkpoints on HumanEval+ and MBPP+, using within-task randomization and false-discovery-rate control to separate persona effects from sampling and wording noise.
- Occupation personas pushed CodeBLEU dispersion past its null in 10 of 14 model- cells, but the median excess was only 0.141 points, and pass-rate dispersion was significant in none of the six high-pass-rate cells.
- Country personas led raw dispersion in 12 of 14 cells yet had a median calibrated ratio of 1.00, suggesting raw counterfactual comparisons can overstate identity effects.
- The authors say gender effects could not be separated from persona wording in this design, and conclude the evidence supports small occupation-linked changes in code form, not stable disadvantage to named identities.
- calibration — How well a model's confidence matches reality — a calibrated model saying "90% sure" is right about 90% of the time.
- LLM — A large language model — the neural network behind tools like Claude and ChatGPT, trained on huge amounts of text to predict what comes next.
- benchmark — A standard public test set for comparing AI models — the shared scoreboards behind every "model X beats model Y" claim.
articleWhen Who You Are Can Change the Code You Get: A Study of Persona-Induced Bias in LLM Code GenerationAnubhav Gupta, Mayara Costa Figueiredo, Leticia Santos Machado, Tanner Wright, Ivan Beschastnikh, Cleidson R. B. de Souza, Gema Rodr\'iguez-P\'erez
articleDo Influence Tactics Matter? Investigating Prompt Framing Effects in LLM Code GenerationAlex Deaconu, Anubhav Gupta, Manaal Basha, Nicholas Haydu, Gema Rodr\'iguez-P\'erez
articleA Study on the Impact of Natural Language Differences in Prompts on Automatic Code Generation Using LLMsHaruka Tokumasu, Masanari Kondo, Alexander Serebrenik, Dong Wang, Kei Koyanagi, Kotaro Noguchi, Naoyasu Ubayashi, Yasutaka Kamei
Checking sign-in…
Loading comments…