Close-up of hands typing on a laptop keyboard

Most people write a prompt the way they’d text a friend — a quick ask, no context, and then frustration when the answer comes back generic. The gap between a mediocre AI response and a genuinely useful one usually isn’t the model. It’s the prompt. A handful of techniques, each backed by published research or documented by the labs that build these models, reliably change the output’s specificity, accuracy, and format. Here’s what they are, where they came from, and what they look like in practice.

Close-up of hands typing on a laptop keyboard
A well-built prompt is a draft of the work, not an afterthought. Photo by Burst, via Unsplash.

Give the model a role and a job, not just a question

Anthropic’s own documentation for Claude recommends putting a role description in the system prompt rather than burying it in the first message — telling the model who it is, what it’s allowed to do, and what format it should default to. OpenAI’s prompt guidance makes the same point: a specific persona narrows the model’s assumptions about audience and tone before it writes a single word.

Before: “Write about packing for Japan in winter.”
Result: a listicle-shaped answer — thermals, umbrella, adapter — that reads like every other packing post online.

After: “You are a travel gear editor who has tested cold-weather layering systems for Alpine and Hokkaido trips. Write a packing list for a 10-day February trip to Tokyo and Hokkaido, aimed at someone who has never packed for snow. Flag the two items people most often forget.”
Result: specific brand-agnostic advice (heated insoles for all-day walking, a packable down layer under a shell rather than one heavy coat) and an actual “forgotten items” callout — because the role constrains what counts as a complete answer.

Show it examples instead of describing the rules

This is few-shot prompting, formalized in the 2020 OpenAI paper “Language Models are Few-Shot Learners” (Brown et al., arXiv:2005.14165), the research that introduced GPT-3. The paper’s central finding was that showing a model a small number of input-output examples inside the prompt — with no retraining — let it infer the pattern and apply it to new cases, sometimes matching models that had been fine-tuned specifically for the task.

Before: “Turn this into a punchy Instagram caption: We visited the night market in Chiang Mai and tried mango sticky rice.”
Result: generic, slightly stiff copy.

After: Give two examples first —
“Input: We watched the sunset from Elephant Mountain in Taipei. Output: 101 views, zero regrets. 🌇
Input: We ate street dumplings until we couldn’t move. Output: Came for the view, stayed for the xiao long bao. 🥟
Input: We visited the night market in Chiang Mai and tried mango sticky rice. Output:”
Result: the model now matches your rhythm, length, and emoji habit instead of its own default style — because it’s pattern-matching against your examples, not guessing at “Instagram voice” in the abstract.

Ask it to reason before it answers

Chain-of-thought prompting comes from a 2022 Google Brain paper, “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models” (Wei et al., arXiv:2201.11903, later published at NeurIPS 2022). The technique adds worked-through reasoning steps to the examples in a prompt, and the paper reported that an 8-example chain-of-thought prompt pushed a 540-billion-parameter model’s accuracy on the GSM8K math-word-problem benchmark from roughly 18% to 57%. A simpler follow-up by Kojima et al. found you don’t even need the worked examples — appending “Let’s think step by step” to a prompt alone (zero-shot chain-of-thought) produced large gains on reasoning tasks.

Before: “I have 3 days in Lisbon, a $600 budget after flights, and want one day trip. What should I do?”
Result: a plausible-sounding but unchecked plan that may not actually fit the budget.

After: Add: “Think step by step: first allocate the budget across lodging, food, the day trip, and a buffer, showing the math, then build the itinerary around what’s left.”
Result: the model shows its arithmetic before committing to a plan, which makes it far easier to catch a budget that doesn’t actually add up — and it tends to produce a plan more constrained by the numbers rather than ignoring them.

Ask for a specific structure, not just “nicely formatted”

If you need output you can actually parse or drop into a spreadsheet, vague formatting requests fail. OpenAI’s Structured Outputs feature (added to its API in 2024) lets a developer supply an exact JSON schema the model’s response must match — a stricter successor to the older “JSON mode,” which only guaranteed valid JSON, not a specific shape. In Claude, Anthropic’s documented technique is different but solves the same problem: wrap instructions and examples in XML-style tags and pre-fill the start of the model’s reply (for instance, opening with { or a tag like <itinerary>) so it continues in that format rather than wandering into prose.

Before: “Give me a comparison of three hostels in Bangkok.”
Result: three paragraphs of prose you’d have to manually reformat into a table.

After: “Return a comparison of three hostels in Bangkok as a JSON array. Each object must have exactly these keys: name, neighborhood, price_per_night_usd, nearest_bts_station, best_for. Return only the JSON, no commentary.”
Result: output you can paste straight into code or a spreadsheet, with no cleanup pass.

Stack them

These techniques compound. A strong real-world prompt often layers all four: a role (“You are a visa consultant”), a couple of examples of the answer format you want, an instruction to reason through the logic before concluding, and an explicit output structure. None of this requires a paid tool or a prompting course — it requires treating the prompt itself as the first draft of the work, not an afterthought typed in on the way to the real answer.