Skip to Main Content

Artificial Intelligence: Research, Writing, Teaching, & Ethics

Summary of Google's Prompt Engineering Course

Prompt Engineering Basics

5 Step Framework for Prompt Engineering

  1. Task - what you want the AI to do
    • Persona - give the AI a role to embody for more specific results
    • Format of output - request something more structured, such as a table
  2. Context - the more context you provide, the better the output
  3. References - provide examples that would be included
  4. Evaluate - after getting the output, really look at it and determine if this is what you were looking for
    • Check for hallucinations
    • Check for bias - AI is trained on human created content, and comes with biases of race, gender, and more
  5. Iterate - prompting is rarely done after the first search. Always add more detail and try again!
    • Revisit the promoting framework, go through the 5 steps again
    • Separate the prompt into shorter sentences, feed to the AI slowly
    • Try different phrasing to make output more compelling (example, instead of asking for a marketing plan, ask to describe how the product fits into the lives of customers)
    • Introduce constraints

Prompt Chaining

Chaining guides GenAI through interconnected prompts to add complexity. Example: Combine the previous three suggestions with a focus on _____. Find the catchiest and most impactful combination.

  • Chain of thought prompting - ask the AI to explain it's reasoning as a step by step process. Let's you understand more and prompt further.
  • Tree of thought prompting - lets you explore multiple paths simultaneously and brainstorm different options.

Examples

Interview Example - Gemini:

 

Practice Test Example - Claude: