看不见的手:揭示大型语言模型在代码生成中的提供商偏见
The Invisible Hand: Unveiling Provider Bias in Large Language Models for Code Generation
AI总结:
本研究首次系统揭示大型语言模型在代码生成中存在的提供商偏见,通过构建多场景数据集和实证分析,发现模型偏向特定云服务并可能自主修改代码,呼吁关注其市场与安全影响。
摘要:
大型语言模型(LLMs)已成为新的推荐引擎,在能力和范围上均超越了传统方法,尤其是在代码生成领域。在本文中,我们揭示了LLMs中存在的一种新型提供商偏见:在没有明确指令的情况下,这些模型在推荐中会表现出对特定提供商服务的系统性偏好(例如,偏好Google Cloud而非Microsoft Azure)。为了系统地研究这种偏见,我们开发了一个自动化流水线来构建数据集,该数据集包含6种不同的编码任务类别和30个真实世界应用场景。利用该数据集,我们首次对七种最先进的LLM在代码生成中的提供商偏见进行了全面的实证研究,使用了约5亿个令牌(相当于超过5000美元的计算成本)。我们的研究结果表明,LLMs表现出显著的提供商偏好,主要偏向于Google和Amazon的服务,并且可以在用户未请求的情况下自主修改输入代码以纳入其偏好的提供商。这种偏见对市场动态和社会均衡具有深远影响,可能助长数字垄断。它还可能欺骗用户并违反其期望,导致各种后果。我们呼吁学术界认识到这一新兴问题,并开发有效的评估和缓解方法,以维护AI的安全性和公平性。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。