Build AI Systems for Discernment, Not Approval - Angel Ortmann Lee, Duolingo

AI Engineer · 25 min · 234 sentences · from YouTube's caption track

Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.

  1. 00:00Hello, my name is Angel Ermanlee, and I'm a software engineer at Duolingo.
  2. 00:05I work on security for the Duolingo English Test.
  3. 00:08Today's talk is the human in your loop isn't thinking.
  4. 00:11Build AI systems for discernment, not approval.
  5. 00:15So, let's get started with some background.
  6. 00:18What is human-in-the-loop AI?
  7. 00:20Human-in-the-loop AI is a framework where a system or process is actively involving a human who's participating in the operation, supervision, or decision-making for an automated system.
  8. 00:30Humans are involved because they're able to ensure the accuracy, safety, or ethical decision-making for that system.
  9. 00:37They are a piece of that decision-making where AI normally falls short.
  10. 00:43You can kind of think of this as a linear process where a model provides some sort of output, and a human sees that and makes a decision.
  11. 00:52Now, in the age of AI, trust is a big part of the conversation.
  12. 00:55Recently, as technology has developed, a lot of things that used to be manual cognitive tasks are now part of technology.
  13. 01:03So, no one really memorizes phone numbers anymore.
  14. 01:05They're just sitting in our contact list on our smartphones.
  15. 01:08When you're driving over somewhere, you just put the directions into your GPS, and you don't really think about the details of that route.
  16. 01:15Instead, you just trust the GPS to come up with the optimal way for you.
  17. 01:19When you're searching something in the search engine, you used to look at the top results, and now, as AI is becoming more increasingly integrated into our day-to-day life, you might be seeing some AI summaries at the top instead.
  18. 01:32Here's an example of Googling COVID-19 symptoms, and you see that Gemini summary at the top.
  19. 01:38And instead of looking at the CDC website or the WHO website, you might actually look to that as your final answer to the question that you were asking to the search engine.
  20. 01:48And as these pieces of AI are becoming more integrated into your day-to-day life in these atomic little things like searching for an answer or getting a result from an app,
  21. 02:00your trust of AI systems will increase and caution will decrease.
  22. 02:03And this is something that's happening across all of society.
  23. 02:07A study at Wharton was looking exactly that.
  24. 02:10How is AI reshaping human reasoning and what does it mean for us as we continue to use it day-to-day?
  25. 02:17They've observed an interesting phenomenon called cognitive surrender.
  26. 02:20When a human foregoes deliberation and adopts AI output as their own with minimal scrutiny.
  27. 02:27They saw this in a study where humans were asked to look at reasoning exams and they were given AI resources to answer those questions.
  28. 02:35They realized that AI can either supplement or supplant a human's thinking and the human might not even know it's happening.
  29. 02:42For example, for questions where the AI was right, the human performance increased by 25 percentage points.
  30. 02:50Whereas when the AI was wrong, it decreased by 15.
  31. 02:53This suggests that the humans were taking in that AI cognition and not really thinking critically about what that answer is and instead using those answers as part of their own
  32. 03:05reasoning together with their human instinct and deliberate reasoning amplifying those results.
  33. 03:13Most interestingly, they saw that 80% of participants were accepting those AI answers even when they were wrong.
  34. 03:20So, they were lowering that barrier to entry and just trusting the AI even if they weren't really critically examining the correctness of that result.
  35. 03:31So, at the Duolingo English Test, we wanted to look at the same thing and we published some research titled When Machines Mislead.
  36. 03:39It was a case study on the English exam, specifically in AI human interaction.
  37. 03:45So, for context, what is the DET?
  38. 03:47The DET is a high-stakes exam for that measures your English proficiency and it's fully online and remotely proctored.
  39. 03:55You can take it on your own machine in the comfort of your home and it still provides high-quality results that 6,000 programs worldwide are trusting day-to-day.
  40. 04:06As you can imagine with a fully online assessment, there are some interesting things that from a technological standpoint that have to happen to ensure good quality security.
  41. 04:16This includes identity verification, a lockdown testing environment, as well as a variety of ways in which AI assisted monitoring is happening to predict different types of cheating.
  42. 04:27Lastly, we have a final round of scrutiny where we have human proctors review all of the video footage of the exam as well as all of those AI results.
  43. 04:40Specifically for the study, we wanted to target one of our AI cheating detection detection systems, which is copy typing.
  44. 04:48Copy typing is a form of cheating where you're writing down uh information that you're reading currently and supposed to something that you're thinking right now at this moment.
  45. 04:57So, as you can imagine, your typing patterns differ when you're transcribing versus composing.
  46. 05:03And this is something that our custom model is measuring.
  47. 05:06It's looking at anomalies in keystroke patterns and it's flagging them for uh sessions that are unusual.
  48. 05:13So, our model is highly conservative and so we're prioritizing fairness for our test takers.
  49. 05:20Uh so, this is not a very common flag.
  50. 05:23However, when humans are human proctors are taking a look at these, they're well trained to um properly examine those segments and see if this is a flag.
  51. 05:33So, for experiments, we wanted to answer the question, would a skilled reviewer catch a false alarm or would they just rubber stamp it?
  52. 05:41So, we know that our proctors are highly accurate at detecting various forms of cheating.
  53. 05:46We wanted to see specifically if we give them a fake signal, how well would they be able to discern that this is totally legit session.
  54. 05:54The way we did that is by selecting sessions that had no cheating whatsoever.
  55. 05:59They were totally okay, and we made it look like they have this AI signal that says, "Hey, check if there's copy typing behaviors present at a specific moment."
  56. 06:09We presented them to the proctors as part of their normal workflow.
  57. 06:14They thought it was just another session that they were taking a look at.
  58. 06:17Um and this did not impact our test takers in any way.
  59. 06:21Their results were quite interesting.
  60. 06:23So, we found that despite the fact that our human reviewers are consistently scoring above 90% on their accuracy calibration metrics, they actually accepted 50% of these fake signals, meaning they were falsely accusing people of cheating half half the time.
  61. 06:40And this coin flip rate is something that is a strong suggestion of automation bias.
  62. 06:47This means that they're deferring their judgment to AI uh without giving a second thought to whether or not that there's evidence to corroborate this and if this is a true
  63. 06:58uh cheating session.
  64. 07:00Uh again to reiterate, these were not sessions that were actually going to our test takers.
  65. 07:04These were historical sessions, so there was no impact to our customers.
  66. 07:08However, this is something that was definitely very alarming to the team because in a high-stakes exam where these results are going to influence college admissions and visa decisions, this is not something that we can take uh we can just accept.
  67. 07:24We knew that the problem was not the model.
  68. 07:26Our model has a 1% false positive rate, and also these were sessions that were negatively predicted.
  69. 07:32We knew that our problem was not the people.
  70. 07:34Our people are highly skilled and very experienced with detecting cheating.
  71. 07:38So, we wanted to take a look at the interface, and that's where we targeted our solution.
  72. 07:44So, we decided to take a look a look at the human-AI interaction loop.
  73. 07:49Specifically, our proctors are given a series of guidelines about how to interact with the system that they have.
  74. 07:55And we wanted to just update that proctoring guideline to emphasize two things.
  75. 08:00First, the AI signal is just a preliminary alert.
  76. 08:03They're the final decision-maker.
  77. 08:05And second, when they're making that decision, they must find independent evidence in the video footage before upholding a flag.
  78. 08:12This simple copy change led a 21% increase in rejection rates, meaning that from 50% only half of sessions that were rejected uh the majority 71 were now determined to be totally okay.
  79. 08:29And this is really good because it is more closely matching sessions in production.
  80. 08:36And for an engineer, this means that we didn't have to tweak the model and we didn't have to tweak uh the UI in some way.
  81. 08:43We simply had to take a look at the copy change and this really changed the way that people were interfacing with that AI result.
  82. 08:51So, what are the implications of this?
  83. 08:55As an AI engineer, your interaction loop determines how effective your AI system is and also what you can learn from it.
  84. 09:03The way that you measure efficacy and the way that you can uh and the data that you collect from that to then drive your next iteration are really important.
  85. 09:13Earlier we talked about the uh human in the human in the loop AI as a linear interaction where a model goes to a human goes to a decision.
  86. 09:23However, in reality that process isn't linear, it's cyclical.
  87. 09:28Models provide some sort of output that goes into an interaction that goes into a human behavior which yields data for your evals and then later on your model.
  88. 09:38You can't really change the way a human behaves unless you are that human.
  89. 09:42But, what you can do is tweak that interaction such that it can elicit different results from that human behavior.
  90. 09:48And that data is golden.
  91. 09:50It leads to better analytics, model improvements, and future iterations, including the next generation of your model, or maybe some different product.
  92. 10:00Now, zeroing in on that interaction portion, we can look at how to evaluate your system.
  93. 10:06Ask yourself a question, "How can I measure and improve the efficacy of my AI system?"
  94. 10:11Looking at structured interactions that were designed intentionally, you can see that those interactions yield good data that are labeled signals that can then become training data and evals for a better model.
  95. 10:24And that is a flywheel that compounds.
  96. 10:26As you have the better model, you can have better data that then has better interactions with your human, which then continues to cycle.
  97. 10:34Think of your structured interactions as a system property that specifically yields high-quality data.
  98. 10:41That high-quality data is unlocking meaningful insights and quicker development iterations.
  99. 10:46You're not going to be spending days cleaning your data or trying to find useful insights.
  100. 10:51Instead, you're going to have structured data that is directly impacting your next iteration.
  101. 10:58And this is a compounding effect.
  102. 11:00Uh and it's cyclical.
  103. 11:02If you are not being intentional with that design, you can get stuck in a vicious cycle where your model is making confident calls, and because your interface is not actually
  104. 11:12uh eliciting that deliberation from a human, they just end up rubber stamping it.
  105. 11:16And that positive signal is logged as truth.
  106. 11:19So, over time, your model becomes more confident, and the human is not encouraged to think further.
  107. 11:25So, they continue to defer to the AI, and the AI becomes the person in the driving seat.
  108. 11:31Uh instead, what you want is a virtuous cycle.
  109. 11:34Uh, if you have an interface that forces independent judgment, uh, this allows the human to really think critically about the decisions they're making and have real disagreements surface.
  110. 11:44That means that you have true positive and negative labels that are honest and get logged to then continue to have model improvements that are targeting exactly where the model goes wrong.
  111. 11:56So, let's take a look at some examples.
  112. 11:59For example, we have other cheating flags that are driven by AI.
  113. 12:04As an example, we have headphone detection.
  114. 12:06On the left, you can see, uh, a bad pattern that we had where we were saying, "Hey, the model detected headphones at this moment.
  115. 12:14Can you flag it here?"
  116. 12:16And it was just asking a simple yes or no question.
  117. 12:19We realized that there's actually two questions hidden in this single, uh, single CTA.
  118. 12:25Uh, one, we're asking headphones were detected.
  119. 12:28Is that true or false?
  120. 12:30Uh, did the model correctly predict that at this video segment there are some set of pixels that look like headphones?
  121. 12:36And secondly, are we applying a flag that this person had a violation for it not correctly using headphones at this moment?
  122. 12:46Why is this important?
  123. 12:47For example, if there's somebody who has a hearing aid, that means that the model correctly predicted that there are headphones or earbuds detected.
  124. 12:55Uh, that is a true signal.
  125. 12:58However, we don't actually want to penalize this person for wearing, uh, hearing aids.
  126. 13:03So, we don't want to flag them for a violation.
  127. 13:06Previously, as to not falsely accuse somebody of cheating, we would select no, but that would be a bad signal to give to our model.
  128. 13:14So, breaking this up into two pieces is really important because we actually get more data and it's better quality and we're not harming the model in the long run.
  129. 13:23Another example is a quality tutor.
  130. 13:25On the left here, you see a pattern where the interaction is overwhelming and on the right delightful.
  131. 13:32So, this is an example of me talking to an LLM.
  132. 13:36I asked it to act as a writing tutor and provide feedback for a passage that I wrote.
  133. 13:41The passage was specifically written as if it was a English language learner, so it had a few mistakes or awkward sentences.
  134. 13:48It was a relatively brief paragraph and instead this LLM decided to give me 400 lines of text and it was very overwhelming and hard to parse.
  135. 13:59First, it decided to praise me, then give some sort of feedback and then completely rewrite my passage even though I never asked it to.
  136. 14:07The feedback was not direct.
  137. 14:09It was hard to tie feedback to specific parts of the input and it was so large that it would be difficult to actually improve your writing through this sort of interaction.
  138. 14:20And most importantly, this did not feel natural.
  139. 14:22If you were to send an email to your friend saying, "Hey, can you take a look at this thing that I wrote?"
  140. 14:28you would not expect them to send you an essay double the length telling you all the things that you did right and wrong and I'll also give you a whole new version.
  141. 14:35Instead, you would probably want it to look something like this.
  142. 14:38Here you have a screenshot of a Duolingo style writing tutor where the text is directly marked up.
  143. 14:46The green is signifying that this is something that was good and also providing some sort of feedback when you hover over it.
  144. 14:53Yellow signifying something is awkward or a little bit off and red being direct mistakes.
  145. 14:58When you hover over all of these markups, you can get direct actionable feedback that's concise and you can accept the suggestions in line.
  146. 15:07Most importantly, all the feedback is directly tied to a portion of text.
  147. 15:12This is more closely mimicking human behavior.
  148. 15:15Specifically, like in an academic setting, if you're handing your essay to a classmate, you would expect feedback in line as they mark up your text rather than an essay back.
  149. 15:26This is useful because over time, if you get these sorts of feedback [clears throat] points, you can improve in incremental steps in your writing.
  150. 15:35And this is really important for surfacing the exact same AI output.
  151. 15:41Lastly, and probably most applicably to an engineering audience, is a coding agent.
  152. 15:46Now, there are a lot of coding coding agents out there, and there's a lot of different UIs, people have their personal preferences, but I've seen that there's two patterns that a lot of out of the box coding agents are falling into.
  153. 15:59So, one pattern is that if you ask it to do something, it's going to touch a lot of files and give you a giant diff, basically doing the thing that you requested all in one go.
  154. 16:09This leads you probably to approve all the changes and then take a look at them maybe on GitHub, so that you can see all the things that it did.
  155. 16:18Another approach is that it will ping you a notification every single time it's changing some sort of file or function, and you have to keep clicking yes, yes, yes,
  156. 16:26just so that you can get to the result.
  157. 16:29Either way, in both of these cases, you're just becoming a rubber stamp.
  158. 16:34You're accepting all of the changes, and then you're taking a look at them all in one go and debugging later.
  159. 16:40Anything that went wrong is your responsibility to then identify, fix, re-prompt, or do manually.
  160. 16:46And it's not a very delightful experience.
  161. 16:50Instead, you probably want a coding agent that acts like a junior developer.
  162. 16:54You wouldn't want a junior developer to come onto your team and just be like, "Oh, sure, I can do that."
  163. 16:59and disappear for a day and then give you a thousand line PR.
  164. 17:03You also probably don't want a junior dev who's asking you a question every five minutes at your desk.
  165. 17:08Instead, you want someone who's able to plan, ask good questions, and document those design decisions, giving you a good spec and breaking up their PRs in meaningful and reviewable ways.
  166. 17:20This means that it's delightful for you as a mentor or in this case developer who's partnering with a coding agent to experience things in a way that is easily reviewable.
  167. 17:32You can highlight assumptions and maybe answer questions about them and you can easily see a plan and the things that the decisions that it's making before things go wrong.
  168. 17:44Also, the steps are manageable and you're not being pinged too many times.
  169. 17:50And then going a little bit into the data of side of this, if you have agentic coder and it's leading an interaction where a developer is encouraged to just quickly skim everything and not really discern.
  170. 18:03This means that you're just collecting these binary signals of accepted and rejected, usually skewing towards accepted, and that doesn't really give you that much information because it's just on some coding block.
  171. 18:16Instead, if an agent is acting as a partner with a developer steering, you can get rich data because it's structured specifically around different parts of the development cycle and it's capturing nuanced structured decisions about the different parts of
  172. 18:31the tasks that it's doing.
  173. 18:32For example, it can look at assumptions that were bad, the tradeoffs that it made, stylistic preferences and approaches that the developer's taking.
  174. 18:41And all of those pieces of data can then continue to make your experience as a like as your AI system coding system better.
  175. 18:50So, let's look at some design principles.
  176. 18:53First, you can engineer the reasoning.
  177. 18:56Think about what reasoning pattern do you want to elicit from a human and how does your interface challenge that?
  178. 19:03So, if you have a system that is specifically optimizing for independent judgment, reframe your system to think of the human as investigator, not just a validator.
  179. 19:14Don't just give a hey, is this looking good, but instead have it be a more thoughtful engaged effort.
  180. 19:21Surfacing assumptions is something that's very valuable when you care about a lot about the quality of a long-running task.
  181. 19:28If the model is stating them earlier on and asking for a sign-off, you can prevent any future miscommunication or having to go back and fix your assumptions.
  182. 19:37Weighing trade-offs is also very important because very often an LLM might give you some sort of option and it thinks it's best without having to actually weigh the different
  183. 19:48different trade-offs and design decisions that it's making in the background.
  184. 19:52Presenting those options and the reasoning for why allows the user to continue to be in control over the output and they can opine earlier on so that they can get the thing that they actually want.
  185. 20:05Lastly, for sustained attention, you want to build in friction exactly where the stakes are high.
  186. 20:10If you want the person to slow down and think deliberately, friction is your friend, which leads us to the next principle to match the friction to the stakes.
  187. 20:18In a high-stakes example like ours where the Duolingo English Test really matters for people and their livelihood, we want our human reviewers to be deliberately slow and very thoughtful with the decisions that they make.
  188. 20:33This means that we want to be adding review gates that are well-structured and friction so they can slow down and think about these things so that they can never become a rubber stamp.
  189. 20:43You
  190. 20:43[snorts]
  191. 20:43want these people the people to slow down and you want the output to remain high quality.
  192. 20:49You don't want noise and you want clarity.
  193. 20:52So, this means that you have to be actively thinking about what friction like what speed bumps you want to put along the road and how and what checkpoints.
  194. 21:02For systems where you have low oversight, for example, something delightful where you're just chatting with an AI, you want to make sure that it's relatively frictionless.
  195. 21:12Your design has to optimize for a happy someone who's happy with that output and doesn't really feel like there's a lot of stopping points or scenarios where it's kind of difficult to interact with the system.
  196. 21:26Instead, you want it to be absolutely seamless.
  197. 21:31Next principle is every interaction is already a label.
  198. 21:35Instead of having to select a portion of your data and have human annotators get you a better cleaner data set, you can kind of already start thinking about that specific interaction piece
  199. 21:48as already providing you labels and signals for your next iteration.
  200. 21:53So, if the agent plan was approved or a suggestion was accepted, this means that you did something right and your output matched the intent of the user.
  201. 22:01However, if the output was modified or in a recommendation was overridden, that probably signifies something bad.
  202. 22:07However, a lot of systems don't really capture that diff and the model falls short because what you get on that decision is a yes or no. And the human clicked yes, then manually went in and changed something or erased it completely.
  203. 22:23If you don't capture that diff, which could be something for the the AI falling short or maybe completely being wrong, you actually capture a false signal that then can pollute your data sets.
  204. 22:35Instead, think about how can you measure that diff?
  205. 22:39Lastly, there are also questions that a human might be asking.
  206. 22:42For example, explanations or follow-ups.
  207. 22:45And this could mean that the human has a low trust in the system or there was something wrong with the AI.
  208. 22:51Uh so, take a look at the kind of questions that are being asked and what sentiment they have.
  209. 22:58Another principle is to stop asking how to evaluate the model.
  210. 23:02Instead of building your system and then being like, "Hey, what kind of data can I capture to see if this is good?"
  211. 23:09Proactively think about what defines success for your AI system.
  212. 23:14Think about how you can be measuring that with concrete metrics and what data will you need to improve the system from the start.
  213. 23:21Those decisions will be informing the way you design that interaction such that you can ensure that you have the hard evidence for that next step.
  214. 23:30Every interaction should be helping the user to teach them how to improve the system and be a partner with the AI.
  215. 23:40This leads me to my final point, which is all of those things are leading you to engineer that interaction.
  216. 23:46There are different ways to engineer that interaction, which I've covered briefly, but some of the principles are this.
  217. 23:53First, you can have structured inputs and outputs.
  218. 23:56That way you don't just have vibes or giant walls of text.
  219. 23:59Instead, you have specifics.
  220. 24:00You can think of this in terms of forms that the user is filling out, structured output in forms of tables, markup UIs, for example, that writing tutor or maybe it's a design thing where you can highlight specific elements.
  221. 24:15All of those ways are having targeted interactions between the human and the AI ensuring a better result.
  222. 24:22Next, highlighting that those assumptions.
  223. 24:25If you are having assumptions being made by the model, if you surface them proactively and ask if it's legit, that's going to save you some tokens down the line so that the human is not having to fix or argue or correct with the correct the model
  224. 24:38output.
  225. 24:38Instead, it's being proactive and the having those things that are core pieces of information that are going to inform later decisions.
  226. 24:48Next is building in friction and review gates.
  227. 24:51That deliberate slowing down so that you can have good quality thought and just required for good quality decision-making and good quality data is all important because if you're bringing in that friction and review gates,
  228. 25:05people are going to start thinking clearly as if it's really their own thing rather than just something that AI is supplanting.
  229. 25:14Lastly, collecting explicit feedback is really important because as we've covered, every one of those interactions is a piece of data.
  230. 25:22So, all of those signals are going into your next generation of the model, and collecting explicit feedback, not just a thumbs up, thumbs down, but instead feedback at the correct touch points,
  231. 25:34uh with the correct amount of nuance is something that can really drive improvements directly.
  232. 25:41So, yes, uh you should be designing for discernment.
  233. 25:44Sometimes the fix is not a better model or more oversight, it's just engineering the interaction itself.
  234. 25:51Thank you.