Popping the Hood on AI: Understanding Leads to Discernment

Upper School math students peeked behind the curtain of Artificial Intelligence (AI) last week as part of a lesson designed by Math Teacher Philip Rosen. Mr. Rosen, who holds a BSE in Computer Science from Princeton University, has been fascinated by machine learning since it arrived on the scene and has thoughtfully discerned that our students need to go beyond simply using AI to understanding how it operates.

Knowing how to successfully prompt ChatGPT is a skill that will take students only so far. Understanding why it works—that a model finds statistical patterns in training data, predicts the next token, and weights inputs—is durable, transferable knowledge. Students who understand the mechanics can predict when AI will fail them, a practical skill that translates into knowing why AI confidently makes up a citation or why it struggles with a math problem that requires exact multi-step logic rather than pattern matching. It’s all in the name of teaching healthy skepticism instead of blind trust, which aligns with what our teachers have striven to do for decades: teach students how to think, not what to think.

“When I hear people talk about AI, often they are talking about its perceived abilities or environmental and societal impact,” says Mr. Rosen. “I think those are important discussions to have, but I also think to understand AI’s impacts and potential uses, it’s helpful to have some idea of what’s going on under the hood.” He developed a lesson plan that Math Department Chair Diane Broberg was happy to roll out to other Upper School math teachers. The team rolled out the class last week, ensuring nearly all of our math students are now versed in the internal machinations of artificial intelligence.

He began by providing a solid definition of AI: a broad category of computer programs that solve problems that would require human decision-making, creativity, or reasoning. So, for example, a grammar check, a chess-playing program, automated driving directions, and ChatGPT are all examples of AI. A calculator doing addition, an Excel file sorting names alphabetically, and a Wikipedia page with links are not examples of AI.

Mr. Rosen has been intrigued since learning the phrase “stochastic parrot,” a metaphor describing how large language models (LLMs) statistically stitch together human-like text based on probability, without any actual understanding of the meaning behind the words. “The phrase does give some idea of what’s happening, assuming you understand stochasticity and are okay underselling the work that’s been put in to make LLMs and AI agents responsive to context,” explains Mr. Rosen. “I kept feeling like there had to be a way to explain it more technically but so that students would still be able to understand.”

He loves to gamify lessons, and he created an exercise inspired by the “guess the next word” game. “Guess the word” begins with someone saying “Once,” which prompts others to add “upon,” then “a time,” etc. “That makes sense for the output of an LLM, but it doesn’t give the feeling for how the machine learning layer actually arrives at being able to guess well,” he notes.

He successfully created a fun, easy game for his students to play that helped them understand how AI works, using colors. The color game is based on classic machine learning tasks, like recognizing handwritten letters. “He said, These tasks have examples that are clear to humans, but to make it work in a classroom, I would need something that the students don’t already know how to do (so labeling letters or numbers was out). At some point, between realizing I could just make up categories and wanting students to be able to ‘vibe’ an answer, I landed on categorizing colors.”

He showed a slide with a colored circle in the middle and three letters at the top: A, B, and C. Which letter is the color? Students laughed nervously and began guessing letters, with no clue why a green circle would correspond to the letter B. “How confident are you that you’re right?” Mr. Rosen challenged his students. “How are you getting that? Probability!”

He then gave them the answer: the green circle correlates to B. A second color appeared, this time taupe. Once again, the students had to guess A, B, or C. “How confident are you now?” he asked. A chorus of voices chose different letters, and when he announced that the correct answer was A, several cheered.

Mr. Rosen began flipping through slides, showing different colors and challenging students to assign letters to each one. “Talk with your table,” he encouraged. “What are you noticing? What else do you want to know?” He pointed out that the students were getting better at assigning labels to colors; there were more right answers each time.

Eventually, students began to posit that bright colors are A, light colors are B, and dark colors are C. Mr. Rosen noted that the students were learning and improving at correctly assigning letters. Finally, he announced, “That’s machine learning. You just did it.”

“Instead of trying to tell the computer how to do something, we tell it to teach itself by giving it a lot of labeled examples. I didn’t tell you how to do it, but we got there.”

Students also discussed predictive versus generative programs. Predictive AI programs guess or predict a category or outcome. The color game the students played was predictive. Early cancer detection, tracking false information on social media, predicting the properties of new materials, and detecting fraud and insider trading are all predictive tasks. Generative programs use machine learning to create new content: Chat, Claude, Flint, Dall-E, and Sora are all examples.

Mr. Rosen then explored how AI works in more detail, including size, attention, context, and backpropagation. The training process of LLMs shows that there are problems inherently baked in, including loss of context, sycophancy, hallucinations, unjustified confidence, average output, and bias replication.

“My biggest hope is that students walk away with an intuition for how machine learning approaches problems—instead of telling the computer what to do (which for some problems can range from hard to impossible), we give the computer a way to look at lots of examples and mathematically ‘vibe it out,'” says Mr. Rosen. “The underlying math can be complex, but the idea is surprisingly understandable. And once you begin to understand the process, you can start to make connections between how these systems are trained and how they end up behaving.”

Our math students can now apply this knowledge of how AI works to other classes here, and will inform their studies in college and their lives beyond. Understanding the mechanics means being able to evaluate AI output critically rather than accepting it, which is increasingly a baseline literacy expectation for professors and employers alike, since every field will touch AI tools. Mr. Rosen’s game also demystifies a technology that otherwise breeds either blind trust or fear, setting our students up to continue thoughtfully discerning the media to which they are exposed.

The students then played the “guess the next word” game. Mr. Rosen showed them some text, and their job was to pick the word that would have the highest probability of coming next.

The United States of _________.
Laugh out ________.
Once upon a ________.

How did you do? This is a predictive game, which is the game ChatGPT is trained to play. LLMs like ChatGPT take in huge amounts of text (including from the internet), train themselves to play “guess the next word,” and then play it over and over to generate new text. A second round of training called Reinforcement Learning with Human Feedback (RLHF) has humans read and rate responses (tens of thousands of them), and the model is heavily rewarded for giving responses that are rated better. Mr. Rosen says that the game is more accurately called “guess the next word as if you are a very helpful assistant.”

Wait, then why do LLMs work like magic? “We don’t know!” Mr. Rosen exclaims. “But we have some good hypotheses.” The first is size. We’ve known how to do most of this since the 1970s, so the amount of information fed into AI programs is staggering. Anthropic’s Mythos is estimated to store over 10 trillion specific numbers. Its training data may be over a petabyte, which is about 8×10 to the 15th power. “That’s roughly 1.5 billion books,” Mr. Rosen points out. “It would take a person reading continuously around one million years to read that much text.” Only recently have humans had the hardware teo process that much data.

The second big advance is called attention. Attention is a technique that allows an LLM to consider many words at the same time and let them affect each other in its predictions. We call the amount it can hold at a time context. Running out of context is why LLMs can get worse mid-conversation. And attention is why AIs use Graphical Processing Units (GPUs), which are computer chips that can run lots of multiplications at the same time.

“I think games are a wonderful framework for learning,” said Mr. Rosen. Apparently his students agree, since the class ended with a generous round of applause!

Close