prompt engineering
/ PROMPT en-jih-NEER-ing /
Prompt engineering is the craft of phrasing your request so that a language model gives you the answer you actually want. The same model, asked the same underlying question, can produce a vague ramble or a crisp, useful reply depending entirely on how you word the prompt — what role you assign it, how much context you supply, what format you demand, whether you show an example. Since you can't reach inside the model, the prompt is the steering wheel you do have.
In practice it is a grab-bag of reliable habits more than a science: be specific about the goal and the audience; state the desired format ("answer in a three-row table"); give an example or two of what good looks like (few-shot); ask the model to reason step by step for hard problems; tell it what to do when unsure. Each of these reshapes the patterns the model falls into, and small wording changes can swing the output more than newcomers expect.
Keep it in perspective, though. Prompt engineering can coax a model toward better behavior, but it cannot give the model knowledge it lacks or stop it from confidently inventing facts. No prompt reliably eliminates hallucination, and clever phrasing is not a security boundary — "prompt injection," where hostile text smuggled into the input hijacks the instructions, remains a genuine risk. Think of prompting as skillful asking, not as programming.
Weak prompt: "Tell me about dogs." Better: "You are a vet. In 4 bullet points for a first-time owner, explain how often to feed a puppy, using plain language and no jargon." Same model — the second prompt produces a far more usable answer.
Role + format + audience: the same model, a much better answer.
Prompt engineering reshapes how a model answers, not what it knows. A polished prompt still can't make the model recall facts it never learned, and it offers no protection against prompt injection — never trust a model with an action just because its prompt told it to be careful.