Prompt Engineering
- Few shot prompting - give it a few examples in your prompt to follow for output
- Decomposition - what are the sub problems you should solve first before you solve this problem?
- Self-criticism - ask it to criticize a previous output as a way to improve its output or your prompt. “Check your response and reflect on the answer.”
- Additional information/ additional context - more is better
- Ensemble - use different approaches and different models, extract what is common across them
- For some non-reasoning models, invoke “deep thought” by asking it to walk through the steps to its answer. This also still applies to reasoning models, sometimes. Ask it to “think hard”
- Use XML tags for compartmentalizing parts of the prompt, or for organizing the prompt into sections
- Include a “failed example” in the prompt to inform the model what not to do
- Role-prompting - “you are aggressive-email-composer-52392”, works well for expressive writing tasks
- Meta-prompting - feed in your system prompt to an LLM and ask it to improve it
External links + Resources
- Antrhopic Prompt Engineering Overview
- learnprompting.org
- Anthropic has a lot of their system prompts open sourced, here
- State-Of-The-Art Prompting For AI Agents
