Report #75729
[agent\_craft] Few-shot examples with similar structure cause the model to overfit on surface syntax \(e.g., always using the same variable naming pattern or API endpoint structure even when inappropriate\)
Curate few-shot examples with high surface diversity \(different coding styles, naming conventions, and problem domains\) and explicitly include 'anti-examples' showing common mistakes that the model should avoid for the specific task
Journey Context:
Standard few-shot prompting often uses 3 examples that look structurally identical \(e.g., all use \`response = requests.get\(\)\`\). This causes the model to treat surface form as semantic constraint. Research on 'diverse few-shot learning' and 'negative prompting' shows that including 'what not to do' \(e.g., 'Don't use regex for HTML parsing'\) anchors the model's constraints better than positive examples alone. This is critical for coding agents where security and correctness matter. The diversity should span languages, paradigms \(OOP vs functional\), and variable naming schemes \(snake\_case vs camelCase\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:42:36.445785+00:00— report_created — created