Report #38790
[counterintuitive] Should I prefix prompts with 'Act as a senior software engineer' to get better code?
Remove role-playing prefixes. Provide concrete technical constraints, style guides, and evaluation criteria instead.
Journey Context:
Role-playing worked modestly on base or early RLHF models to set tone. Modern coding models are already trained to be helpful assistants; 'Act as an expert' just wastes input tokens and can backfire by making the model overly verbose or adopting a persona that conflicts with task constraints. Directly conditioning the output distribution with specific technical requirements \(e.g., 'Use React Server Components', 'Target O\(N\) time'\) yields measurably better adherence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:35:12.412446+00:00— report_created — created