A prompt is a function call. You wouldn't expect a function with vague arguments to return what you want; the same goes for LLMs. The discipline of prompting is the discipline of being specific.
The five-block structure
Most good prompts include some or all of these blocks, in order:
- Role: 'You are an experienced equity-research analyst.'
- Context: relevant background, data, or documents the model needs to do the task
- Task: a clear, specific instruction. 'Summarise this 10-K filing in five bullet points focused on revenue concentration risk.'
- Format: how the output should be structured. 'Return as JSON with keys ...'
- Constraints: what the model should and shouldn't do. 'Cite specific page numbers. Don't speculate beyond the filing.'
Few-shot prompting
Showing the model 2-5 examples of input → desired output dramatically improves performance on classification, extraction, and pattern-matching tasks. The model learns the shape of what you want from the examples alone, often better than from instructions.
Classify the sentiment of these MPC press-release excerpts as hawkish, dovish, or neutral.Example 1: "The Committee judges that further tightening will be required to bring inflation sustainably to target."→ hawkishExample 2: "The MPC sees scope to reduce the policy rate as inflationary pressures ease."→ dovishNow classify:"The Committee maintained the policy rate at 12.75%, citing balanced risks."→
Chain-of-thought
For multi-step reasoning, ask the model to think step by step. The 2022 Wei et al. paper showed that prompting 'Let's think step by step' improves performance on math and logic tasks dramatically. Modern reasoning models (o1, o3, Claude with extended thinking, Gemini Deep Think) build this in.
Structured output
When you need to parse the output programmatically, ask for JSON. Modern APIs (Claude, GPT, Gemini) support 'JSON mode' or structured output schemas that guarantee valid JSON. Schema-guided generation is the production-grade pattern.
What doesn't work
- Magic words. 'You are the world's best analyst' rarely changes much; concrete instructions do
- Very long prompts (5000+ tokens) with conflicting constraints — the model gets confused
- Politeness or rudeness as a tool. Just be specific
- Asking for 'creativity' without anchoring examples — you get cliché
The iteration discipline
Build a small test set of 10-20 examples of what good and bad output looks like for your task. Iterate on the prompt against that set. This is the difference between prompt engineering (a real practice) and prompt incanting (rumour).
Exercise
You want an LLM to extract key financial metrics from earnings call transcripts. A junior on the team writes: 'You are an expert financial analyst. Please carefully extract the most important financial metrics from the earnings call transcript below. Make sure to be accurate and comprehensive.' Critique the prompt — what is wrong with it, and write a better version that incorporates the practices from this module.