Skip to content

Prompt Engineering Textbook

A free, self-paced textbook in 6 chapters. Read a chapter, then drill it with the 103 companion flashcards using spaced repetition.

6 chapters · 103 cards · Updated

Chapters

  1. 1Foundations of Prompting

    A prompt is the input text or instruction given to an AI language model to guide its response, and prompt engineering is the practice of designing, crafting, and optimizing those i...

  2. 2Core Prompting Techniques

    Prompting strategies differ in how much guidance they provide. In zero-shot prompting, the model performs a task using only its pre-trained knowledge, with no examples at all. One-...

  3. 3Reasoning and Decomposition Strategies

    For complex tasks, the model often benefits from being asked to reason explicitly. Chain-of-thought (CoT) prompting instructs the model to reason step-by-step before giving a final...

  4. 4Generation Parameters and Context Management

    Beyond the words of the prompt itself, generation parameters strongly influence output. Temperature is a parameter that controls randomness: lower values yield more deterministic o...

  5. 5Reliability, Safety, and Robustness

    A key failure mode of language models is hallucination, in which the model generates confident but factually incorrect information not supported by its training data or the context...

  6. 6Advanced Methods, Tools, and Automation

    As prompting matures, more techniques systematize and automate the process. DSPy, a framework from Stanford, replaces manual prompt writing with programmatic prompt optimization us...

← Back to the Prompt Engineering deck