Education

Vibe Coding, AI Risk & AI Evaluation | Stanford CS193T Lecture 6 with Cynthia Bailey

by Stanford Online

Share:

📚 Main topics

  • Professional vibe codingBailey presents vibe coding as using English to direct AI coding tools such as Claude Code and Codex. A careful process prepares a detailed specification, hands it to a fresh coding agent, and reviews the result with another fresh agent. 8:41
  • Post-deployment risksTesting before launch is not enough: real-world conditions and user behavior can change, and some models may change over time. Bailey illustrates how these shifts can lead to failures that historical testing did not reveal. 17:09
  • NIST and Stanford guidanceThe NIST AI Risk Management Framework emphasizes mapping risks, measuring them, managing them, and building a responsible organizational culture across the product lifecycle. Stanford’s data classifications and AI-use guidance also matter when handling other people’s data. 30:25
  • Evaluating AI systemsEvaluations measure model behavior, such as hallucinations or bias, while product metrics measure business outcomes. Both evaluation and monitoring depend on deciding what counts as a correct or desirable result. 50:48

✨ Key takeaways

  • Make the specification usefulA detailed scope of work should describe the task, relevant constraints, and how quality will be tested. If an agent asks questions you cannot answer, ask it to explain the options so you can make an informed decision. 14:29
  • Use an independent reviewGive a fresh agent the specification and the generated code, and ask it to review the work skeptically. Framing the code as someone else’s work can reduce the tendency to praise it. 12:19
  • Account for missing counterfactualsIn the employee example, strong performance among retained workers does not show whether fired workers would also have performed well. Randomly retaining some workers the AI recommended firing can help reveal that missing outcome. 27:47
  • Ground truth can be misleadingConvenient datasets may record only part of reality. Police records, for example, reflect patterns of reporting and enforcement, not every crime that occurs. 58:08
  • Evaluation can reveal unexpected patternsPublic experiments on Twitter’s image-cropping algorithm showed that it repeatedly selected Mitch McConnell over Barack Obama, illustrating how broad testing can uncover problematic behavior. 1:05:29

🧠 Lessons learned

  • Consider the whole lifecycleResponsible AI work begins during planning and design, continues after deployment, and includes planning for decommissioning and the responsible handling of leftover data. 40:20
  • Treat data with empathyStanford guidance encourages people to avoid entering information about others into generative AI that they would not want entered about themselves. 46:35
  • Do not mistake scale for validityTesting on thousands of historical examples can still miss behavior that only appears after deployment, or rely on data that does not represent the true outcomes of interest. 21:27
  • Use AI judges with careA second LLM can help evaluate nuanced outputs at scale, but evaluations still need thoughtful criteria and a reliable basis for determining what is correct. 54:56

🧠 Conclusion/next steps

  • Explore evaluation questionsBailey invites students to identify frustrating or surprising AI behaviors and turn them into questions that can be studied systematically in the following week’s tutorial. 1:08:40
  • Apply the process to the task at handA thorough specification and review process is especially appropriate when software accuracy affects research or other consequential work, while simpler experiments can be useful for low-stakes projects. 7:37

Transcript excerpt

0:05 All right, let's get started. So, um we're going to do a quick tutorial preview. Um this week's tutorial is vibe coding. So, I'll do a quick introduction to some process for vibe coding, and then the rest of our um lecture today is focused on this problem of how to take control of your AI. So, we will do everything from

0:36 to go over standards from the US government and from Stanford as well as looking at the process of doing evaluation. So, as I said, this week's tools will involve vibe coding including Claude code and ChatGPT Codex. So, look forward to that in your tutorials this week. First, we'll get into it. Vibe coding the quote here is um the origin of vibe coding um coming from

1:07 um an engineer who's actually one of the co-founders of OpenAI and was a former lead of AI at Tesla. And the term spread quickly to describe this process of really using the English language as a programming language. And um I don't know. Met with a lot of excitement and some trepidation

1:40 as the term spread and as the practice spread, the term picked up some negative baggage from people who really were not being careful about how they were approaching it and didn't follow the kinds of processes that we've already talked about last week in this class. And so um predictable downsides of that being um that there's a lot of bugs in the code is really was not um production grade. A lot of this early vibe coding experimentation. But over

🔒 The full, searchable transcript is available with Pro.

🔒 Unlock Premium Features

This is a premium feature. Upgrade to unlock unlimited Q&A, transcripts, mindmaps, and translations.

Questions & Answers

Common questions about this video

What is vibe coding, and what three-step process does the lecture recommend for doing it professionally?

Vibe coding means using English as a programming language with AI to create software. The recommended process is to prepare a detailed scope of work using the elephant-and-goldfish process, hand it to a fresh coding agent to implement, and then have another fresh agent review the result against the spec. 8:41

How can someone review vibe-coded software if they do not know how to read code?

Give the code and the detailed scope of work to a fresh AI agent in a coding environment. Ask it to act as a severe professional code reviewer, and frame the work as someone else’s code that may not follow the spec so the reviewer is prompted to be skeptical. Tests should also be part of the process and run during implementation and final review. 12:19

Why do AI tools need monitoring after deployment, even if they were thoroughly tested beforehand?

Conditions can change after deployment, creating distribution shift. Users may also change their behavior once they know AI is involved, such as adding prompt-injection instructions for an AI autograder. Some deployed models may even update their weights over time, leading to behavior that pre-deployment tests could not have caught. 18:14

What is survivorship bias in the employee-performance prediction example?

After the AI recommends employees for dismissal and those employees are fired, the company only sees how the retained employees perform. It has no data on how the fired employees would have done if they had stayed—the counterfactual—so it cannot conclude that the system identified poor performers correctly. 27:47

What are the main parts of the NIST AI Risk Management Framework?

The framework’s core functions are map, measure, and manage. Organizations map the risks and context of an AI system, measure its risks and performance in that context, and use what they learn to manage those risks. The framework also emphasizes building a lasting organizational culture of responsible AI use. 34:06

What is the difference between AI evaluations and product metrics?

Evaluations, or evals, measure the AI system itself—for example, whether it is biased, how often it hallucinates, or whether its tool calls work accurately. Product metrics concern business outcomes such as user growth, user satisfaction, and engagement. Evals can be run before and after deployment, while product metrics require a deployed product and users. 51:20

Why can ground truth be difficult to establish when evaluating AI?

Available datasets may only approximate what is actually true. For example, police records do not capture every crime and may reflect differences in policing across neighborhoods, so an app built from those records can faithfully represent its data while still misrepresenting crime in the world. This often happens when organizations rely on convenient existing datasets rather than true ground truth. 58:08

🔒 Unlock Premium Features

Access to Chat is a premium feature. Upgrade now to unlock unlimited studying tools.

🔒 Unlock Premium Features

Access to Mindmap is a premium feature. Upgrade now to unlock unlimited studying tools.

🔒 Unlock Premium Features

Access to Translation is a premium feature. Upgrade now to unlock unlimited studying tools.

Get unlimited summaries, Q&A, transcripts and more with Pro

Upgrade to Pro

Suggestions

🔒 Unlock Premium Features

Access to AI Suggestions is a premium feature. Upgrade now to unlock unlimited studying tools.