Module resources
Prompting and structured output
Checked sources to go further than the lessons. Back to the module.
Recommended learning sequence
Work through these in order.
Prompt Engineering (opens in a new tab)
Start with one survey of the ground: zero-shot, few-shot, instruction prompting, self-consistency and chain-of-thought in a single article, so the two lessons have a map.
Prompt engineering overview (opens in a new tab)
Official guidance next, with its point that you define success criteria and a way to test against them before you tune a prompt. Repeated on purpose from lesson 1 because it sets the order of work.
Anthropic's Interactive Prompt Engineering Tutorial (opens in a new tab)
Practise the lesson 1 habits (separating data from instructions, examples, thinking step by step) in exercises before reading the papers. It was written for Claude 3 models (its README uses Claude 3 Haiku), so follow the Prompting best practices page where the two differ. Repeated on purpose: this is where practice belongs in the order.
Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (opens in a new tab)
Then read the paper behind chain-of-thought. After the exercises you know what a worked example looks like, so the results are easier to read. Repeated on purpose from lesson 1, because the paper belongs at this point in the order.
Reasoning models (opens in a new tab)
Move to reasoning models: what they cost in reasoning tokens and how prompting them differs. This is the bridge from lesson 1 to lesson 2. Repeated on purpose from lesson 2, because it sets up the structured-output step.
Structured outputs (opens in a new tab)
Finish with structured output: how a schema constrains the reply, and which limits remain. Then try a library from the items list to validate real replies. Repeated on purpose from lesson 2, as the closing step of the order.
All resources
Official documentation
Prompt engineering (opens in a new tab)
A second vendor's view of the same craft, including the advice to pin to model snapshots and build evals. Repeated on purpose from lesson 1 so you can compare it with the Claude guidance.
JSON Schema reference (opens in a new tab)
The schema language that structured-output features describe your format in. Reading the type and enumerated-value keywords helps you write a schema the lesson 2 options can enforce.
The validation half of structured output: how to turn a JSON string into a checked object and read every error. Repeated on purpose: lesson 2 names Pydantic as the way to validate output in its validate, retry and fall back loop.
Further reading
Your AI Product Needs Evals (opens in a new tab)Essential
An engineer's account of how a team moved from trying prompts by hand to unit-test style assertions on outputs, with the Rechat assistant as the example. It makes lesson 1's measure-do-not-guess habit concrete.
Prompt Engineering Guide (opens in a new tab)
A broad reference on zero-shot, few-shot, chain-of-thought and self-consistency prompting, with example prompts, to look up a technique after lesson 1. It is a community guide from DAIR.AI and also promotes paid courses.
Explains greedy search, beam search and sampling, with temperature and top-k. This is the mechanism behind why the same prompt can give different replies, and why self-consistency samples several. Repeated on purpose from a later module's lessons.
Research papers
Lost in the Middle: How Language Models Use Long Contexts (opens in a new tab)
Shows that models use information at the start or end of a long input better than information in the middle. It gives evidence for where to place instructions and data in a long prompt. Repeated on purpose from a later module's lessons.
Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena (opens in a new tab)
Studies using a strong model to grade other models' answers and lists the biases of that method. Read it before you let a model score your prompt experiments. Repeated on purpose from a later module's lessons.
Hands-on
instructor: structured outputs for LLMs (opens in a new tab)
A Python library (with ports in other languages) that returns typed, validated objects from model replies and uses Pydantic models. A practical way to try the validate-and-retry loop of lesson 2 on your own data.
outlines: Structured outputs for LLMs (opens in a new tab)
A Python library that constrains model output to a type such as a Pydantic model, so replies are valid by construction. It is the library side of the guided-generation idea in the Willard paper.
Courses
ChatGPT Prompt Engineering for Developers (opens in a new tab)
A short video course with code examples on writing clear instructions and iterating on prompts for summarizing, inferring and transforming text, using the OpenAI API. The page says access was free for a limited time and the graded assignment and certificate need a PRO membership.