Back to Glossary Catalog

Prompt Engineering

The craft of designing inputs that reliably steer a language model toward accurate, useful outputs.

Academic Definition

Prompt engineering is the practice of crafting, structuring, and iterating on the instructions given to a language model so that it produces consistent, accurate, and useful output, without changing the model's underlying weights. Because LLMs are highly sensitive to phrasing, examples, and formatting, small changes in a prompt can significantly change output quality. Prompt engineers work with techniques like few-shot examples (showing the model sample input-output pairs), chain-of-thought prompting (asking the model to reason step-by-step before answering), and system-level instructions (persistent rules that shape tone, scope, and safety behavior across an entire conversation). In production settings, prompt engineering overlaps heavily with evaluation: testing prompts against real user inputs and measuring failure modes before shipping.

Practical Application & Code Structure

From a Vague Prompt to a Production-Ready One:

Weak prompt: "Summarize this."

Engineered prompt:

You are a financial analyst. Summarize the following earnings call transcript in exactly 3 bullet points, each under 20 words. Focus only on revenue, guidance, and risk factors. If a category is not mentioned, write "Not disclosed."

TRANSCRIPT:
{transcript_text}

Core Techniques Used Daily:

  1. Role Assignment: "You are a..." anchors the model's tone and domain expertise.
  2. Few-Shot Examples: Providing 2-3 sample Q&A pairs before the real question dramatically improves format consistency.
  3. Chain-of-Thought: Adding "think step-by-step before giving your final answer" improves accuracy on multi-step reasoning and math tasks.
  4. Output Constraints: Explicit length, format, and structure rules (JSON schemas, bullet counts, word limits) reduce the need for post-processing.

Related Certification Programs

Featured Editorial Articles

Explore More Technical Concepts

Academic Integrity & Authority

Vetted Technical Explanations

Every term in our AI glossary is authored and reviewed by experienced data scientists and senior MLOps engineers to match standard technical paradigms and commercial industry terminology.

🎓 Verified Curriculum

Curriculum content aligned directly with real-world programming frameworks.

🛡️ ISO Standard

Quality-tested explanations designed to prevent conceptual hallucinations.

💼 Job Ready

Equipping learners with exact enterprise terminology used in modern dev teams.