Report #85654
[agent\_craft] Agent overfits to few-shot examples producing rigid output formats that break on edge cases
Use 'Principle-Based' few-shot rather than 'Template-Based'. Provide 2-3 examples that demonstrate \*diverse\* reasoning strategies \(e.g., one using regex, one using string splitting\) and explicitly include a 'Negative Example' showing a common anti-pattern \(e.g., 'Do not use global variables like this...'\). Instruct the model to follow the underlying principles \(e.g., 'validate inputs'\) rather than the surface syntax.
Journey Context:
Standard few-shot prompting often leads to 'format overfitting' where the agent copies incidental features \(specific variable names, comment styles, JSON keys\) from examples even when inappropriate. This causes failures when the real task deviates slightly. Showing diversity and explicitly labeling what \*not\* to do \(negative sampling\) reduces overfitting and encourages the model to extract abstract rules rather than surface templates.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:21:21.445379+00:00— report_created — created