Video summary
Stanford CS329A Self-Improving AI Agents | Part 1 | Course Overview
Main summary
Key takeaways
Main ideas / concepts taught
1) Scaling laws in large language models (pre-training progress)
Since GPT-3 and earlier work, model quality has improved predictably as scaling increases:
- More compute → lower training/test loss → better models
- More data → further loss reduction
- More parameters (e.g., larger transformers / more layers) → improved loss and performance
Approximate parameter-count growth examples mentioned:
- BERT (~340M) → GPT-2 (~1.5B) → GPT-3 (~175B) → PaLM (~540B) → GPT-4 estimated trillions
Note on “saturation”:
- Scaling was described as fairly consistent until it began approaching saturation roughly around the last year / ~1–1.5 years ago.
2) Why bigger models matter (capabilities beyond raw benchmark score)
As models scale up, the lecture emphasizes emerging/transfer behaviors:
- Better performance on natural language and reasoning benchmarks
- Few-shot learning emerges
- Instead of task-specific fine-tuning, the model generalizes from a few examples in the prompt
- Emergent reasoning behaviors
- Capabilities that look like “reasoning” appear more reliably in larger models
Definitions: zero-shot vs few-shot (as described)
- Zero-shot: provide only a task description; the model answers without task-specific examples.
- Few-shot: provide a task description plus several input-output examples; the model follows that pattern for new inputs.
3) Chain-of-thought (CoT) as an important emergent capability
Azalia emphasizes a particularly important behavior emerging in larger models:
- “Chain of thought” prompting/traces (showing intermediate reasoning steps)
Example described (math word problem with tennis balls):
- Start with 5 balls
- Two cans × three balls each = 6
- 5 + 6 = 11
Point: by seeing the reasoning process, the model can generalize to new similar problems.
Scaling pattern claimed:
- Smaller models show little/no benefit from CoT.
- Larger models leverage CoT to improve performance.
Other reasoning-like skills were also cited as appearing at certain scales (e.g., arithmetic and word-unscramble tasks).
4) How models like ChatGPT became strong: post-training pipeline
The lecture frames improvements as coming from multiple training stages:
A) Pre-training (base capability)
- Train the model to predict the next token given text.
B) Fine-tuning on higher-quality data (alignment + instruction-following)
-
Fine-tuning for human preferences / alignment
- Pre-trained models may know world statistics, but don’t inherently know “right vs wrong” or how to follow instructions.
- Fine-tune using curated data labeled for:
- safety vs unsafe
- sensible vs nonsensical
-
Instruction tuning
- Train with instruction → question → answer pairs.
- Training data may include:
- human-generated templates
- synthetic data
- optionally chain-of-thought fine-tuning (teaching reasoning traces)
C) RLHF / RLAIF-like step (reinforcement learning from feedback)
- RLHF: reinforcement learning from human feedback
- Humans rate model responses to create a reward model
- The reward model guides training to produce higher-scoring outputs
Reward types mentioned as examples:
- correctness
- helpfulness
- specificity
- harmlessness
The lecture hints that RLAIF (reinforcement learning from AI feedback) may matter later, but the explicit pipeline described is RLHF.
5) Inference scaling / repeated sampling (“Code Monkeys” / “Large Language Monkeys”)
After scaling progress stalled somewhat for training alone, the lecture argues that:
- test-time (inference-time) improvements are a major frontier
Core idea:
- Keep the model fixed
- Generate many candidate outputs for the same input
- Use a verifier/selector to pick correct outputs
Analogy:
- Inspired by the infinite monkey theorem (“monkey” as the LLM).
Mechanism details:
- LLM as the monkey: sample many answers
- Temperature controls diversity
- Too high can become gibberish; the lecture mentions practical limits (e.g., ~1.2 problematic)
- Verifier example: unit tests for code
High-level results claim:
- On math/coding benchmarks, increasing samples per problem (up to ~10,000) increases the fraction solved.
- A smaller model with enough sampling can outperform a larger model asked only once (contrasting “one sample” vs “many samples”).
Trade-offs:
- cost/latency vs performance
- parallel sampling can reduce latency, but overall compute cost increases
- verification makes the approach more effective
Methodology summarized as explicit steps
For an input problem:
- Generate N candidate solutions using the LLM (often via stochastic decoding).
- For each candidate, run a verifier (if available) or an evaluation mechanism.
- Select the candidate(s) that pass / score best.
- Output the selected correct answer.
Notes on variability:
- LLM outputs are non-deterministic; sampling plus verification exploits that variance.
- Verifiers can be framed as “unit tests” in programming settings.
6) “Thinking” / test-time scaling and reasoning models (O1, Gemini thinking, etc.)
The lecture connects inference scaling to reasoning-time computation:
- Models can “spend more thought” on hard problems
Claimed empirical behavior:
- Accuracy (e.g., pass@1 on hard math) increases as test-time compute increases, without changing parameter counts.
Reasoning-step breakdown listed (human-like structure):
- Problem analysis
- Task decomposition
- Self-evolution strategies (try, get feedback, optimize)
- Self-correction / backtracking
- Alternative proposals when something fails
Example described:
- A model writes a bash script for matrix transpose, including internal reasoning and self-correction during generation.
Contrast noted:
- Reasoning models may excel more on math/code/data analysis than on personal writing/editing.
7) Transition from LLMs to agentic workflows
The course motivation:
- LLMs are often “single-turn” chatbots—useful for interaction, but not necessarily end-to-end task completion.
Recent systems (examples given: Claude Code, Deep Research, coding agents) show agentic workflows that accomplish tasks end-to-end.
What makes an agent different (as described)
An agent typically:
- has an explicit goal
- plans steps
- takes actions in an environment (edit files, search web, run tools)
- uses feedback to correct steps
- stops when the goal is achieved (or reports inability)
- often requires memory to track task state
Typical orchestration patterns for agentic workflows
- Prompt chaining (sequential subtasks)
- Routing (choose workflows based on complexity)
- Parallelization (multiple concurrent LLM calls)
- Orchestrators / LLM managers (planner model coordinates calls)
- Critics/judges (LLM-as-judge evaluation)
- Verifiers (rule- or tool-based checks, e.g., running unit tests)
- Tool calls (web search, weather lookup, environment queries)
Explicit “end-to-end” agent loop (conceptual)
- Goal given by user
- Agent clarifies intent if needed
- Agent plans and decomposes
- Agent uses tools/environment interactions
- Agent receives verification/evaluation feedback
- Agent iterates (self-corrects) until success or failure
8) Bottlenecks: verification and the “generator–verifier gap”
The lecture frames a key challenge:
- Models can generate plausible reasoning traces or content easily,
- but robust verification (confirming correctness) is hard.
It also notes:
- Human feedback can be a bottleneck where automatic verifiers don’t exist.
- The course plans to cover combining verifiers, limits of verification, and related research.
9) Course relevance and application areas (examples)
Concrete motivation examples of agent behavior:
- Coding agents
- interact with repositories via terminal
- navigate/edit/search files
- run commands and modify code iteratively
- Customer support agents
- live transcription
- knowledge assistant using a knowledge base
- smart replies and call summaries
- Research / report generation agents
- literature review automation: identify references, summarize each, synthesize into a report
- AI scientists
- brainstorming ideas
- iterating experiments
- improving paper writing
- browsing/idea generation claims for novel directions
Detailed bullet list: course methodology / logistics instructions (as presented)
Course resources and expectations
-
Course website:
cs329a.stanford.eduUpdated with lecture materials, papers, and the homework schedule. -
Pre-requisites
- Check the external registration page and ensure you meet pre-reqs.
- Canvas
- Used for the latest updates and communication.
- Lectures
- Upload lectures before each class meeting (per instructor statement).
Assessments and structure
- Homeworks
- 3 homeworks this quarter
- Together account for 50% of the grade
- Course project
- Accounts for the remaining 50%
- Teams:
- 2 to 4 people recommended
- 1 person allowed if desired
- API credits provided (teams get more credits collectively for more experiments)
- Project examples are acceptable only if researchy, e.g.:
- new evaluation dataset or benchmark
- reliability analysis of an existing agent
- “hill climbing” improvements over an existing benchmark
- improvements/critiques/evaluations of decisions in covered papers
- Negative examples excluded:
- surveys
- basic application demos without hypothesis/experiment
Project milestones (timing expectations)
- Project proposal: around early October
- Midterm project presentation
- expected progress: ~2 weeks after proposal
- proposal alone is insufficient; expect experiments already run
- Final poster presentation
- Dec 12, 4:00–6:00 p.m.
- students present posters; industry attendees included
Submission platforms and policies
- GradeScope
- used for homework and project milestone submissions
- Honor code
- must be followed
- Office hours
- posted on Canvas
- Question asking
- encouraged publicly on EdStem
- Late policy
- described as “generous on some days”
- but: “class is big” → “no exceptions”
- use late days wisely
- Audits
- not allowed
- Videos
- YouTube videos will be posted eventually
Speakers / sources featured (mentioned in subtitles)
Speakers
-
Akanksha Adjunct professor at Stanford; research at Reflection AI
-
Azalia Mirhoseini Assistant professor in CS; previously at Google Brain / Google DeepMind (coding-related projects and Gemini mentioned per subtitles)
-
TA(s) Mentioned indirectly; not named
Systems/models/products referenced
- BERT
- T5
- GPT-2
- GPT-3
- ChatGPT (launched Nov 2022; timing and user growth mentioned)
- PaLM
- GPT-4 (parameter estimate/tradeoffs mentioned)
- Claude Code
- Deep Research
- Codex / “coding agent from OpenAI” (coding agent mentioned)
- o1 / O3 (OpenAI reasoning model references)
- Gemini / “Gemini thinking”
- DeepSeek (came out Dec 2024 mentioned)
Theoretical / paper references mentioned
- Scaling laws
- Infinite monkey theorem (for the “Large Language Monkeys” framing)
- GSM8K (mentioned as early “signs of life” for reasoning / CoT)
- AI scientist (paper/workflow referenced)
- Code Monkeys / “Large Language Monkeys” (work done “in my lab last year”; includes verifier/unit-test concept)
Tooling / frameworks referenced
- Unit tests (as an example of verifiers)
- Temperature (sampling diversity control)
- EdStem, Canvas, GradeScope (course tooling)