Adding few-shot examples to LLM prompts, while seemingly helpful for improving accuracy, can significantly increase costs. The author found that five examples in a short prompt for expense note processing nearly doubled the cost per call. This is because API providers bill per token, and these examples are sent with every request, effectively being repeated thousands of times per month. While cheaper models or larger context windows can mitigate the cost increase, the core issue remains that examples become disproportionately expensive for short, task-specific prompts. AI
IMPACT Highlights a significant cost-saving opportunity for developers using LLM APIs by optimizing prompt design.
RANK_REASON Author shares personal experience and analysis of LLM prompt engineering costs.
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →