Report #26400
[counterintuitive] Using 'Act as an expert' role-playing prompts to improve code quality
Drop the role-play persona. Use direct, specific constraints and evaluation criteria, such as 'Ensure code passes mypy strict, has 100% test coverage, and avoids O\(n^2\) complexity.'
Journey Context:
Role-playing worked slightly in early models \(GPT-3/3.5\) by activating related token clusters, but modern instruction-tuned models prioritize explicit instructions. 'Act as an expert' is vague and often leads to verbose, condescending explanations rather than better code. Explicit constraints mechanically force the model into the desired state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:42:56.759874+00:00— report_created — created