Skip to content

Chapter 1 of 6

Foundations 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 inputs to elicit desired outputs. At its core, prompt engineering relies on the instruction-following paradigm, which is a model's ability to follow explicit, structured directions without needing examples to demonstrate the task. Prompts themselves come in several forms. A completion-style prompt presents an incomplete sentence or document that the model finishes naturally, while an instruction-style prompt directly commands the model to do something, such as "Summarize the following text in three bullet points." A dialogue-style prompt structures the input as alternating user and assistant turns to provide conversational context. The difference between a directive and a query is also meaningful: a directive tells the model what to do and tends to yield more controlled outputs, while a query merely asks a question.

Beyond raw instructions, the framing of a prompt shapes the model's behavior. Role prompting assigns a specific persona, such as "You are an expert Python developer," to influence the response's style and depth. This idea extends into the persona technique, where the model adopts a particular identity, and into the expert framing technique, where a question is prefaced with phrases like "As an expert in X" to elicit domain-specific knowledge. In multi-turn systems, the system prompt is a set of instructions given before the conversation begins, defining behavior, persona, and constraints for the entire session, while the user prompt is the message the human sends to express a request, question, or task. Audience specification, where the prompt tells the model who will read the output, further refines tone and complexity, helping the model calibrate its language to the intended reader.

All chapters
  1. 1Foundations of Prompting
  2. 2Core Prompting Techniques
  3. 3Reasoning and Decomposition Strategies
  4. 4Generation Parameters and Context Management
  5. 5Reliability, Safety, and Robustness
  6. 6Advanced Methods, Tools, and Automation

Drill it

Reading is not remembering. These come from the Prompt Engineering deck:

Q

What is a prompt?

A prompt is the input text or instruction given to an AI language model to guide its response.

Q

What is prompt engineering?

The practice of designing, crafting, and optimizing input prompts to elicit desired outputs from AI language models.

Q

What is zero-shot prompting?

Asking the model to perform a task without providing any examples, relying solely on the model's pre-trained knowledge.

Q

What is one-shot prompting?

Providing exactly one example of the desired input-output pattern before asking the model to complete a new task.