Stanford CS229 Machine Learning Spring 2026 Lecture 1 Introduction

Course Overview and Philosophy

Stanford CS229 is a mathematically intense course focused on the foundations of machine learning rather than programming. The curriculum emphasizes mathematical modeling, formulations, and derivations to ensure students understand the underlying mechanics of algorithms and code.

Prerequisites and Support

Successful completion of the course requires a background in probability and linear algebra. For students missing specific foundational aspects, the course provides support through sections and Friday TA lectures to help them catch up on the basics.

AI Tools Policy

AI tools are permitted as "human or superhuman collaborators," but with strict restrictions: students may not copy results from AI tools directly into their submissions. This policy is designed to ensure that students "train" their own brains and synapses rather than simply building an agent to understand the material.

Defining Machine Learning

Despite the rapid evolution of the field, traditional definitions of machine learning remain fundamentally accurate. The course references two key historical definitions:

  • 1959 Definition: Machine learning is a field of study that gives computers the ability to learn without being explicitly programmed.
  • 1998 (Tom Mitchell) Definition: A computer program is said to learn from experience (E) with respect to some class of tasks (T) and performance measure (P), if its performance at tasks in T, as measured by P, improves with experience E.

Modern Interpretation of Components

  • Experience (E): Now encompasses a broader range of data, including synthetic data, thinking tokens, web data, and human-labeled data.
  • Tasks (T): While tasks were once specific (e.g., image classification or price prediction), modern models are general-purpose and can solve millions of tasks simultaneously.
  • Performance Measure (P): This remains the goal (e.g., accuracy) that drives the learning process. Learning is defined by the improvement of P as E increases.

Taxonomy of Machine Learning Techniques

While the field moves too quickly for a universal consensus on taxonomy, the course organizes machine learning into three primary paradigms, which are often used as tools to build general-purpose agents.

Supervised Learning

Supervised learning involves predicting an output (Y) from an input (X) using labeled data.

  • Regression: When the output is a continuous variable (e.g., predicting house prices based on square footage).
  • Classification: When the output is a discrete variable or tag (e.g., identifying if an image contains a flamingo or a cat).

Large Language Models (LLMs) are fundamentally classification problems, as predicting the next token involves choosing one discrete label from a vocabulary of 50,000 to 250,000 options.

Unsupervised Learning

Unsupervised learning seeks to find interesting structures or patterns in data that has inputs but no corresponding labels.

  • Clustering: Grouping similar data points together (e.g., grouping gene expressions to identify diseases or clustering documents by topic).
  • Embeddings: Representing words or concepts as high-dimensional vectors where distance and direction correspond to semantic relationships (e.g., the vector relationship between a capital city and its country).
  • Generative Models: Using unlabeled data to create new, realistic content, such as diffusion models for image generation.

Reinforcement Learning (RL)

Reinforcement learning focuses on sequential decision-making where actions affect future states.

  • Traditional RL: Used in robotics (learning to walk) or games (AlphaGo), where the agent learns through trial and error.
  • Modern RL for LLMs: Used to handle stochastic sampling during text generation. Because sampling is not a differentiable operation, RL techniques like policy gradients are used to update models based on rewards (human feedback or reward models).
  • Bootstrapping: RL allows for interactive data collection. For example, in automatic theorem proving, a model generates proofs, the correct ones are verified and added back into the training set, creating a self-improving loop.

Additional Course Topics

Beyond the core paradigms, the course will cover:

  • Deep Learning: The use of neural networks with millions or billions of parameters to simulate brain-like synapses, trained via loss functions and backpropagation.
  • ML Systems: The intersection of software and hardware to optimize efficiency. Improving algorithm speed by even 20% can result in massive cost savings and faster development cycles for frontier labs.
  • Social Impact: A planned exploration of fairness and the social consequences of AI, including its impact on the job market.

Sources