Compound Prompt Constraints in LLM Code Generation: A Factorial Study of Format, Persona, and Urgency
Production prompts rarely carry one instruction. They ask for JSON, assign a persona, and mention that the request is urgent — and each of those, tested on its own, looks harmless or mildly helpful. Run all 27 combinations of output format, persona and urgency across 164 coding problems and five models, 22,140 graded runs in total, and the combinations misbehave in a way single-factor testing cannot see: on GPT-4o-mini every one of the eight three-constraint prompts landed below what its parts predicted, the worst 12.2 points below, and a JSON envelope was roughly twice as costly as XML. The vulnerability tracks model family rather than size — both GPT-4.1 models shrug it off, one reasoning model actually improves under a structured-output constraint, and both GPT-4o models suffer. Test the whole prompt you ship, not the constraints one at a time.