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

📅 2026-09-02
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
研究通过全因子实验探讨了格式、角色和紧迫性对大语言模型代码生成可靠性的影响,揭示了复合约束可能导致架构依赖性降级。
📝 Abstract
Large language models (LLMs) are increasingly used in software engineering pipelines for code generation, where production prompts often combine multiple constraints. This paper presents a full-factorial empirical study of how output formatting, persona assignment, and urgency framing jointly affect LLM code-generation reliability. We evaluate all 27 combinations in a controlled 3x3x3 design and decompose each compound condition into an additive prediction and a residual interaction term that captures super-additive degradation. The study uses all 164 HumanEval+ problems across five OpenAI models from the GPT-4o family, GPT-4.1 family, and o3-mini, yielding 22,140 greedy-decoding evaluations. A format-aware extraction pipeline separates formatting failures from reasoning failures, and significance is assessed with McNemar's test, odds ratios, and 95% confidence intervals. Results show that compound constraints can produce architecture-dependent degradation not predictable from single-factor experiments. The GPT-4o family exhibits consistent super-additive effects, with pass@1 reductions 3-12 percentage points beyond additive predictions; the largest interaction is -12.2 pp on GPT-4o-mini for JSON + expert persona + moderate urgency. JSON combinations generally produce larger interactions than XML. In contrast, the GPT-4.1 family is largely resistant, while o3-mini shows a qualitatively different pattern in which structured output constraints can improve performance. These findings show that vulnerability is architecture-dependent rather than size-dependent, that individually neutral or beneficial constraints can combine to cause substantial degradation, and that compound-prompt testing should be standard in reliability assessment for LLM-assisted engineering pipelines.
Problem

Research questions and friction points this paper is trying to address.

compound prompt constraints
code generation
large language models
Innovation

Methods, ideas, or system contributions that make the work stand out.

compound prompt constraints
factorial study
code generation reliability
architecture-dependent degradation
super-additive effects
Shrenik Jadhav
Shrenik Jadhav
University of Michigan–Dearborn USA, M.S. in Data Science, College of Engineering & Computer Science
Reinforcement LearningLLMsDeep LearningGraph Neural Network
N
Nickalas LaPlaca
Department of EECS, Embry-Riddle Aeronautical University, Daytona Beach, FL, USA
C
Caleb Stone
Department of EECS, Embry-Riddle Aeronautical University, Daytona Beach, FL, USA
A
Ashok Raja
Computer Information Technology and Graphics, Purdue University Northwest, Hammond, IN, USA
O
Omar Ochoa
Department of EECS, Embry-Riddle Aeronautical University, Daytona Beach, FL, USA
V
Vidhyashree Nagaraju
Department of EECS, Embry-Riddle Aeronautical University, Daytona Beach, FL, USA