--- title: Debugging and Refining Outputs units: [Problem Solving With AI] summary: You can improve AI's responses. weight: 80 --- {{% param summary %}} ## Today's Objectives - Apply debugging techniques to improve AI-generated responses. - Explain how prompt refinement improves AI outputs. ## Lesson Overview ### What is prompt engineering? {{% define "Prompt Engineering" %}} Watch on YouTube: [AI’s Hottest New Job Pays Up to $250K a Year. So I Applied. | WSJ](https://www.youtube.com/watch?v=whkge1rEamU) ### What are the key elements of a prompt? {{< collapse summary="Click here to reveal the answer." >}} Just remember, TaCoFoRT: - **Ta**sk: Specific and actionable instructions - **Co**ntext: Relevant background details - **Fo**rmat: How the response should be structured - **R**eference: Additional examples or resources - **T**one: The style in which the output is given {{}} ### How do you refine a prompt? {{< collapse summary="Click here to reveal the answer." >}} - Test - Observe the output - Update your input - Repeat until you get the desired result {{}} ## Assignment {{% instructions-unit-journal-update %}} {{% unit-journal-define-terms "Prompt Engineering" %}} ### Five Key Elements of a Prompt Refine the following prompts using each element, then record your revised prompt and how refining it improved the AI's output. - Task: "Help me clean my room." - Context: "You are a marketing executive at a sportswear company. Come up with a slogan for a new running sneaker." - Format: "You are a professional food critic. Generate some ideas for how to evaluate a new restaurant." - Reference: "You are an architect planning a building downtown. Figure out how many shops can fit on the ground floor of the new building, which is the size of a football field." - Tone: "You have been selected as a host for an awards ceremony. Prepare your opening speech." {{% instructions-code-org-update %}} {{% unit-journal-question-of-the-day question="How can you improve AI's responses?" %}}