Style, Not Self: Surface Cues Explain Zero-Shot Code Attribution by Large Language Models
作者: Ehsan Barkhordar, Surendrabikram Thapa
分类: cs.AI, cs.CL, cs.SE
发布日期: 2026-09-24
备注: 18 pages, 1 figure. Code and data: https://github.com/ebarkhordar/llm-collusion
💡 一句话要点
提出基于表面线索的零-shot代码归属方法以解决模型自我偏好问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 代码归属 自我偏好 零-shot学习 归一化方法 模型评估 编程助手
📋 核心要点
- 现有大型语言模型在判断自己生成代码时存在自我偏好现象,可能导致模型间的协作与偏见。
- 论文提出通过表面线索分析模型的归属能力,设计了一系列实验以评估不同模型的表现。
- 实验结果显示,模型在单一解决方案任务中的平衡准确率为49-58%,而在成对任务中准确率与解决方案长度高度相关。
📝 摘要(中文)
本研究探讨了大型语言模型(LLM)在零-shot环境下对其生成代码的归属能力,分析了模型自我偏好的潜在风险。通过对五个LLM在多个基准任务上的表现进行测试,发现模型在判断自己生成的代码时的准确率存在显著差异。研究还提出了一种基于规则的归一化方法,去除代码中的文档字符串、注释等信息,发现这种归一化处理对模型的归属判断有重要影响。最后,建议在评估模型性能时报告平衡准确率和启发式基线。
🔬 方法详解
问题定义:本研究旨在解决大型语言模型在归属判断中存在的自我偏好问题,现有方法未能有效评估模型的真实能力和偏见。
核心思路:通过分析模型在不同任务中的表现,探讨表面线索对模型归属判断的影响,设计实验验证模型的自我监控能力。
技术框架:整体流程包括五个LLM生成代码,七个LLM进行评估,任务分为单一解决方案判断和成对解决方案比较,评估模型的归属能力和准确性。
关键创新:提出了一种基于规则的归一化方法,去除代码中的文档字符串、注释等信息,显著影响模型的归属判断结果,揭示了模型自我偏好的本质。
关键设计:在实验中使用了平衡准确率和原始准确率作为评估指标,设计了多种任务组合以全面评估模型的表现。
🖼️ 关键图片
📊 实验亮点
实验结果显示,15个模型-基准组合的平衡准确率在49-58%之间,原始准确率在38-67%之间,反映了模型自我归属的倾向。成对任务中,准确率与解决方案长度的相关性达到r=0.93,表明长度在归属判断中的重要性。
🎯 应用场景
该研究的潜在应用领域包括代码生成、自动化编程助手和软件开发工具等。通过提高模型对代码归属的理解,可以减少模型在生成代码时的偏见,提升代码质量和可维护性,具有重要的实际价值和未来影响。
📄 摘要(原文)
If a language model can recognize code it wrote, it may favor that code as a judge, and instances of one model monitoring each other could collude. We test this zero-shot on current commercial models. Five LLMs generate solutions to MBPP, HumanEval, and DS-1000, seven more to MBPP, and models act as evaluators in four tasks: picking their own solution from a pair, judging whether a single solution is their own, identifying which of two solutions a named model wrote, and judging quality blind. In the single-solution task, balanced accuracy is 49-58% for all 15 model-benchmark combinations, while raw accuracy (38-67%) mostly reflects how readily a model claims authorship. In the pairwise task, accuracy across 14 evaluator-opponent combinations correlates at r=0.93 with how often the evaluator's solution is longer. Attribution to a named model succeeds on some pairs and is consistently inverted on others. A rule-based normalization that strips docstrings, comments, type hints, and local names preserves Pass@1 and leaves ten of twelve re-tested results at chance; the other two follow a length difference it leaves, although a trained classifier still separates most normalized pairs. Claude Haiku's self-preference also disappears. We recommend reporting balanced accuracy, heuristic baselines, and label consistency.