Key Moments
Stanford CS193T Thinking with AI | Autumn 2026 | Introduction to AI
Key Moments
AI models generate human-like text by predicting the next word based on massive datasets, but this probabilistic approach inherently leads to 'hallucinations' or fabricated information.
Key Insights
The definition of AI has shifted from basic arithmetic in the 1950s to generating realistic text and video in the 2020s.
Large Language Models (LLMs) function by creating a statistical imprint of how words are used in vast text collections to predict the next token (word or part of a word) in a sequence.
Neural networks learn by adjusting 'weights' (connections between nodes representing concepts) during a training process, where random initial weights are refined through exposure to data and reinforcement learning.
The 'pre-training' phase requires immense datasets and computational power (thousands of GPUs running 24/7 for months) to set billions or trillions of parameters.
Fine-tuning, often involving human feedback (RLHF), refines pre-trained models by correcting unwanted behaviors, addressing issues like bias, or shaping responses towards helpfulness and clarity.
Context windows in LLMs, while growing (up to 1-10 million tokens), are finite resources that influence the model's ability to recall and utilize information within a given interaction.
The evolving definition of artificial intelligence
The concept of Artificial Intelligence (AI) has undergone a significant transformation over the decades. In the 1950s and 60s, AI was associated with tasks as simple as performing arithmetic and basic algebra. By the 70s and 80s, it extended to playing games like Connect Four. The 90s through the 2010s saw AI recognized for information retrieval and document classification, exemplified by Google's era and complex games like chess and Go. Today, in the 2020s, AI is largely defined by its ability to engage in conversations and generate realistic text and video. For this course, AI specifically refers to Large Language Models (LLMs) and Multimodal Generative AI, encompassing tools that not only process language but also other forms of data like images and audio.
How large language models predict the next token
LLMs operate on the principle of predicting the next 'token,' which typically refers to a word, a part of a word, or occasionally a pair of words that represent a single concept. The core mechanism involves analyzing vast amounts of text data to understand statistical relationships between words. This understanding is then used to predict the most probable next token in a sequence. For instance, given the phrase 'Welcome, please have a,' the model uses its statistical imprint from training data to estimate the likelihood of words like 'seat,' 'drink,' or 'cookie' appearing next. This predictive capability, based on observing word usage in extensive text collections, allows LLMs to generate coherent and contextually relevant text, forming the basis of how chatbots function.
Neural networks and the role of weights
At the heart of LLMs are neural networks, complex adaptive systems designed to process information. These networks consist of interconnected 'nodes,' each representing a concept. The connections between these nodes are called 'weights' or 'parameters,' which dictate how strongly one concept influences another. During training, these weights are initially set randomly. The network then processes input text, and the 'shading' or 'depth' of a node indicates its relevance to the input. For example, a node representing hospitality might be heavily shaded if the input relates to welcoming guests. The strength of the connection (weight) between nodes determines how much influence a concept in one layer has on the concepts in the next layer. This process, essentially a form of weighted averaging, allows the network to learn complex patterns and relationships within the data, ultimately enabling it to predict subsequent tokens.
The training process: pre-training and fine-tuning
Training LLMs involves two primary stages. Pre-training requires massive datasets (billions or trillions of examples) and significant computational power, often utilizing thousands of GPUs running continuously for months. During pre-training, the model learns general language understanding and statistical relationships by processing vast amounts of text, images, audio, and video. Fine-tuning follows pre-training, where curated datasets and human feedback (like Reinforcement Learning from Human Feedback - RLHF) are used to refine the model's behavior. This stage aims to correct undesirable outputs, reduce biases, and align the model's responses with desired characteristics, such as helpfulness, clarity, and safety. For instance, if a pre-trained model generates offensive content, fine-tuning helps steer it away from such outputs by reinforcing preferred responses and penalizing undesirable ones.
The 'black box' nature and concept nodes
A significant characteristic of neural networks is their 'black box' nature; it's often difficult to fully understand precisely what goes on inside them. While researchers can analyze which parts of a neural network activate for certain inputs, the specific concepts represented by individual nodes and their exact learned meanings can be obscure. These concept nodes, formed organically during training rather than being explicitly designed, can sometimes group seemingly unrelated ideas (e.g., 'popcorn, celery, and leaf' understood by an AI as 'crunchy'). The weights connecting these nodes are also learned, and their precise interpretation can be challenging, though they represent the strength of association between concepts. This lack of complete interpretability means that while LLMs are powerful, their internal reasoning is not always transparent, which can be a concern in applications requiring high levels of accountability.
Context windows and their limitations
The 'context window' refers to the amount of text an LLM can consider at any given time when processing input and generating output. While modern LLMs boast increasingly large context windows (ranging from 200,000 to 10 million tokens), they are still finite resources. The size of the context window is determined by the number of tokens the model's architecture is designed to handle, influencing the computational resources required. If crucial information falls outside this window, the model may lose track of it, potentially impacting the accuracy and coherence of its responses. For example, if a prompt mentions 'teacher' early in a long conversation, and that mention falls outside the context window by the time the model needs to generate a response, its prediction for the next token might revert to a baseline probability, losing the specific nuance provided by the 'teacher' context.
Hallucinations and the challenge of verifiable AI
A primary challenge with LLMs is their tendency to 'hallucinate' or generate fabricated information. This arises from their core mechanism of predicting the most probable next token. While effective for generating human-like text, this probabilistic approach does not inherently guarantee factual accuracy. Because LLMs are designed to generalize and create novel outputs, they can confidently present information that is incorrect or nonsensical. The term 'hallucination' itself is debated, with alternatives like 'confabulation' or 'fabrication' suggested to avoid anthropomorphizing the AI. While fine-tuning helps mitigate these issues, the inherent structure of LLMs means that the risk of generating plausible-sounding but false information remains a significant concern, especially in applications where factual accuracy is critical, such as law or medicine. Alternative, more interpretable AI algorithms exist for such use cases.
Responsible AI use and setting guardrails
The course emphasizes the importance of responsible AI use and establishing 'guardrails'—instructions that guide AI behavior. Students are tasked with experimenting with AI chatbots by defining their desired role (e.g., a helpful TA that guides without giving direct answers) and testing the AI's adherence to these instructions. This includes challenging the AI to see if it deviates from its given constraints, especially under pressure (e.g., asking for the direct answer when tired). The course also touches upon the societal impact of AI, including the tendency for AI to exhibit behaviors like flattery or adopt a formulaic writing style, often stemming from fine-tuning processes that reinforce positive feedback. The discussion also extends to anthropomorphism and its implications, urging students to consider the nuanced use of AI and the potential benefits and drawbacks of assigning human-like qualities to these statistical models. Developing clear AI honor codes is presented as a crucial step in navigating these complex issues.
Mentioned in This Episode
●Software & Apps
●Companies
●Organizations
●Studies Cited
●People Referenced
Common Questions
AI is broadly defined as the science of making machines intelligent. Its definition has evolved over time, from solving basic arithmetic in the 1950s to generating realistic text and video today. In this course, AI specifically refers to Large Language Models (LLMs) or Multimodal Generative AI.
Topics
Mentioned in this video
A model that can be used for comparison in the assignment to test how well it adheres to given limitations.
A web-based tool for interacting with AI models, introduced as a resource for the course that requires no installation.
Mentioned as an example of an AI that people understand, and also as a tool that can be used to create a glossary from lecture slides.
Mentioned as a tool that can be used to create a glossary from lecture slides, and as a model for comparison in the assignment.
An advanced version of neural networks that assigns different weights to input words based on context, crucial for modern LLMs.
Mentioned as an example of a Large Language Model that powered early versions of ChatGPT.
A model that can be used for comparison in the assignment to test how well it adheres to given limitations.
The course being introduced, covering AI concepts, tools, and responsible usage.
Mentioned as a current multimodal model, with a rumored 2-4 trillion parameters, and a potential 100-150 layers.
A model that can be used for comparison in the assignment to test how well it adheres to given limitations.
A model that can be used for comparison in the assignment to test how well it adheres to given limitations.
A model that can be used for comparison in the assignment to test how well it adheres to given limitations.
Mentioned as an example of a multimodal model that can handle images, video, and audio, starting from May 2024.
A film referenced to illustrate how context influences AI predictions, specifically through the character of The Oracle offering a cookie.
A 1986 science-fiction comedy film mentioned to illustrate the literal process of AI companies acquiring and scanning book collections for training data.
Mentioned as an example of Pixar films that anthropomorphize objects, giving them human-like thoughts and feelings.
Mentioned as an example of an AI with which people form romantic relationships, illustrating extreme anthropomorphism.
The company that produces GPUs, essential for the large-scale computations required for AI training.
The company that developed Claude, noted for naming their AI after a male name, which can encourage anthropomorphism.
More from Stanford Online
View all 170 summaries
70 minStanford CS329Z Introduction — What Are Agentic Systems?
65 minStanford AA274A Principles of Robotic Autonomy | Autumn 2019 | Extra Session - Particle Filter SLAM
108 minStanford CME295 Transformers & LLMs | Autumn 2026 | Lecture 5 - LLM Systems
72 minStanford AA274A Principles of Robotic Autonomy | Autumn 2019 | Decision Making Under Uncertainty
Ask anything from this episode.
Save it, chat with it, and connect it to Claude or ChatGPT. Get cited answers from the actual content — and build your own knowledge base of every podcast and video you care about.
Get Started Free