cd /news/large-language-models/prompt-engineering-that-actually-wor… Β· home β€Ί topics β€Ί large-language-models β€Ί article
[ARTICLE Β· art-97928] src=dev.to β†— pub= topic=large-language-models verified=true sentiment=Β· neutral

Prompt engineering that actually works (and what does not)

Full-stack and AI engineer Divyakush Punjabi outlines five prompt engineering techniques that reliably improve LLM output quality, arguing that effective prompting is a matter of specification rather than incantation. The methods include being specific about output format, using few-shot examples, enabling chain-of-thought reasoning, assigning purposeful roles, and decomposing complex tasks into simpler prompts.

read2 min views1 publishedAug 15, 2026

Prompt engineering has a bad reputation because most of it is superstition. But underneath the "you are a helpful assistant" cargo-culting, there are a handful of techniques that reliably work β€” and they're grounded in how the model actually behaves.

Let me separate the real patterns from the folklore. These are the ones that move quality measurably, not the magic phrases people paste around without knowing why. A model predicts the next token conditioned on everything before it. Your prompt is that condition. So prompting isn't casting spells β€” it's setting up a context in which the desirable continuation is the most probable one. Every technique below is just a different way of doing that.

1. Be specific about the output, not just the task. Vague in, vague out. Don't ask for "a summary" β€” ask for "three bullet points, each under 15 words, focused on financial risk." You're narrowing the probability space toward exactly what you want.

2. Give examples (few-shot). Showing the model two or three input/output pairs is often worth more than paragraphs of instruction. The model is extraordinary at pattern-matching; demonstrate the pattern and it follows. This single move fixes more formatting problems than any amount of description.

3. Let it think before it answers (chain-of-thought). For anything involving reasoning, telling the model to work through the steps before giving a final answer measurably improves correctness. Rushing straight to an answer is where models make careless mistakes β€” the same as people.

4. Assign a role with purpose. "You are a senior security engineer reviewing this code" genuinely shifts the output β€” not because of flattery, but because it conditions the model toward a specific register and body of knowledge. Use it when the framing changes the answer; skip it when it's just decoration.

5. Decompose hard tasks. Instead of one prompt that does five things, chain five prompts that each do one. Each step is easier to get right, easier to test, and easier to debug β€” the same instinct that makes good software modular, which is how I approach everything I build.

Stop thinking of a prompt as a wish and start thinking of it as a specification. The clearer and more constrained your spec, the more reliable the output. When a prompt underperforms, don't add magic words β€” add precision.

That shift, from incantation to specification, is the whole difference between prompt superstition and prompt engineering. More of how I apply it at www.divyakush.com.

Divyakush Punjabi Β· Full-Stack & AI Engineer

Portfolio Β· GitHub Β· LinkedIn

── more in #large-language-models 4 stories Β· sorted by recency
── more on @divyakush punjabi 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/prompt-engineering-t…] indexed:0 read:2min 2026-08-15 Β· β€”