This final lecture recaps the entire CME 295 curriculum, explores 2025's hottest LLM trends including vision transformers and diffusion LLMs, and provides guidance for future learning and research.
Tokenization: Subword tokenization emerged as the standard approach, balancing vocabulary size and representation efficiency.
Word embeddings: Early methods like Word2Vec produced static embeddings that lacked context awareness.
Recurrent Neural Networks (RNNs): Addressed context but suffered from catastrophic forgetting of long-range dependencies.
Self-attention: The revolutionary breakthrough that allows tokens to attend to all other tokens in a sequence regardless of position, using the query-key-value mechanism.
Transformer architecture: Composed of encoder and decoder blocks, with the decoder-only variant becoming the foundation for all modern LLMs.
Rotary Position Embeddings (RoPE): Replaced absolute position embeddings to better encode relative positions between tokens.
Grouped Query Attention (GQA): Reduced memory bandwidth requirements by sharing key and value projections across attention heads.
Pre-norm: Moved normalization layers before sublayers instead of after, improving training stability for deep models.
Model families: Encoder-only (BERT), decoder-only (GPT), and encoder-decoder (T5) architectures.
Mixture of Experts (MoE): A sparse architecture that activates only a subset of parameters for each input, enabling much larger models at lower compute cost.
Scaling laws: The empirical observation that model performance improves predictably with increases in compute, parameters, and training data.
Chinchilla scaling: The critical finding that most models were undertrained, leading to the rule of thumb that a model should be trained on at least 20 tokens per parameter.
Flash Attention: A revolutionary optimization that minimizes memory transfers between GPU memory hierarchies, delivering 2-4x speedups without approximation.
Parallelism strategies: Data parallelism, model parallelism, and pipeline parallelism for training models that cannot fit on a single GPU.
Three-stage training pipeline:
Pre-training: Trains the model on trillions of tokens to predict the next token.
Supervised Fine-Tuning (SFT): Trains the model on high-quality instruction-response pairs.
Preference Tuning: Aligns the model with human preferences using reinforcement learning.
Reward modeling: Uses pairwise preference data to train a model that can score the quality of LLM outputs.
PPO vs GRPO: The shift from Proximal Policy Optimization to Group Relative Policy Optimization, which eliminates the need for a separate value function and is particularly effective for reasoning tasks.
Reasoning models: Models that output a hidden reasoning chain before producing the final answer, dramatically improving performance on math and coding tasks.
Length bias in GRPO: A known issue where the original GRPO loss incentivizes longer outputs, addressed by methods like GRPO Done Right and DAPO.
Retrieval Augmented Generation (RAG): The standard technique for giving LLMs access to up-to-date and private information, using a two-stage retrieval pipeline of candidate retrieval and reranking.
Tool calling: Allows LLMs to invoke external functions to perform actions rather than just generate text.
Agentic workflows: Combine RAG and tool calling into iterative observe-plan-act loops (ReAct framework) to solve complex tasks.
LLM evaluation: The shift from rule-based metrics like BLEU and ROUGE to LLM-as-a-Judge, which provides both scores and rationales for evaluations.
Benchmarks: Standardized test suites covering knowledge (MMLU), reasoning (AIME, PIQA), coding (SWE-bench), safety (HarmBench), and agents (Tau-Bench).
Core insight: The self-attention mechanism is general enough to work on any sequence of vectors, not just text tokens.
How ViT works:
Split an image into fixed-size non-overlapping patches.
Flatten each patch into a vector and project it to a lower dimension using a linear layer.
Add position embeddings to encode the spatial location of each patch.
Add a special token, identical to the one used in BERT.
Pass the entire sequence through a standard transformer encoder.
Use the final embedding of the token for classification tasks.
Key finding: When trained on sufficiently large datasets, Vision Transformers outperform traditional convolutional neural networks (CNNs) despite having much weaker inductive biases.
Vision-Language Models (VLMs): Extend ViT to enable LLMs to understand images by concatenating image patch embeddings with text tokens. Popular examples include LLaVA and Llama 3 Vision.
Motivation: Traditional autoregressive LLMs generate text one token at a time, making inference inherently sequential and difficult to parallelize.
Core insight: What noise is to images, mask tokens are to text.
How diffusion for text works:
Forward process: Gradually mask more and more tokens in a sentence until the entire sequence is masked.
Reverse process: Learn to unmask the tokens to reconstruct the original sentence.
Generation process: Start with a completely masked sequence (conditioned on a prompt) and iteratively unmask tokens to produce the final output.
Key advantages:
Dramatic speedups: Can generate text in 10-20 forward passes regardless of output length, compared to one pass per token for autoregressive models.
Better fill-in-the-middle capabilities: Naturally considers the entire context when generating text, making it ideal for code completion tasks.
Current state: Performance is rapidly approaching parity with state-of-the-art autoregressive models, with recent papers showing promising results. The main remaining challenge is adapting techniques like chain-of-thought reasoning to the diffusion paradigm.
Optimizers: The long-reigning Adam optimizer is being challenged by new approaches like Muon, which promises better performance and lower memory usage.
Normalization: LayerNorm is being replaced by RMSNorm and other more efficient variants.
Attention mechanisms: New attention architectures are constantly being proposed to improve efficiency and performance.
Activation functions: ReLU has been replaced by GELU and SwiGLU, with new functions still being developed.
Model collapse: Training LLMs on LLM-generated data leads to a loss of diversity and degradation in performance over time.
Data curation: The shift from scraping the entire internet to carefully curating high-quality datasets.
Mid-training: A new training stage between pre-training and fine-tuning that uses smaller, higher-quality datasets to boost performance.
Small Language Models (SLMs): The development of smaller, more efficient models that can run on edge devices while still delivering good performance.
Pareto frontier optimization: Balancing performance, cost, and latency to find the optimal model for each use case.
GPU optimizations: Techniques like Flash Attention continue to extract more performance from existing GPU architectures.
Analog computing: Emerging hardware that performs computations using physical properties of materials, promising orders-of-magnitude improvements in energy efficiency and latency.
Democratization: Making agentic workflows accessible to non-technical users through natural language interfaces.
Reliability: Improving the stability and consistency of agents, which currently suffer from high failure rates on multi-step tasks.
Safety: Developing robust security measures to prevent prompt injection and data exfiltration attacks.
Continuous learning: Current LLMs have fixed weights after training and cannot learn new information without fine-tuning or RAG.
Hallucinations: The tendency of LLMs to generate factually incorrect information with high confidence.
Interpretability: Understanding why LLMs produce the outputs they do.
Personalization: Creating LLMs that can adapt to individual user preferences and needs.
arXiv: The primary repository for new research papers.
Conferences: NeurIPS, ICML, ICLR, and ACL are the top venues for LLM research.
Hugging Face: Provides implementations of most state-of-the-art models and papers.
Social media: X (Twitter) has a vibrant LLM research community that shares the latest developments.
YouTube: Educators like Yannic Kilcher and Andrej Karpathy provide in-depth explanations of new papers and concepts.
Company blogs: Major AI companies regularly publish blog posts about their latest research and products.
These are my structured study notes and in-depth interpretations compiled by watching the open course. I hope this knowledge framework helps you thoroughly master the content of this subject. Wish you continuous academic progress and great achievements in your studies.

