Prompt Engineering

Prompt engineering is the practice of writing the instructions, context, and examples that steer a generative model. You are not changing the model’s weights. You are changing what it sees before it answers.

What a good prompt contains

  • Role. Who the model should act as, such as a credit analyst writing for a committee.
  • Task. The exact job, such as summarize, extract, classify, or draft.
  • Context. The source text, the policy, or the numbers it must use.
  • Constraints. Length, tone, what to leave out, and what must be quoted from the source.
  • Output shape. Headings, a table, or a fixed list of fields so the result is easy to reuse.

Zero-shot and few-shot

Zero-shot means you describe the task and give no worked example. Few-shot means you include two or three examples of input and the answer you want. Few-shot helps when the format is strict, such as tagging a sentence as positive, neutral, or negative and returning only that word.

A practical example

Weak prompt: “Summarize this.” Stronger prompt: “You are writing for a credit committee. Summarize the memo in five bullets. Use only facts stated in the memo. End with one line labeled Open questions. Do not recommend approve or decline.”

When a prompt is not enough

  • The facts live in your documents and change often. Use retrieval (RAG).
  • You need a stable style or skill across thousands of calls. Consider fine-tuning.
  • The task needs a calculator, a database, or a search tool. Use an agent or a tool call.

What to remember

  • A prompt is an interface. Clear task, source, and format beat clever wording.
  • Examples teach format faster than a long description.
  • Prompting does not update the model. It only guides this request.