Report #66795
[counterintuitive] Using 'Act as an expert' or role-playing personas to improve code quality
Replace persona prompts with explicit constraints and rubrics. Instead of 'Act as a senior Python dev,' use 'Write Python code that adheres to PEP8, includes type hints, and handles the following edge cases.'
Journey Context:
Early base models benefited from persona priming because it shifted weight distributions toward professional jargon. Modern RLHF-tuned models are optimized for instruction following; persona prompts add tokens without adding actionable constraints. Worse, role-playing can backfire by inducing sycophancy—the model may agree with bad user premises because the 'expert' persona defers to the user. Constraints deterministically narrow the output space.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:35:40.793990+00:00— report_created — created