Algorithmic Bias and Logical Inconsistency in LLM-Generated Code
Open Access
- 12 September 2026
- journal article
- research article
- Published by MDPI AG in Big Data and Cognitive Computing
- Vol. 10 (9) , 313
Abstract
Generative AI enables both software engineers and non-programmer domain experts to easily generate executable code. However, software engineers often lack domain-specific nuance to detect subtle AI logic errors, while domain experts typically lack the programming expertise required to audit the algorithms they are generating. Hence, this study investigates generative logic instability, unprompted threshold injections, and output divergence encountered when generated functions are executed. We construct a framework termed Combinatorial Logic Auditing, which identifies input variables in generated functions and uses combinatorial input generation to test for state changes. We present evidence of functional divergence, numeric threshold injection, and generative logic instability across multiple executions of identical prompts in a number of application domains. This research highlights the need for developers to adopt rigorous and comprehensive evaluation strategies to ensure the fairness, correctness, and reliability of code constructed with the assistance of generative AI and for robust and scalable auditing frameworks which support these goals. The anomalies documented in this study reveal the possibility of ethical vulnerabilities in AI-assisted software generation: without explicit auditing for proxy divergence and threshold injections, there exists a risk of deploying unverified, discriminatory logic at scale.Keywords
Funding Information
- Southern Illinois University Edwardsville
This publication has 14 references indexed in Scilit:
- Bias Testing and Mitigation in LLM-based Code GenerationACM Transactions on Software Engineering and Methodology, 2025
- Bias Unveiled: Investigating Social Bias in LLM-Generated CodeProceedings of the AAAI Conference on Artificial Intelligence, 2025
- The Invisible Hand: Unveiling Provider Bias in Large Language Models for Code Generation2025
- A Survey on Evaluation of Large Language ModelsACM Transactions on Intelligent Systems and Technology, 2024
- CoderEval: A Benchmark of Pragmatic Code Generation with Generative Pre-trained ModelsarXiv, 2024
- CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisarXiv, 2023
- Evaluating Large Language Models Trained on CodearXiv, 2021
- A Survey on Bias and Fairness in Machine LearningACM Computing Surveys, 2021
- On the Dangers of Stochastic Parrots2021
- The Art of Software Testing2012