arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.04057cs.SEcs.AIcs.LG
收藏

隐形彩票:微妙线索如何引导LLM代码生成中的算法选择

The Invisible Lottery: How Subtle Cues Steer Algorithm Choice in LLM Code Generation

University of Washington(华盛顿大学);Google Research(谷歌研究院)

Akanksha Narula, Mofasshara Binte Rafique, Laurent Bindschaedler

AI总结:

通过大量控制实验,发现提示中的偶然线索(如上下文词或元数据)会系统性地改变LLM在代码生成中选择的算法族分布,影响性能、安全性和可维护性,而直接命名算法是最可靠的缓解措施。

摘要:

大型语言模型(LLM)现在生成大量生产代码,通常用于具有多个有效算法解决方案的任务。偶然的提示线索,即任务规范之外的上下文词或元数据,可以引导模型选择哪个算法,即使所有输出都通过相同的测试。提示敏感性作为提高输出质量的工具已被广泛研究。这里,输出策略意味着在固定正确性下的算法选择。我们将算法引导定义为线索引起的算法族分布变化,并在11个任务、19种线索类型(18个通道加上一个记忆化语义与表面消融,在改变排版和标点的同时保留含义)以及15个模型配置上进行了46,535次控制实验。我们发现算法族分布存在大规模、系统性的变化(高达100个百分点),与线索语义基本一致,包括在速率限制等应用任务中。直接命名算法是我们测试的最可靠的缓解措施。因此,偶然的上下文在性能、安全性和可维护性上创造了一个“隐形彩票”。

英文摘要:

Large language models (LLMs) now generate substantial production code, often for tasks with multiple valid algorithmic solutions. Incidental prompt cues, meaning contextual words or metadata outside the task specification, can steer which algorithm the model selects, even when all outputs pass the same tests. Prompt sensitivity is well studied as a tool to improve output quality. Here, output policy means algorithm choice under fixed correctness. We define algorithm steering as cue-induced shifts in algorithm-family distributions and run 46,535 controlled experiments across 11 tasks, 19 cue types (18 channels plus a memoization semantic-vs-surface ablation that preserves meaning while changing typography and punctuation), and 15 model configurations. We find large, systematic shifts in algorithm-family distributions (up to 100 pp), largely consistent with cue semantics, including in applied tasks such as rate limiting. Direct algorithm naming is the most reliable mitigation we tested. Accidental context therefore creates an "invisible lottery" over performance, security, and maintainability.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑