Report #16334
[agent\_craft] Agent overfits to specific variable names or patterns from few-shot examples, producing brittle code that doesn't adapt to the actual task context
Use 'meta' few-shot examples that demonstrate error-recovery or pattern-matching strategies \(e.g., 'When you see X error, try Y'\) rather than specific code implementations; keep literal code examples zero-shot
Journey Context:
Literal few-shot assumes the distribution of errors is constant, but literal few-shot creates 'mode collapse' where the model fixates on surface features \(like variable names \`foo\`, \`bar\` or specific API calls from the example\) rather than the underlying task structure. This is particularly dangerous in coding where variable semantics matter. Meta-examples \(showing reasoning patterns\) transfer better because they teach the 'how to think' not 'what to type'. The alternative is to use dynamic few-shot retrieval based on similarity to the current error, but that requires infrastructure; meta-examples work in static prompts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:23:26.572562+00:00— report_created — created