Absolute Path

Prompt design

Write instructions that give a model a good answer each time, and test them.

A prompt is the text that a model gets. A small change in it can change many answers. In this course you measure a prompt on a test set, read the wrong answers, and improve the prompt in small steps. You write rules and examples, mark the data, compare versions, and count what a longer prompt costs. The lessons use a simulated model that follows fixed rules, so each result is the same on each run. Do the course Model APIs first.

  • Intermediate
  • 12 lessons
  • 3 h 11 min
  • Free

Not started

Start the course

Lessons

  1. 1What a prompt isSend a prompt and a comment to a model, and count the answers that are wrong.
  2. 2Measure before you changeRun a prompt on a test set, calculate its accuracy, and group the wrong answers by their kind.
  3. 3Rules for the hard casesFind the cause of a group of wrong answers, add one rule to the prompt for each cause, and measure again.
  4. 4One change at a timeCompare the rows of two prompt versions, find what a change fixed and what it broke, and replace a rule that is too wide.
  5. 5Examples in a promptBuild a block of examples for a prompt, repair a comment that no rule describes, and count the tokens that the examples add.
  6. 6A second test setMeasure two prompts on comments that you did not use for the prompt, find the change that did harm, and choose a version.
  7. 7Mark the dataSee how a comment can give instructions to a model, and protect the prompt with tags and a rule about data.
  8. 8Templates and versionsBuild prompts from parts with one function, give each version a name, and compare the versions on the test set.
  9. 9The cost of a promptCalculate what each prompt version costs for 100,000 comments, and compare a good prompt on the small model with the large model.
  10. 10Prompts for textWrite rules for a reply that a model writes, check the reply in code, and use a safe text when a rule is broken.
  11. 11Quiz, Prompt designQuizTwelve questions on test sets, rules, examples, data in a prompt, versions, cost, and prompts for text.
  12. 12Project: a prompt inside a budgetProjectTest combinations of rules and examples on two test sets, and choose the prompt that reaches the accuracy limits inside a token budget.