All lessons in AI Engineering: From Foundation Models to Evaluated Applications

Prompt Design and Structured Outputs

Design and version prompts whose outputs can be checked against a task contract.

60 minutes · Members lesson · preview

What you will learn

  • Write a prompt that specifies a bounded task, evidence use, output contract, and unavailable-answer behavior.
  • Choose examples and decomposition steps that address observed failures without leaking evaluation answers.
  • Compare versioned prompts using structural and task-level checks on the same development cases.

Your selected model can answer policy questions, but the prompt says only be helpful and concise. Sometimes the response explains the rule, sometimes it guesses missing facts, and sometimes it returns a paragraph where your application expects structured fields. The model has been given a broad social instruction rather than a precise task.

This lesson teaches prompt design as part of an application contract. You will write instructions, choose examples, and version a controlled change. P04 is the separate practice in which you build and evaluate a structured extraction application. The examples here use fictional support policy and supplied outputs; no external model has been run to produce the stated scores.

Choose another lesson