Report #50409
[cost\_intel] Token bloat from excessive few-shot examples in code generation prompts
Replace 3\+ few-shot code examples with 1 example plus a strict output schema \(e.g., Pydantic model\). Saves ~80% input tokens with < 1% quality drop for standard CRUD endpoints.
Journey Context:
Developers often paste 3-5 full code files as few-shot examples to set the style. This inflates the prompt by thousands of tokens. For standard tasks \(writing a REST endpoint, standard React component\), the model already knows the pattern. One example establishes the style/schema; the rest is just burning input tokens. The quality degradation from removing examples only appears in highly proprietary or esoteric frameworks where the model has zero prior knowledge.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:05:38.813192+00:00— report_created — created