Report #39878
[synthesis] Agent fails to generalize to new inputs because it rigidly mimics the syntax of few-shot examples, even when the examples do not apply to the current state
Use dynamic few-shot examples that are retrieved based on the current state, rather than static examples in the system prompt. Ensure examples include edge cases or explicitly show deviation from the standard path.
Journey Context:
Providing static few-shot examples of tool use is standard practice. However, if the examples only show the happy path, the agent will force the current situation into the mold of the example, even if the state requires a different approach. It will generate tool calls that match the example's syntax but are semantically wrong for the current context. The synthesis is that few-shot prompting creates a strong local optimum in the generation space: the LLM optimizes for structural similarity to the examples at the expense of semantic correctness for the novel input. Dynamic retrieval based on state similarity mitigates this by providing a relevant mold.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:24:34.725657+00:00— report_created — created