返回全部动态

LLM代码生成中复合提示约束的全因子研究:格式、角色与紧迫性的影响

原标题:Compound Prompt Constraints in LLM Code Generation: A Factorial Study of Format, Persona, and Urgency

arXiv cs.SE一手来源研究质量 87

AI 摘要

该论文对LLM代码生成中的复合提示约束进行了全因子实验研究,考察输出格式、角色设定和紧迫性框架的联合影响。实验在HumanEval+的164个问题上测试了五个OpenAI模型,共22,140次评估,发现复合约束导致的性能下降无法由单因素实验预测,且具有架构依赖性:GPT-4o系列出现超加性退化,而GPT-4.1系列和o3-mini表现不同。研究建议将复合提示测试作为LLM辅助工程可靠性评估的标准部分。

以上摘要由 AI 生成,可能存在误差。事实请以原文为准。

正文节选

Compound Prompt Constraints in LLM Code Generation: A Factorial Study of Format, Persona, and Urgency Abstract Large language models (LLMs) are increasingly deployed in software engineering pipelines for code generation, where production prompts routinely combine multiple constraints in a single request. A typical prompt may require the response to follow a structured output format such as JSON or XML, may assign the model a specific developer persona through the system message, and may frame th


发布时间:2026-09-04 12:00
抓取时间:2026-09-04 13:45
来源机构:arXiv
阅读原文arxiv.org