Prompt engineering
Prompt engineering is the practice of designing input text that reliably steers a large language model toward a specific output.
Prompt engineering is the discipline of writing, testing, and refining the instructions sent to a large language model so it produces the output you want. It combines linguistic precision (clear verbs, explicit constraints), structural design (system vs. user messages, examples, output format), and empirical iteration (A/B test prompt variants on real inputs). Strong prompt engineering reduces hallucinations, lowers token cost, and makes model behavior predictable across runs. It is now a core skill for any team building on top of GPT, Claude, Gemini, or open-source models.
When to use prompt engineering
- Productionizing any LLM feature (chatbots, agents, content generation, classification).
- Migrating between models (the same prompt rarely performs identically on GPT and Claude).
- Reducing cost — a tighter prompt often beats fine-tuning for ROI.
Common mistakes
- Treating prompt engineering as a one-shot task instead of an iterative loop with evals.
- Stuffing the system prompt with rules instead of supplying examples.
- Skipping output format constraints (JSON schema, bullet count, max length).
FAQ
What is prompt engineering?
Prompt engineering is the practice of designing input text that reliably steers a large language model toward a specific output.
When should I use prompt engineering?
Productionizing any LLM feature (chatbots, agents, content generation, classification). Migrating between models (the same prompt rarely performs identically on GPT and Claude). Reducing cost — a tighter prompt often beats fine-tuning for ROI.
What are the most common mistakes with prompt engineering?
Treating prompt engineering as a one-shot task instead of an iterative loop with evals. Stuffing the system prompt with rules instead of supplying examples. Skipping output format constraints (JSON schema, bullet count, max length).
Related terms
- Chain-of-thought prompting — Chain-of-thought (CoT) prompting tells a language model to write its reasoning steps before its final answer, increasing accuracy on multi-step problems.
- Few-shot prompting — Few-shot prompting supplies 2–10 input–output examples inside the prompt so the model imitates the pattern on a new input.
- System prompt — A system prompt is the high-priority instruction block that defines a model's role, constraints, and default behaviors for an entire conversation.
- Temperature — Temperature is a sampling parameter that controls randomness in a language model's output, where 0 is fully deterministic and higher values introduce more variety.
- Retrieval-augmented generation (RAG) — Retrieval-augmented generation (RAG) injects relevant documents into the prompt at query time so the model answers from your data instead of its training memory.
Sources
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/prompt-engineering.md.