← All lectures

CME295 / Lecture 09

Recap & current trends

A course review, multimodal models, and emerging directions for LLMs.

On this page
  1. Summary
  2. Knowledge Tree
  3. Feynman Questions
  4. Narrative Study Notes
  5. Suggested Answers

Watch the lecture

Watch on YouTube ↗

1. Summary

Meta: Source type: local timestamped SRT plus source video; title: CME295 Lecture 9 - Recap and Current Trends; course: Stanford CME295 Large Language Models; language: English; duration: 01:51:30; transcript type: timestamped SRT with repeated caption overlap cleaned for measurement; generated date: 2026-09-10.

Core: The final lecture turns the course into one connected map: transformers explain the architecture, scaling and tuning explain why LLMs became useful, RAG/agents/evaluation explain deployment, and current trends extend the same ideas into multimodal models, diffusion language models, cost-efficient inference, and future AI interfaces.

Abstract: Lecture 9 has three jobs. First, it rewinds the quarter from the first transformer lecture through model variants, LLM scaling, training systems, RLHF, reasoning, RAG, agents, and evaluation, showing that the course has been building one stack rather than separate topics. Second, it surveys current and near-future trends: vision transformers treat image patches as tokens; vision-language models connect image tokens and text tokens; diffusion language models challenge the usual autoregressive bottleneck by predicting many masked tokens through iterative refinement; and multimodal research increasingly transfers architectures, optimization ideas, and representations across text, vision, audio, and video. The final technical message is that the transformer is still the dominant backbone, but neither its architecture nor its inference paradigm is finished. Third, the lecture asks what these systems will become useful for: coding, visualization, research, web browsing, OS-level assistants, customer service, and personalized learning. The conclusion is practical rather than hype-driven: progress will depend on reliability, cost, interface design, and the ability to match the model or agent to the actual user task.

Concept: Course stack - the cumulative path from token representation and transformers to training, tuning, reasoning, RAG, agents, evaluation, and future applications.

Concept: Vision Transformer - a transformer architecture that splits an image into patches, embeds those patches as tokens, adds positional information, and uses self-attention for vision tasks.

Concept: Vision-language model - a multimodal model that combines visual representations with text tokens so the model can answer language prompts about images.

Concept: Autoregressive bottleneck - the inference-time constraint that a decoder-only model must generate token 1 before token 2, token 2 before token 3, and so on.

Concept: Diffusion language model - a language model family that starts from masked or noisy text and iteratively reconstructs tokens, making generation less strictly sequential.

Concept: Masked diffusion model - a diffusion-style text model where mask tokens play the role that Gaussian noise plays in image diffusion.

Concept: Cross-modal pollination - the transfer of architectures, optimization methods, token representations, and modeling tricks across text, vision, audio, video, and code.

Concept: Small language model - a cost-oriented model direction that tries to preserve useful task quality while reducing inference cost, latency, and hardware burden.

TakeHome: CME295's technical spine is attention plus scale plus alignment plus systems design; each later topic modifies that spine rather than replacing it.

TakeHome: Future LLM progress will not be only larger benchmarks; it will also be multimodal, non-autoregressive, hardware-aware, cost-aware, and interface-aware.

TakeHome: For real products, the decisive question is not whether a model is impressive in isolation, but whether the whole system is reliable, affordable, and useful for the user's actual workflow.

2. Knowledge Tree

CME295 recap and current trends/
├── Course recap/
│   ├── text processing before transformers
│   ├── self-attention and transformer architecture
│   ├── transformer variants: BERT, GPT, T5
│   ├── LLM scaling, sampling, and decoding
│   ├── training systems: scaling laws, Chinchilla, flash attention, parallelism
│   ├── tuning and preference optimization
│   ├── reasoning models and verifiable rewards
│   ├── RAG, agents, and tool use
│   └── evaluation as measurement and benchmark interpretation
├── Multimodal transformers/
│   ├── image patches as tokens
│   ├── ViT versus CNN inductive bias
│   ├── CLS token and positional embeddings for images
│   ├── VLM input concatenation
│   └── cross-attention fusion between image and text
├── Alternative generation paradigms/
│   ├── autoregressive inference bottleneck
│   ├── image diffusion intuition: noise to target distribution
│   ├── text diffusion via mask tokens
│   ├── masked diffusion model and diffusion LLM terminology
│   ├── speed and fill-in-the-middle advantages
│   └── quality and maturity caveats
├── Research frontiers/
│   ├── architecture transfer across modalities
│   ├── DeepSeek-OCR and vision-token compression
│   ├── transformer design still unsettled
│   ├── pre-norm, RMSNorm, grouped query attention, activation choices
│   ├── hardware optimization and memory movement
│   └── small language models and cost-quality frontier
└── Future use cases and learning path/
    ├── coding agents and text-to-code workflows
    ├── visualization and text-to-query interfaces
    ├── browser and OS-level assistants
    ├── reliability limits in long agent chains
    ├── customer-service empathy and groundedness
    ├── how to follow NLP progress
    └── CME295 as a launch point for continued study

3. Feynman Questions

Question 1. How does the lecture connect embeddings, attention, and transformers into the first step of the CME295 course map?

Question 2. Why does the recap distinguish encoder-only, decoder-only, and encoder-decoder transformer models?

Question 3. What mechanism separates scaling an LLM from training it efficiently under a fixed compute budget?

Question 4. How do reward models, Bradley-Terry preferences, PPO, DPO, and GRPO fit into the tuning and reasoning story?

Question 5. Why does the lecture put RAG, agents, and evaluation after the model-training material rather than before it?

Question 6. If self-attention was built for token sequences, why can a Vision Transformer use it on images?

Question 7. What is the main design choice behind vision-language models that concatenate image tokens with text tokens?

Question 8. Why is autoregressive generation slow at inference even though teacher-forced training can be parallelized?

Question 9. In the diffusion analogy, why do mask tokens play the role of noise for text generation?

Question 10. Why might masked diffusion language models help with speed and fill-in-the-middle tasks, and why are they not automatically a replacement for LLMs?

Question 11. What does cross-modal pollination mean, and why does DeepSeek-OCR make the input-representation question interesting?

Question 12. Why does Shervin say the transformer architecture is not set in stone?

Question 13. Why does the lecture expect cost-efficient small language models to matter once benchmark quality improves?

Question 14. What practical standard does the final part of the lecture use for judging future LLM agents and assistants?

4. Narrative Study Notes

001 · Final lecture agenda and course-level map

00:00:05-00:03:00

The lecture starts by marking a change in function: this is not another ordinary technical module but the last lecture of the course. The instructor gives the day a three-part structure. First, the class will recap the whole quarter so the separate pieces can be seen as one system. Second, it will look at topics that were trending in 2025 and are likely to continue shaping the near future. Third, it will close with next steps for students. That framing matters because the lecture is itself a compression problem: the goal is not to repeat every derivation, but to expose the spine that connects transformers, training, tuning, reasoning, agents, evaluation, and new research directions. The opening claim is that CME295 has built one cumulative LLM stack, and Lecture 9 turns that stack into a navigable map.

Concept: Recap as system map - the lecture reorders previous lectures into one architecture-and-deployment story rather than treating them as isolated topics. Opening slide for CME295 Lecture 9Opening slide for CME295 Lecture 9

Mechanism: The lecture moves old-to-new: it first reactivates the context from prior lectures, then uses that context to make current trends easier to interpret. This is exactly the Appendix A pattern: give the reader the stable frame before introducing novelty.

Notes: The agenda has three blocks: course rewind, current trends, and concluding advice. The course rewind is not filler; it is the dependency graph for understanding why multimodal transformers, diffusion language models, and cost-efficient inference are natural next questions.

LinkBack: Transcript 00:00:05-00:03:00.

002 · From text representation to self-attention and transformers

00:03:00-00:10:10

The recap begins at the first technical obstacle: before an LLM can reason about language, the system must turn text into a representation that a neural network can process. The course started with embeddings as the bridge from discrete tokens to vectors, then moved to the limitation of older sequence models such as recurrent and convolutional approaches. Self-attention solved the central representation problem by letting each token compute which other tokens matter for its own updated embedding. In the lecture's recalled formula, attention computes queries, keys, and values, compares queries to keys through scaled dot products, applies softmax, and uses the resulting weights to average values. The matrix expression softmax(QK^T/sqrt(d_k))V is not just notation; it is the hardware-friendly form that makes the computation parallelizable across tokens. The transformer then stacks these attention blocks inside encoder and decoder components, originally shown through translation. Self-attention is the course's first unifying mechanism because it turns a sequence of tokens into context-aware representations that modern hardware can compute efficiently.

Concept: Scaled dot-product attention - the operation softmax(QK^T/sqrt(d_k))V, which scores token relevance and forms weighted value averages. Slide recalling rotary positional embedding and attention-related transformer improvementsSlide recalling rotary positional embedding and attention-related transformer improvements

Mechanism: Queries ask what a token needs, keys advertise what other tokens contain, and values carry the information that gets mixed into the new representation. The transformer is powerful because this relevance computation is learned, dense, and parallel-friendly.

Notes: The recap explicitly links the first lecture's transformer to later LLMs: the encoder and decoder were introduced through translation, but the attention block is the reusable unit that later supports GPT-style text generation, BERT-style embedding generation, and image-patch processing.

LinkBack: Transcript 00:03:00-00:10:10.

003 · Transformer variants, LLMs, and decoding choices

00:10:10-00:16:00

After the base transformer, the recap turns to the model families that keep or discard different pieces of the original encoder-decoder design. Encoder-only models such as BERT use the encoder to produce embeddings, especially the CLS token embedding for classification. Decoder-only models such as GPT use causal self-attention and autoregressive prediction to generate text. Encoder-decoder models such as T5 keep both sides and can perform text-in, text-out transformations. This taxonomy matters because it separates representation tasks from generation tasks. An encoder-only model can be excellent at embedding and classification without being a natural text generator, while decoder-only and encoder-decoder models can generate sequences. The lecture then recalls the LLM turn: large language models are transformer-based, usually text-to-text systems, with sampling tricks such as top-k, top-p, and temperature controlling how deterministic or creative the output becomes. The model family determines what the transformer is allowed to do: encode, generate, or translate one sequence into another.

Concept: Encoder-only versus decoder-only - an architectural distinction that decides whether a transformer mainly produces embeddings or generates text autoregressively. Slide recalling decoder-only GPT-style transformer architectureSlide recalling decoder-only GPT-style transformer architecture

Mechanism: Decoder-only LLMs turn next-token prediction into open-ended generation by repeatedly feeding generated tokens back into the context. Sampling controls then decide whether the model follows the most probable path or explores alternatives.

Notes: The recap's hidden lesson is that the word transformer is not a single product. It names a family of attention-based architectures whose behavior depends on masking, directionality, objective, and decoding strategy.

LinkBack: Transcript 00:10:10-00:16:00.

004 · Scaling laws, Chinchilla, and training systems

00:16:00-00:23:00

The fourth lecture recap shifts from architecture to training economics. The early empirical story was simple: larger models, more data, and more compute tended to reduce test loss. But compute is finite, so the training question became an allocation problem: for a fixed budget, how should we balance parameter count and data size? The lecture recalls Chinchilla-style results showing that very large models can be undertrained if the data budget is too small; the optimal point is not always the largest parameter count. Then the recap moves from scaling laws to systems tricks. Flash attention avoids storing the full attention matrix in slow memory and uses recomputation to reduce memory movement, sometimes running faster despite doing more arithmetic. Data parallelism splits data across devices, while model parallelism splits a single forward pass across devices. Scaling made LLMs powerful, but systems design made scaling physically trainable under compute, memory, and bandwidth constraints.

Concept: Compute-optimal training - choosing model size and dataset size together so a fixed compute budget produces the best test loss. Slide recalling compute-optimal scaling and Chinchilla-style training tradeoffsSlide recalling compute-optimal scaling and Chinchilla-style training tradeoffs

Mechanism: The bottleneck is not only arithmetic; moving tensors through GPU memory can dominate runtime. Flash attention improves training because it changes the memory pattern, not because it changes the mathematical definition of attention.

Notes: Pretraining teaches broad language, code, and world regularities from trillions of tokens. The later tuning stages make the pretrained model easier to use, but the foundation is still the expensive pretraining stage.

LinkBack: Transcript 00:16:00-00:23:00.

005 · Tuning, preferences, and reasoning models

00:23:00-00:37:00

The recap then revisits how a pretrained next-token model becomes a useful assistant. Supervised fine-tuning teaches the model to respond in a desired instruction-following format. Preference tuning then uses comparisons between outputs to model what humans prefer. The lecture recalls the Bradley-Terry formulation: the probability that one output beats another depends on the difference between their learned scores. A reward model trained on pairwise preferences can then guide reinforcement-style optimization. PPO was one such approach, but DPO reframed the update more directly around preferences, avoiding some of the complexity of maintaining a separate reinforcement-learning loop. The reasoning lecture added another turn. For math or verifiable tasks, the model can be trained to produce a reasoning chain before the final answer, and GRPO can compare groups of completions using relative rewards without needing a separate value function. The tuning story moves from imitation to preference to verifiable reasoning: each stage asks for a stronger signal about what makes an output useful.

Concept: Bradley-Terry preference model - a pairwise model that estimates the probability one response is preferred over another from their relative reward scores. Slide comparing PPO and GRPO for reasoning-oriented trainingSlide comparing PPO and GRPO for reasoning-oriented training

Mechanism: Preference data supplies supervision when exact answers are unavailable, while verifiable rewards supply cleaner feedback when the task has a known final answer. That distinction explains why reasoning benchmarks can use different optimization strategies from open-ended helpfulness tasks.

Notes: The recap also links chain-of-thought prompting from earlier lectures to reasoning-model training. The model is not only prompted to reason; it can be trained so producing intermediate reasoning becomes part of the policy.

LinkBack: Transcript 00:23:00-00:37:00.

006 · RAG, agents, and evaluation as deployment layers

00:37:00-00:49:40

Once the model can generate and reason, the course moves into deployment architectures. RAG appears when the model needs information that is recent, private, or absent from pretraining. Candidate retrieval uses a bi-encoder style semantic search: embed the query, compare it against precomputed document embeddings, and retrieve high-similarity candidates. Reranking then uses a more expensive cross-encoder style model to score query-document pairs more precisely. Agents add another layer by giving the model tools and a loop: observe, plan, act, and synthesize. That loop makes reliability harder because errors can enter through retrieval, tool choice, arguments, backend execution, or final response synthesis. Evaluation therefore becomes the control layer for the whole system. Human ratings, reference metrics, LLM-as-judge, tool-call evaluation, benchmarks, cost, and safety all measure different failure modes. RAG, agents, and evaluation turn a language model from a standalone generator into a measured system that retrieves, acts, and can be debugged.

Concept: Deployment layer - the surrounding system logic, such as retrieval, tools, agents, and evaluation, that determines whether the model's raw capability becomes useful behavior. Course recap slide summarizing RAG, agents, and evaluationCourse recap slide summarizing RAG, agents, and evaluation

Mechanism: Retrieval improves knowledge freshness; tools improve action space; evaluation improves feedback. These are complementary system layers, not replacements for the base model.

Notes: This section closes the recap portion. The lecture has now walked from embeddings to attention, transformers, scaling, tuning, reasoning, retrieval, agents, and evaluation, so the current-trends section can ask what happens when the same ideas leave pure text.

LinkBack: Transcript 00:37:00-00:49:40.

007 · Vision Transformers: treating image patches as tokens

00:49:40-00:59:40

The current-trends part starts with a question that follows naturally from self-attention: if attention mixes token vectors, do those vectors have to represent words? The lecture uses image understanding as the test case. A classical computer-vision model often carries strong inductive bias through convolutions: nearby pixels interact first, locality matters, and translation-like patterns are built into the architecture. A Vision Transformer reduces that bias. It splits an image into fixed-size patches, flattens or projects each patch into an embedding, adds positional information, and feeds those patch tokens into a transformer encoder. A CLS-like token can summarize the image for classification, just as BERT used a CLS token for text classification. With enough data, the model can learn visual structure from attention rather than receiving it through convolutional locality. Vision Transformers show that self-attention is a general representation mixer: once image patches become tokens, the transformer can learn visual relationships too.

Concept: Image patch token - a fixed-size region of an image projected into a vector so that a transformer can process it like a sequence element. Vision Transformer slide showing patches, positional embeddings, encoder, and classification headVision Transformer slide showing patches, positional embeddings, encoder, and classification head

Mechanism: The move from CNN to ViT trades built-in locality for data-driven attention. That tradeoff is risky with little data but powerful when scale lets the model learn useful visual structure.

Notes: The section is not just about vision. It teaches the broader abstraction: transformer inputs are vectors with positional information, so a modality can join the transformer world if it can be tokenized into meaningful vectors.

LinkBack: Transcript 00:49:40-00:59:40.

008 · Vision-language models and fusion choices

00:59:40-01:05:20

After showing how transformers can process images, the lecture asks how images and text can be combined. One common design uses an image encoder to produce visual tokens, then concatenates those image tokens with text tokens and feeds the combined sequence into a decoder-only LLM. In that setup, the model generates text autoregressively just as before, but the prompt now includes visual information represented as tokens. LLaVA is given as a popular open-weight example of this family. A second, less common design injects image information through cross-attention layers rather than placing visual tokens directly in the input sequence. The lecture mentions Llama 3's paper as an example where image inputs can interact with text tokens through cross-attention. Vision-language models reuse the language-model interface by translating images into token-like representations that text generation can condition on.

Concept: Multimodal token fusion - the design choice of how visual representations enter a language model, either through input concatenation or cross-attention. Slide showing cross-attention fusion for image and text inputsSlide showing cross-attention fusion for image and text inputs

Mechanism: Concatenation treats image tokens as part of the prompt; cross-attention lets text tokens query visual information at selected layers. Both approaches preserve autoregressive text output while changing what information the model can condition on.

Notes: The practical difference is system design. Concatenation is conceptually simple and widely used; cross-attention can be more modular but changes the internal architecture more directly.

LinkBack: Transcript 00:59:40-01:05:20.

009 · Autoregressive inference and the diffusion alternative

01:05:20-01:12:00

The next trend begins with a limitation of the dominant decoder-only paradigm. Autoregressive generation predicts the next token from all previous tokens, appends that token, and repeats until the end-of-sequence condition. Training can be parallelized through teacher forcing because the target tokens are already known: the model can predict many positions in one forward pass. Inference is different. At generation time, token t+1 cannot be produced until token t exists, so the output sequence becomes a serial loop. That serial dependency makes long outputs expensive and latency-sensitive. The lecture then introduces diffusion as an alternative intuition. In image generation, noise is easy to sample; the model learns a transformation that gradually removes noise and moves toward the target image distribution. The Michelangelo sculpture analogy makes the idea memorable: start with noisy material, then remove what does not belong. The diffusion alternative matters because it attacks the inference-time serial bottleneck rather than only improving the transformer block inside that bottleneck.

Concept: Inference-time serial dependency - the requirement that autoregressive decoding must produce each token before the next token can be generated. Slide showing autoregressive modeling limitation and non-parallel inferenceSlide showing autoregressive modeling limitation and non-parallel inference

Mechanism: Autoregressive models parallelize training but not decoding. Diffusion-style models ask whether generation can instead begin from a noisy whole and refine many positions over iterations.

Notes: The lecture uses image diffusion first because the noise-to-image path is intuitive and mathematically mature. Text diffusion then has to answer the harder question: what is the text analogue of noise?

LinkBack: Transcript 01:05:20-01:12:00.

010 · Masked diffusion language models

01:12:00-01:23:20

The lecture's proposed text analogue to image noise is the mask token. For images, noise can be sampled continuously and then denoised. For text, ordinary Gaussian noise does not map naturally onto discrete tokens. Masked diffusion models therefore begin with a partially or fully masked sequence and iteratively reconstruct what belongs behind the masks. In a real setting, the prompt remains visible while the response positions may begin as masks. The model predicts tokens for many masked positions, remasks or refines uncertain positions, and repeats. The lecture names this family MDM, or masked diffusion models, and also notes the term diffusion-based LLM or DLLM. The advantage is conceptual and practical: generation may be less sequential, potentially much faster for long outputs, and naturally suited to fill-in-the-middle tasks where left and right context both matter. The caveat is maturity. These models were presented as emerging research, not as a solved replacement for autoregressive LLMs. Masked diffusion language models replace one-token-at-a-time generation with iterative sequence reconstruction, using mask tokens as the text version of noise.

Concept: Mask token as noise - a discrete placeholder that lets a text diffusion model start from an unknown sequence and learn to reconstruct the missing tokens. Slide illustrating a masked diffusion model for textSlide illustrating a masked diffusion model for text

Mechanism: Instead of extending only the right edge of the sequence, an MDM can revise multiple positions while seeing broader context. That is why coding tasks such as fill in the middle are a natural motivation.

Notes: The lecture mentions speed claims around long outputs, including reports of large speedups in some settings. Treat those as directional evidence, not a universal guarantee, because quality, task type, hardware, and implementation all matter.

LinkBack: Transcript 01:12:00-01:23:20.

011 · Cross-modal pollination and compressed visual representations

01:23:20-01:31:20

Shervin then broadens the trend from one model family to a research pattern: modalities are borrowing ideas from one another. Text models gave transformers to vision, and modern image diffusion models increasingly use transformer backbones instead of pure convolutional architectures. Diffusion ideas are now being explored for text. The pollination also appears at the input-representation level. The lecture cites DeepSeek-OCR, whose name suggests optical character recognition but whose deeper point is representation compression: the model learns to reconstruct text tokens from a small number of vision tokens. That result suggests that visual representations can sometimes carry dense information about text, which opens a provocative question. If text can be compressed into few visual tokens, perhaps future models will mix modalities not only for human-facing inputs but also for internal efficiency. Cross-modal pollination means that progress in one modality becomes a design hypothesis for another modality, from architecture to objective to token representation.

Concept: Representation transfer - using a representation form learned in one modality, such as vision tokens, to support tasks usually associated with another modality, such as text reconstruction. Slide listing cross-pollination between modalities and DeepSeek-OCRSlide listing cross-pollination between modalities and DeepSeek-OCR

Mechanism: The transformer made modalities comparable because each modality can be expressed as token-like vectors. Once that abstraction exists, architectures and objectives can migrate across text, image, audio, video, and code.

Notes: The interesting question is not whether a model is text-only or vision-only. The question is which representation gives the best tradeoff among fidelity, compression, compute, and downstream usefulness.

LinkBack: Transcript 01:23:20-01:31:20.

012 · The transformer is dominant but not frozen

01:31:20-01:35:40

The lecture then returns to the architecture itself. Since 2017, the transformer has become the default backbone, but Shervin warns against treating the original paper as the final design. Modern LLMs often use pre-norm rather than post-norm, putting normalization earlier in the block. They may replace layer norm with RMSNorm to reduce parameter cost or improve behavior. They may use grouped query attention or change attention variants across layers. They may use activation functions such as GELU, SwiGLU, or other ReLU-like variants rather than plain ReLU. The point is not to memorize a catalog of tweaks; the point is that real model papers still make many design choices, and theory has not settled all of them. The transformer is the current foundation, but many of its layer-level choices remain active research variables rather than fixed laws.

Concept: Architecture as design space - the view that normalization, attention type, activation, layer ordering, and hardware fit are tunable choices inside the transformer family. Slide returning to transformer basics and open design choicesSlide returning to transformer basics and open design choices

Mechanism: Small block-level changes can matter at scale because they affect stability, memory use, inference speed, and hardware efficiency across billions of repeated operations.

Notes: This section prevents a common misunderstanding. Saying transformers dominate does not mean research is over; it means the community is now optimizing, replacing, or rethinking parts of a very successful template.

LinkBack: Transcript 01:31:20-01:35:40.

013 · Cost frontier, hardware optimization, and small language models

01:35:40-01:44:00

The final technical trend changes the objective from highest benchmark score to useful capability per unit cost. Shervin argues that the last few years emphasized pushing benchmark performance upward, but once important use cases become more solved, the next frontier may be cost-effective high quality. Providers sometimes lose money serving even paid high-tier plans, which reveals that inference cost is not a small detail. Hardware optimization therefore becomes part of model research. Current GPUs are highly optimized for matrix operations, but transformer blocks have special needs: attention requires frequent key-value reads and writes, and memory movement can dominate GPU cost. Small language models also fit this trend. They aim to preserve enough quality for a target task while reducing serving cost, latency, and deployment complexity. The next Pareto frontier is not only quality versus quality; it is quality versus price, latency, memory, and energy.

Concept: Cost-quality frontier - the set of model designs that give the best achievable task quality for a given inference cost or latency budget. Hardware optimization slide describing transformer memory movement challengesHardware optimization slide describing transformer memory movement challenges

Mechanism: A model that is slightly weaker but much cheaper can dominate in production when the user workflow needs many calls, low latency, or private deployment. That is why SLM research and inference optimization matter even while frontier models continue improving.

Notes: This section links back to evaluation. A model-selection report should not ask only which model scores highest; it should ask which model lies on the relevant Pareto frontier for the actual workload.

LinkBack: Transcript 01:35:40-01:44:00.

014 · Future use cases, reliability, and learning beyond the class

01:44:00-01:51:25

The lecture closes by moving from research trends to user-facing systems. Coding assistants already show how natural language can become code, and many other domains can be reframed as text-to-query, text-to-code, or text-to-visualization tasks. Web browsing may need new trust infrastructure, perhaps certificates or site signals that tell AI assistants which pages are safe to navigate. OS-level assistants may eventually operate across desktop or mobile workflows. But Shervin also emphasizes reliability. Agentic systems fail more often as the number of steps increases, and customer service exposes human-value dimensions that are hard to fake: empathy, groundedness, persistence, and the ability to solve the real problem. The lecture then gives students a practical path for staying current: read arXiv, NeurIPS, ICML, ICLR, ACL, EMNLP, GitHub repositories, Hugging Face model papers, company blogs, and theory or practical NLP channels. It ends with thanks to the class, online viewers, collaborators, and the multilingual cheatsheet community. The final standard for future AI systems is usefulness under real human constraints: reliability, trust, cost, empathy, and fit to the task.

Concept: Human-centered deployment - evaluating future LLM systems by whether they help real users complete real workflows safely and reliably, not by novelty alone. Closing slide with multilingual VIP cheatsheet for continued learningClosing slide with multilingual VIP cheatsheet for continued learning

Mechanism: As assistants move from answering text to acting in software environments, small reliability errors compound across steps. That is why future progress depends on grounding, verification, permissions, interface design, and user trust.

Notes: The teddy bear returns at the end as a course motif, but the substantive ending is the learning path. The field changes quickly, so the course provides concepts and reading habits rather than a final frozen catalog of models.

LinkBack: Transcript 01:44:00-01:51:25.

AppendixA Expansion: The following study cues strengthen the Chapter 4 watch-along layer without changing section boundaries.

StudyCue_001: Treat the three-part agenda as the lecture's control flow: first recover the old context, then inspect new research directions, then decide how to keep learning after the course. This cue keeps the recap from feeling like loose review.

StudyCue_002: The attention formula matters because it is both a mathematical operation and a systems-friendly batch computation. Remember the mechanism as relevance scoring plus value mixing, not as a symbol to memorize.

StudyCue_003: Encoder-only, decoder-only, and encoder-decoder models differ because masking and architecture decide whether information is represented, generated, or transformed. This is the cleanest way to organize BERT, GPT, and T5 in one mental table.

StudyCue_004: The training story is a constrained optimization problem: choose scale, data, memory movement, and parallelism so loss improves under a real compute budget. Chinchilla and flash attention answer different parts of that same constraint.

StudyCue_005: Preference optimization and reasoning optimization both ask how to move beyond imitation, but they use different feedback: human comparisons for open-ended helpfulness and verifiable rewards for tasks with known answers.

StudyCue_006: RAG, agents, and evaluation are deployment multipliers: retrieval expands knowledge, tools expand action, and evaluation tells the system where it failed. When a deployed workflow breaks, localize the failure to one of those layers.

StudyCue_007: ViT is less about images specifically and more about the tokenization principle: if a modality can become ordered vectors, attention can operate on it. The image patch is the visual analogue of a token.

StudyCue_008: VLM design asks where vision enters the language model: as extra prompt tokens through concatenation or as information queried through cross-attention. Both choices preserve text generation while changing the conditioning signal.

StudyCue_009: The autoregressive bottleneck is a runtime dependency, not a training dependency: teacher forcing makes training parallel, but inference must wait for each sampled token. Diffusion-style models are interesting because they target that dependency directly.

StudyCue_010: Masked diffusion for text uses unknown positions as the denoising problem, so generation becomes iterative reconstruction rather than right-edge extension. This makes bidirectional context and fill-in-the-middle tasks natural use cases.

StudyCue_011: Cross-modal pollination is a research method: take a successful mechanism from one modality, translate its representation assumptions, and test whether the mechanism survives in another modality.

StudyCue_012: The transformer should be studied as a living design space, not a frozen 2017 diagram. Normalization, attention variants, activations, and hardware layout are still places where performance and cost can change.

StudyCue_013: A model-selection decision becomes serious only when quality is plotted against cost, latency, memory, privacy, and reliability. That is why small language models can be strategically important even when frontier models remain stronger.

StudyCue_014: The future assistant test is not whether the demo looks intelligent; it is whether the system completes multi-step work with enough grounding, permissioning, empathy, and error recovery for a human to trust it.

Retrieval_001: Lecture 9 is best remembered as a dependency graph: the recap tells you which earlier ideas must be active before current trends make sense.

Retrieval_002: Attention is the bridge from local token identity to global context, so every later architecture inherits the same question: what should attend to what?

Retrieval_003: The encoder-decoder taxonomy is a task contract: classification needs representations, generation needs causal decoding, and translation-style tasks need both input encoding and output decoding.

Retrieval_004: Scaling laws describe the direction of improvement, while Chinchilla, flash attention, and parallelism describe how to make that improvement affordable enough to run.

Retrieval_005: RLHF, DPO, and GRPO differ in mechanics, but all use feedback beyond raw next-token likelihood to push the model toward preferred or verifiably correct behavior.

Retrieval_006: A deployed LLM system should be debugged by layer: knowledge source, retrieval, tool choice, tool execution, final synthesis, and evaluation signal.

Retrieval_007: The ViT lesson is that tokenization defines the problem interface: once patches become embeddings, vision becomes a sequence-modeling problem.

Retrieval_008: A VLM succeeds only if the visual representation enters the language model at the right place and remains usable for autoregressive answer generation.

Retrieval_009: Autoregressive decoding is powerful but latency-bound because the model creates its own future context one token at a time.

Retrieval_010: Masked diffusion changes the generation geometry: it fills and refines a whole response region instead of growing a response from left to right.

Retrieval_011: Cross-modal transfer works when the borrowed method respects the target modality's representation, objective, and evaluation constraints.

Retrieval_012: Transformer research remains open because small architectural choices become large cost, stability, and quality differences at scale.

Retrieval_013: The SLM and hardware trend reframes model progress as efficient service: the best model for a workflow may be the cheapest reliable model that clears the task bar.

Retrieval_014: The closing user-interface trend says capability is not enough; AI assistants must earn trust through reliable action, understandable limits, and useful recovery when things go wrong.

Contrast: The lecture's deepest contrast is not old models versus new models; it is sequential generation versus whole-sequence refinement, single-modality tokens versus cross-modal tokens, and benchmark quality versus production cost.

Contrast: Transformer research now splits into three linked fronts: change what the tokens represent, change how generation unfolds, and change how efficiently the architecture runs on real hardware.

Contrast: The course recap explains why current trends are legible: ViT reuses attention, VLMs reuse token conditioning, MDMs challenge autoregression, and SLMs challenge the assumption that bigger is always the practical winner.

Contrast: For Sid's practical use, the final lesson is decision-oriented: choose models and agent designs by failure mode, latency, cost, grounding, tool reliability, and user trust.

FinalAnchor: From a systems perspective, Lecture 9 says every LLM trend changes one of four interfaces: the data-to-token interface, the token-to-representation interface, the representation-to-generation interface, or the model-to-user interface.

FinalAnchor: From a product perspective, the winning design is not the most fashionable architecture; it is the architecture, retrieval layer, tool loop, evaluator, and cost profile that jointly solve the user's task.

FinalAnchor: From a learning perspective, the safest way to track the field is to keep the CME295 map active: architecture, training, tuning, reasoning, retrieval, agents, evaluation, multimodality, inference cost, and human use.

5. Suggested Answers

Question 1. How does the lecture connect embeddings, attention, and transformers into the first step of the CME295 course map?

Answer 1. It starts from the need to turn text into vectors, then shows that self-attention lets each token update itself by weighting other token representations, and finally places that operation inside the transformer architecture. Embeddings make tokens computable, attention makes them contextual, and transformers stack that contextualization into a reusable model architecture.

Question 2. Why does the recap distinguish encoder-only, decoder-only, and encoder-decoder transformer models?

Answer 2. The distinction explains what the model can naturally do. Encoder-only models such as BERT produce embeddings for classification or retrieval, decoder-only models such as GPT generate text autoregressively, and encoder-decoder models such as T5 map one sequence into another. The kept transformer components determine whether the system mainly encodes, generates, or translates.

Question 3. What mechanism separates scaling an LLM from training it efficiently under a fixed compute budget?

Answer 3. Scaling says that more parameters, data, and compute can improve loss, but compute-optimal training asks how to allocate a fixed budget between model size and data size. Systems methods such as flash attention and parallelism then make the chosen allocation feasible. Efficient training is scaling constrained by compute, memory, bandwidth, and data allocation.

Question 4. How do reward models, Bradley-Terry preferences, PPO, DPO, and GRPO fit into the tuning and reasoning story?

Answer 4. Pairwise human preferences can train reward models through Bradley-Terry comparisons; PPO uses reward-style optimization, DPO optimizes more directly from preference data, and GRPO uses relative grouped rewards for reasoning tasks with verifiable answers. The common theme is learning from stronger feedback than next-token imitation.

Question 5. Why does the lecture put RAG, agents, and evaluation after the model-training material rather than before it?

Answer 5. Those topics surround the trained model with system capabilities: RAG supplies fresh or private knowledge, agents supply tools and loops, and evaluation measures whether the whole behavior works. They are deployment layers that turn a trained generator into a usable, debuggable system.

Question 6. If self-attention was built for token sequences, why can a Vision Transformer use it on images?

Answer 6. A Vision Transformer first turns an image into a sequence of patch embeddings with positional information, so attention can operate on patch vectors just as it operates on word-token vectors. Once image patches become tokens, self-attention can learn relationships among visual regions.

Question 7. What is the main design choice behind vision-language models that concatenate image tokens with text tokens?

Answer 7. The model uses an image encoder to convert visual content into token-like embeddings, concatenates them with text tokens, and lets the decoder condition its next-token predictions on both modalities. The design keeps the language-model generation interface while expanding the prompt to include visual tokens.

Question 8. Why is autoregressive generation slow at inference even though teacher-forced training can be parallelized?

Answer 8. During training, the target sequence is known, so the model can predict many positions in parallel. During inference, each new token must be generated before it can be used as context for the next token. Inference is serial because the model does not yet have the future tokens it must condition on.

Question 9. In the diffusion analogy, why do mask tokens play the role of noise for text generation?

Answer 9. Continuous image noise does not map naturally onto discrete text tokens, so masked diffusion models use mask tokens as unknown positions that the model iteratively reconstructs. For text, the mask token is the denoising target's placeholder: it marks what must be recovered.

Question 10. Why might masked diffusion language models help with speed and fill-in-the-middle tasks, and why are they not automatically a replacement for LLMs?

Answer 10. They may predict and refine many positions in parallel, and they can use both left and right context for missing middle spans. But the paradigm is newer, and quality, robustness, tooling, and task fit still need evidence. MDMs attack a real bottleneck, but replacing autoregressive LLMs requires matching their quality and reliability across tasks.

Question 11. What does cross-modal pollination mean, and why does DeepSeek-OCR make the input-representation question interesting?

Answer 11. Cross-modal pollination means architectures, objectives, and token representations move between fields such as text, image, audio, and video. DeepSeek-OCR is interesting because it suggests text can be reconstructed from few visual tokens. The input representation itself may become a compression and efficiency tool, not merely a modality label.

Question 12. Why does Shervin say the transformer architecture is not set in stone?

Answer 12. Modern model papers still vary normalization placement, normalization type, attention variants, activation functions, and hardware-oriented design choices. The transformer is a successful family, but its best internal design remains an active research space.

Question 13. Why does the lecture expect cost-efficient small language models to matter once benchmark quality improves?

Answer 13. When many tasks become solvable, product value shifts toward serving the task cheaply, quickly, privately, and reliably. Small models can be preferable if they provide enough quality at much lower inference cost. A model can win in production by lying on the right cost-quality frontier, not by being the largest model.

Question 14. What practical standard does the final part of the lecture use for judging future LLM agents and assistants?

Answer 14. It judges them by real usefulness: can they code, browse, visualize, operate software, or help customers without compounding errors or losing user trust? Future agents must be reliable, grounded, cost-aware, and human-useful, not merely impressive demos.