Prompting Fundamentals and How to Apply them Effectively
Eugene Yan
The article explains fundamental techniques for writing effective prompts for large language models, including assigning roles, using structured input/output formats, prefilling responses, and providing multiple examples. Key techniques discussed include using XML tags for structure, providing at least 12 examples in n-shot prompting (not just 3-5), and matching example distributions to production data. The practical application of these fundamentals helps LLM users obtain more reliable and consistent outputs through better conditioning of the model's probabilistic behavior.
Why it matters
Structured input/output, prefilling, n-shots prompting, chain-of-thought, reducing hallucinations, etc.