Report #55149
[agent\_craft] Few-shot examples of correct code still result in the agent repeating common bugs from its training data
Include 'anti-examples' in the prompt: 1-2 examples of the specific buggy pattern followed by the corrected version, explicitly labeled as 'Incorrect' vs 'Correct'
Journey Context:
Standard few-shot prompting shows ideal outputs, but for error modes that are common in the pre-training corpus \(e.g., off-by-one errors in Python ranges\), the model has high prior probability for the bug. Showing only correct code doesn't suppress this. The 'Self-Refine' and 'Reflexion' approaches demonstrate that explicit contrastive examples \(negative then positive\) create stronger discriminative boundaries. This costs extra tokens but dramatically reduces specific recurring error rates.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:03:31.600074+00:00— report_created — created