The Invisible Hand: Unveiling Provider Bias in Large Language Models for Code Generation

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Zhang, Xiaoyu, Zhai, Juan, Ma, Shiqing, Bao, Qingshuang, Jiang, Weipeng, Wang, Qian, Shen, Chao, Liu, Yang
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866914108364816384
author Zhang, Xiaoyu
Zhai, Juan
Ma, Shiqing
Bao, Qingshuang
Jiang, Weipeng
Wang, Qian
Shen, Chao
Liu, Yang
author_facet Zhang, Xiaoyu
Zhai, Juan
Ma, Shiqing
Bao, Qingshuang
Jiang, Weipeng
Wang, Qian
Shen, Chao
Liu, Yang
contents Large Language Models (LLMs) have emerged as the new recommendation engines, surpassing traditional methods in both capability and scope, particularly in code generation. In this paper, we reveal a novel provider bias in LLMs: without explicit directives, these models show systematic preferences for services from specific providers in their recommendations (e.g., favoring Google Cloud over Microsoft Azure). To systematically investigate this bias, we develop an automated pipeline to construct the dataset, incorporating 6 distinct coding task categories and 30 real-world application scenarios. Leveraging this dataset, we conduct the first comprehensive empirical study of provider bias in LLM code generation across seven state-of-the-art LLMs, utilizing approximately 500 million tokens (equivalent to $5,000+ in computational costs). Our findings reveal that LLMs exhibit significant provider preferences, predominantly favoring services from Google and Amazon, and can autonomously modify input code to incorporate their preferred providers without users' requests. Such a bias holds far-reaching implications for market dynamics and societal equilibrium, potentially contributing to digital monopolies. It may also deceive users and violate their expectations, leading to various consequences. We call on the academic community to recognize this emerging issue and develop effective evaluation and mitigation methods to uphold AI security and fairness.
format Preprint
id arxiv_https___arxiv_org_abs_2501_07849
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle The Invisible Hand: Unveiling Provider Bias in Large Language Models for Code Generation
Zhang, Xiaoyu
Zhai, Juan
Ma, Shiqing
Bao, Qingshuang
Jiang, Weipeng
Wang, Qian
Shen, Chao
Liu, Yang
Software Engineering
Artificial Intelligence
Cryptography and Security
Large Language Models (LLMs) have emerged as the new recommendation engines, surpassing traditional methods in both capability and scope, particularly in code generation. In this paper, we reveal a novel provider bias in LLMs: without explicit directives, these models show systematic preferences for services from specific providers in their recommendations (e.g., favoring Google Cloud over Microsoft Azure). To systematically investigate this bias, we develop an automated pipeline to construct the dataset, incorporating 6 distinct coding task categories and 30 real-world application scenarios. Leveraging this dataset, we conduct the first comprehensive empirical study of provider bias in LLM code generation across seven state-of-the-art LLMs, utilizing approximately 500 million tokens (equivalent to $5,000+ in computational costs). Our findings reveal that LLMs exhibit significant provider preferences, predominantly favoring services from Google and Amazon, and can autonomously modify input code to incorporate their preferred providers without users' requests. Such a bias holds far-reaching implications for market dynamics and societal equilibrium, potentially contributing to digital monopolies. It may also deceive users and violate their expectations, leading to various consequences. We call on the academic community to recognize this emerging issue and develop effective evaluation and mitigation methods to uphold AI security and fairness.
title The Invisible Hand: Unveiling Provider Bias in Large Language Models for Code Generation
topic Software Engineering
Artificial Intelligence
Cryptography and Security
url https://arxiv.org/abs/2501.07849