Lesson 7: Retrieval - Practice
45 minutes
Overview
This Practice lesson builds fluency in designing and applying retrieval statements, expanding the knowledge students developed in the previous lesson. Through examples and guided practice, students explore how retrieval can be used to provide current, specialized, and accurate information, helping to reduce the occurrence of AI hallucinations. Students apply these skills through practice scenarios simulating real-life use cases and user-stories, emphasizing the use of trusted real-world data sources (ie: copy-and-pasting accurate sentences) is an effective strategy to address real-world issues.
Agenda
Objectives
Students will be able to:
- Identify scenarios where retrieval is essential for updating chatbot information
- Use retrieval to provide current, specialized, and accurate information to chatbots
Preparation
- Run through the slide deck and videos ahead of time
- Review the Level Guide Exemplar
- (Optional) Print out the slide deck with speaker notes as a resource during class. Click here for steps on how to do this.
Links
Heads Up! Please make a copy of any documents you plan to share with students.
For the teachers
- Retrieval - Practice - Slides
Teaching Guide
Warm Up (5 minutes)
Slide | Lesson Guide |
Discuss: Have you ever asked a question online and received outdated or incorrect information? How did that impact what you were trying to accomplish?
Discussion Goal: This question is similar to the warm-up yesterday, referencing the fact that chatbots don’t have current information. In this discussion, focus on real-world examples and the impact this misinformation could have on problems they are trying to solve. For example, having outdated weather information meant that you needed to cancel a party or buy additional supplies to handle the weather on a particular day. Focusing on the connection to students’ lived experiences and the impact will tie into the focus on user-stories and real-world scenarios in today’s lesson. |
|
Say: We know retrieval can update what a chatbot knows and can respond with, but what are the situations where this is most valuable - or even necessary? Today we’ll explore several examples where retrieval is highly important, and why it can be a strong asset to a chatbot.
Question of the Day: When is retrieval most useful in solving a problem? |
Activity (35 minutes)
Student Levels
Getting Familiar: These are the levels students will complete throughout the lesson. We recommend briefly exploring the levels yourself before reading the rest of the lesson plan. Some levels are meant to be completed independently by students, but others are meant to motivate class discussion or lead to moments of direct instruction in the slides. Very rarely should students be working through levels completely self-paced.
Teacher Exemplars: Verified teachers can access exemplar responses and "what success looks like" tips for each level in the Links section of the lesson plan. If the resource doesn't appear for you, you may need to become a verified teacher - learn more about this process here.
Teaching with Student Responses: Certain level types are designed to be leveraged with our Student Summary feature, specifically: Predict & Discuss and Mid-Lesson Check-In levels. You can read more about how to leverage student voices during these levels in the Teaching Guide - Incorporating Student Responses in Lessons
Teaching Guide
Slide | Lesson Guide |
Navigate: Go to Lesson 7 Level 1. Students will complete levels 1-2, which emphasizes using retrieval for current up-to-date information.
Do This: Complete levels 1-2 Circulate: Check-in with students as they complete each level. If you notice multiple students struggling with this string of levels, consider regrouping and completing them as a class. Otherwise, continue to the next slides as the class progresses. |
Teaching Tip: Building Fluency - This lesson is a strong candidate to let students work at their own pace as they build fluency and problem-solve on their own. Consider regrouping the class only if there seems to be a larger misconception that needs clarifying. Otherwise, it may be better to spend class working with students who need additional support based on yesterday’s lesson and the check-in level. Verified teachers can review exemplars and strategies for each level as a resource in the lesson plan.
Teaching Tip: Less Writing, More Copying This lesson implicitly encourages students to spend their time searching for sources and copying directly from them, rather than trying to write retrieval information themselves (which is mostly what they did yesterday). This correlates to how retrieval works in a more realistic sense with actual language models: instead of looking at individual words or statements, modern large-language models ingest entire documents or manuals or websites in order to augment their knowledgebase. For that reason, try to encourage students to put their energy into finding quality sources (like websites or books) to copy from, since this is the more realistic behavior of language models outside of this lab.
Navigate: Go to Lesson 7 Level 3. Students will complete levels 3-4, which emphasizes using retrieval for specialized information
Do This: Complete levels 3-4 Circulate: Check-in with students as they complete each level. If you notice multiple students struggling with this string of levels, consider regrouping and completing them as a class. Otherwise, continue to the next slides as the class progresses. |
|
Navigate: Go to Lesson 7 Level 5. Students will complete levels 5-7, which emphasizes using retrieval for accurate information to avoid bias or hallucinations.
Do This: Complete levels 5-7 Circulate: Check-in with students as they complete each level. If you notice multiple students struggling with this string of levels, consider regrouping and completing them as a class. Otherwise, continue to the next slides as the class progresses. |
Teaching Tip: Connecting to Previous Lessons - When teaching about hallucinations, one possible direction that discussions may have gone is "misinformation" and ensuring that accurate information is available when needed. One place where this conversation appears frequently is in the context of elections, which is the context of Lesson 7 in this lesson. If you and your students spent time discussing misinformation during previous lessons, consider highlighting the role of retrieval in helping to ensure accurate information from chatbot sources. If your class is interested in continuing to explore the intersection of AI and elections, consider exploring the AI and Elections lessons from Day of AI
Ethics Opportunity: Real-World Connection - Level 5 is framed a real-world scenario where an airline used a customer-service chatbot to answer questions and the chatbot gave incorrect information to a customer. This scenario has a relatively happy ending, since the customer was able to sue the airline to make sure they honored the chatbots response (you can read the article here). However, consider asking students to imagine other scenarios where a chatbot could give incorrect information and imagine the consequences. Encourage students to consider how not every consequence has the same "weight" or impact - for example, a chatbot that tells you the wrong time for a movie may be less impactful than a chatbot that tells you the wrong time for an airline flight needed to attend an important event. A later lesson in this unit - Lesson 13: User Testing - will address these types of impacts more deeply and ask students to decide whether a chatbot should be used in certain situations at all.
Navigate: Go to Lesson 7 Level 8
Do This: Answer the check-in question, then continue to the practice levels |
Assessment Opportunity: Formative Assessment - This scenario touches on several ways that retrieval can be useful: accurate information to avoid bias based on cultural misrepresentations, specialized information from a master artist, and current information since modern practices may be different from historical ones. Look for responses that identify at least one of these aspects in the scenario and provide specific suggestions of how retrieval can help counteract these issues. After students answer this question and as they work on the remaining levels, try to check how students answered this question so you can decide if you need to make this point directly with students. Check the Generative AI - Teaching Guide for Student Responses for more information about how to use Code.org’s teacher dashboard to view this data and potentially differentiate your instruction with students.
Navigate: Go to Lesson 7 Level 9. These choice levels let students continue developing their skills with less scaffolding in the levels.
Do This: 1) Choose at least 2 levels to practice. 2) Make sure to leave time to complete the next level (Assessment) before class ends |
|
Navigate: Go to Lesson 7 Level 10.
Do This: Complete level 10 |
Assessment Opportunity: Assessing Retrieval - This level can be used to assess students understanding of retrieval so far. We recommend checking just this level as opposed to every level in this lesson.
Navigate: Go to Lesson 7 Level 11. These choice levels let students continue developing their skills with less scaffolding in the levels.
Do This: Complete as many of these as you have time for. They can be challenging! |
Wrap-Up (5 minutes)
Slide | Lesson Guide |
Discuss: Which chatbot level from today felt the most interesting and relevant to the things you or your community cares about? If there weren’t any levels like this: what’s something you wish was explored in a level today?
Discussion Goal: This can be discussed in small groups or written as a journal prompt and submitted. The goal is to connect the skills students are learning to a real-world interest they have, potentially seeing themselves or a community member as a “user-story” supplied in these levels. Encourage students to make connections with how these skills might help themselves in their personal or future professional lives, or how there may be gaps in what chatbots are being used for and they have an opportunity to change that. |
|
Question of the Day: When is retrieval most useful in solving a problem? |
This work is available under a Creative Commons License (CC BY-NC-SA 4.0).
If you are interested in licensing Code.org materials for commercial purposes contact us.