prompt-eng
Glossary ↗Prompt Engineering
Prompt engineering is the discipline of crafting, testing, and iterating on the inputs sent to large language models to reliably produce the outputs a product or user needs. It sits at the intersection of writing, systems thinking, and light experimentation: a prompt engineer treats wording, structure, examples, and constraints as tunable parameters, much like a traditional engineer tunes code. For SaaS builders shipping AI features, prompt engineering is usually the first and cheapest lever to pull — before fine-tuning a model or switching providers, most output-quality problems can be fixed by rewriting the prompt. Core techniques within the discipline include being specific about the desired format (see structured output and JSON mode), providing examples (see few-shot prompting), giving the model room to reason (see chain-of-thought), assigning a persona (see role prompting), and using delimiters to separate instructions from data (guarding against prompt injection). Good prompt engineering is empirical: because LLMs are non-deterministic and sensitive to small wording changes, practitioners build evaluation sets (a fixed batch of representative inputs with expected outputs or scoring rubrics) and measure how prompt changes affect accuracy, rather than trusting a single "it worked when I tried it" test. This evaluation-driven approach is what separates production prompt engineering from casual chatbot use. Concrete worked example: a team building an AI resume-screening tool starts with the naive prompt "Is this candidate a good fit?" and gets inconsistent, unstructured answers. Through iteration they arrive at: "You are a technical recruiter. Given the job description and resume below, score the candidate 1-10 on three dimensions (skills_match, experience_match, culture_fit) and return only JSON: {\"skills_match\": int, \"experience_match\": int, \"culture_fit\": int, \"summary\": string}. Job description: {{jd}}\nResume: {{resume}}" — adding a role, explicit dimensions, a strict output schema, and delimited variables. Accuracy and consistency on their 50-resume test set jump from ~60% to ~92% agreement with human reviewers, entirely through prompt changes with no model or infrastructure change. As models improve, some manual prompt-engineering tricks (e.g., "think step by step") become less necessary, but the underlying discipline — being explicit, testing empirically, and treating prompts as versioned artifacts — remains a core AI-product skill. There's also an organizational dimension to the discipline: as a product accumulates more AI features, prompt engineering shifts from an individual developer's craft to a team practice with shared conventions, a prompt library, and code-review-style scrutiny on prompt changes, because an untested "quick fix" to a widely used prompt can silently regress accuracy for every user of that feature. Job postings for "prompt engineer" have declined somewhat as a standalone title since 2023, not because the skill matters less, but because it's increasingly treated as a baseline competency for any AI-product engineer rather than a specialized role — much like "writing SQL" moved from a specialist skill to a general expectation for backend developers.
Related terms