Report #69761
[counterintuitive] Do more few-shot examples always improve AI coding accuracy?
Use 2-3 diverse examples that illustrate the underlying principle, not many similar examples. If examples must cover variations, ensure they differ in structure not just surface details. When you notice the AI copying surface patterns from examples rather than solving the actual problem, reduce the number of examples and add explicit constraints.
Journey Context:
Standard prompting advice is 'provide examples' and the intuition is 'more examples = better pattern recognition.' But in coding tasks, too many similar examples cause the AI to pattern-match against the examples rather than reason about the problem. This is especially dangerous when examples share surface features but differ in requirements from the target task. The AI copies the example structure even when the target task requires a different approach — a form of anchoring bias in the model. Research shows few-shot performance often degrades beyond 3-5 examples, and diverse examples outperform numerous similar ones. The key insight: examples should teach the model the PRINCIPLE, not the PATTERN. Two examples illustrating the same principle in different contexts are more valuable than ten illustrating it in the same context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:34:43.938420+00:00— report_created — created