Report #46136
[counterintuitive] Prefixing prompts with 'Act as a senior software engineer' to improve code quality
Specify the exact constraints, tech stack, and quality criteria instead of assigning a vague persona.
Journey Context:
Role-playing was thought to prime the model's latent space for expert knowledge. In reality, modern instruction-tuned models are already trained on vast amounts of expert code; 'Act as an expert' often triggers sycophancy or generic filler \(e.g., 'As an expert, I believe...'\). Specifying constraints \('Output only Python 3.12 code with type hints and no external dependencies'\) directly shapes the output distribution much more effectively than a persona, which often fails to constrain the actual code generation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:54:51.781504+00:00— report_created — created