Course Overview
M1: Prompt Engineering for Generative AI
1. What is prompt?
Definition: A prompt is any input you provide to a generative model to produce a desired output, acting as an instruction.
Importance: Writing effective prompts is crucial for guiding AI models to generate relevant and accurate results.
Elements of a well-structured prompt:
- Instructions: Clear guidelines for the task.
- Context: Background information that sets the stage for the output.
- Input Data: Specific information that the model can reference.
- Output Indicators: Criteria for evaluating the output, such as tone and length.
2. Prompt engineering
Definition: Prompt engineering is the process of designing effective prompts to guide generative AI models in producing relevant responses.
Importance: It is crucial for optimizing model efficiency, boosting performance for specific tasks, understanding model constraints, and enhancing model security.

Well-structured iterative process
The process involves several steps:
- Define the goal: Clearly establish what you want the model to generate.
- Craft initial prompt: Create a prompt that reflects your goal.
- Test the prompt: Analyze the response to see if it meets your expectations.
- Analyze the response: Review the output and identify areas for improvement.
- Refine the prompt: Modify the prompt based on your analysis.
- Iterate: Repeat the testing and refining process until satisfied with the response.
- Example: A ship captain needing a precise weather forecast must provide detailed context in the prompt to get accurate results.
Importance of prompt engineering
- Optimizing model efficiency