Newer models, such as GPT-4.1, are best in class in performance and instruction following. As model gets smarter, there is a consistent need to adapt prompts that were originally tailored to earlier models' limitations, ensuring they remain effective and clear for newer generations.
Models such as GPT‑4.1 excel at closely following instructions, but this precision means it can interpret unclear or poorly phrased instructions literally, leading to unexpected or incorrect results. To leverage GPT‑4.1's full potential, it's essential to refine prompts, ensuring each instruction is explicit, unambiguous, and aligned with your intended outcomes.
Example of Unclear Instructions:
- Ambiguous:
""Do not include irrelevant information.""
Issue: GPT-4.1 might struggle to determine what is "irrelevant" if not explicitly defined. This could cause it to omit essential details due to overly cautious interpretation or include too much detail inadvertently..
- Improved:
"Only include facts directly related to the main topic (X). Exclude personal anecdotes, unrelated historical context, or side discussions."
Objective: This interactive notebook helps you improve an existing prompt (written for another model) into one that is clear, unambiguous and optimised for GPT‑4.1 following best practices.
Workflow Overview
This notebook uses the following approach:
- Step 1. Input your original prompt
- Step 2. Identify all instructions in your prompt
- Step 3. Ask GPT-4.1 to critique the prompt
- Step 4. Auto-generate a revised system prompt
- Step 5. Evaluate and iterate
- Step 6. (Optional) Automatically apply GPT-4.1 best practices
Prerequisites
- The
openai
Python package andOPENAI_API_KEY