
Lecture 21
Cornell University
INFO 5001 - Fall 2026
November 10, 2026
ae-19Instructions
ae-19 (repo name will be suffixed with your GitHub name).renv::restore() to install the required packages, open the Quarto document in the repo, and follow along and complete the exercises.🔓 Decrypt the .Renviron.secret → .Renviron
source("secret.R")info-5001Photo by Markus Spiske on Unsplash
12_plot-image-1{ellmer} let you show the model your plots!
Create a basic penguins scatter plot and ask Claude Sonnet 4.6 to interpret it.
How does it do?
03:00


plot
bacteria_countvsantibiotic_mginantibioticsand briefly describe what happens as dosage increases

Which model should you use?
Which prompt works best?
If one agent is better than another?
A set of test cases.
Each case contains:
The code that takes each input and produces an output.
It may make one model call or run a multi-step agent with tools.
The grading rule for each output.
It may compare the output with the target or use another grading method.
Task combines a dataset, solver, and scorer into an eval you can run.
| Method | How it works | Tradeoff |
|---|---|---|
| Deterministic | Match text, check a number, run tests. | Fast, deterministic, may be too narrow. |
| Model-graded | Another LLM judges the output against grading criteria. | Flexible, but the grader must be validated. |
| Human review | A person reads and grades the output. | High control for you, but slow and expensive at scale. |

Sensor log: six consecutive identical readings of 54.1 °F in an otherwise smooth cooling curve – a stuck sensor.

Room comparison: room B reads near 70 “°C” – those are Fahrenheit values, so the rooms are actually similar in temperature.

Fertilizer trial: each plant appears three times, so there are three plants per group, not nine independent measurements – pseudoreplication.
14_evalsRun the eval. It grades GPT 6 Luna and Claude Haiku 4.5 on the same three cases.
Open the viewer. Compare the responses and the grader’s explanations.
Which artifacts did each model flag?
07:00
Put prompts in Markdown files.
Clearly explain what you want the model to do in the system prompt.
Provide examples of what you want.
Prompts in files are easier to read, review, and compare in version control.
15_quiz-game-1Instructions
Your job: teach the model to play a quiz game with you:
The user picks a theme from a short list provided by the model.
They then answer multiple choice questions on that theme.
After each question, tell the user if they were right or wrong and why. Then go to the next question.
After 5 questions, end the round and tell the user they won, regardless of their score. Then, start a new round.
12:00
16_coding-assistantInstructions
Use Claude Sonnet to write a function that gets the weather. The first time, use Claude on its own.
Do some basic research for Claude about how to use a specific package to get the weather.
How does Claude do with the same task now?
06:00