发表机构
Bluebear Security(蓝熊安全公司)
机构由 AI 辅助整理,请以论文原文为准。AI 中文总结
研究在可控条件下评估不同人物角色对代码生成的影响,测试了四种提示条件、两个模型等,发现角色影响因模型而异,如Claude Opus上图书管理员角色降低正确性,结果表明角色是依赖模型的行为策略偏差,还发布了相关数据和文档。
AI 中文摘要
传记人物角色广泛用于系统提示中,但在可控的、预先注册的条件下,其对代码生成的影响很少得到评估。我们测试了四种提示条件(无角色、两个工程师角色和一个研究图书管理员角色)、12个代码生成任务、两个前沿模型以及每个单元五次运行(共480次完成)。两个测试模型的角色影响有所不同。在预先注册的混合效应分析下,条件与模型的交互作用对提供商报告的输出令牌具有显著意义;事后可见字符测量显示了相同的定性模式。在Claude Opus上,简约工程师角色减少了30%的可见输出(提供商令牌中减少33%),但未提高正确性,而彻底工程师角色增加了输出但正确性未提高。在探索性事后分析中,图书管理员角色在60个Opus回复中的55个以及12个真正的无代码回复中引发了角色内免责声明,将平均正确性从0.92降至0.67。GPT - 5.5在其59个非截断回复中未产生此类行为。这些结果表明角色充当的是依赖模型的行为策略偏差,而非通用的质量干预措施。我们发布了原始完成情况、派生分数、分析工件、预注册文档和执行门日志;基于端到端测试的重新评分需要未发布的任务框架。
英文摘要
Biographical personas are widely used in system prompts, but their effects on code generation are rarely evaluated under controlled, pre-registered conditions. We tested four prompt conditions (no persona, two engineer personas, and a research-librarian persona), 12 code-generation tasks, two frontier models, and five runs per cell (480 completions). Persona effects differed between the two tested models. Under the pre-registered mixed-effects analysis, the condition-by-model interaction was significant for provider-reported output tokens; a post-hoc visible-character measure showed the same qualitative pattern. Six GPT-5.5 completions were length-capped and are reported separately. On Claude Opus, the minimalist engineer persona reduced visible output by 30% (33% in provider tokens) without improving correctness, while the thorough engineer persona increased output without a correctness gain. In an exploratory post-hoc analysis, the librarian persona elicited in-character disclaimers in 55 of 60 Opus responses and 12 genuine no-code responses, lowering mean correctness from 0.92 to 0.67. GPT-5.5 produced neither behavior in its 59 non-truncated responses. These results are consistent with personas acting as Model-Dependent behavioral-policy biases rather than universal quality interventions. We release raw completions, derived scores, analysis artifacts, a pre-registration document, and an execution gate log; end-to-end test-based rescoring requires an unreleased task harness.
Comments17 pages, 3 tables, no figures. Ancillary files include raw completions, derived scores, analysis scripts, persona texts, and preregistration