Comprehensive Study Notes: A Survey of Large Language Models (2026)

Page 1: Introduction and Historical Context

Survey Overview and Author Information

  • Full Title: A Survey of Large Language Models.

  • Lead Authors: Wayne Xin Zhao, Kun Zhou, Junyi Li, Tianyi Tang, Zican Dong.

  • Affiliations: Gaoling School of Artificial Intelligence and School of Information (Renmin University of China), Department of Computer Science (Universit) de Montr))al).

  • Primary Dimensions of Review:

    1. Pre-training methodologies: Core model capabilities via self-supervised training, architectural innovation, and data curation.

    2. Post-training techniques: Supervised fine-tuning (SFT) and reinforcement learning (RL) for alignment, task adaptation, and safety.

    3. Utilization strategies: In-context learning (ICL), prompt engineering, and agentic reasoning.

    4. Evaluation methods: Benchmarks for reasoning, language capabilities, and safety.

The Four Stages of Language Modeling Development

  1. Statistical Language Models (SLMs): Emerged in the 1990s as nn-gram models based on the Markov assumption. They predict words based on limited context windows but suffer from the curse of dimensionality and data sparsity. Key techniques included smoothing, such as Good-Turing estimation and back-off.

  2. Neural Language Models (NLMs): Leverage neural networks like multilayer perceptrons. Bengio et al. (2003) introduced distributed word representations. Subsequent work like word2vec demonstrated that shallow networks could learn effective embeddings, shifting focus from pure sequence prediction to distributed text representation learning.

  3. Pre-trained Language Models (PLMs): Utilize self-supervised learning on pre-text tasks to acquire contextual semantic representations. ELMo used bidirectional LSTMs; BERT advanced the field using the parallelizable Transformer architecture. This established the "pre-train + fine-tune" paradigm.

  4. Large Language Models (LLMs): Distinguished by scaling model size, data, and compute according to scaling laws. Examples include GPT-3 (175B175B parameters) and PaLM (540B540B parameters). These models exhibit in-context learning and few-shot capabilities that were absent in predecessors like GPT-2.

Page 2: The Modern LLM Landscape and Lifecycle

General-Purpose Foundation Models LLMs have catalyzed a paradigm shift from task-specific models to general-purpose foundation models. They act as accelerators for scientific discovery (synthesizing literature, training coding assistants) and versatile professional assistants capable of planning, reasoning, and tool use.

The Multi-Stage Development Pipeline

  • Foundational Pre-training: Meticulous orchestration of data, architecture, and optimization.

  • Mid-training (Optional): Phase to further refine advanced capabilities.

  • Post-training: Focuses on instruction following, reasoning, alignment with human values, and safety.

  • Utilization: Effectively used via prompt engineering and agentic frameworks.

  • Evaluation: Rigorous benchmarks to steer future development.

Page 3: Key Concepts and Background

The Transformer Architecture The Transformer (Vaswani et al., 2017) is a neural network built entirely on attention mechanisms. It models pairwise relationships between all elements in a sequence.

  • Design Benefits: Inherent parallelizability and exceptional scalability to billions of parameters.

  • Architectural Variants:

    • Encoder-Decoder: Used by early models like T5 and BART.

    • Causal Decoder-only: The de facto standard for modern LLMs (GPT family).

    • Prefix Decoder (Non-causal): Allows bidirectional attention on prefix tokens but maintains unidirectional masks for generation.

Training Paradigm

  • Autoregressive (AR) Language Modeling: Sequentially predicts each token via next-token prediction. It functions similarly to multitask learning, encouraging the acquisition of diverse skills from vast unlabeled text.

  • Task Framing: Solving tasks is framed as a text completion problem where a response is generated based on a specific input.

Page 4: Scaling Laws and Representative Abilities

Scaling Laws (Train-Time) Performance is modeled as a function of model size (NN), dataset size (DD), and training compute (CC). The cross-entropy loss (L(X)L(X)) follows a power-law relationship:

L(X)=CX−αXL(X) = CX^{-\alpha_X}

where X∈{N,C,D}X \in \{N,C,D\}. While initial laws favored model size, later research suggests a balanced scaling of parameters and data quantity. Recently, the focus has shifted to test-time scaling (e.g., OpenAI o1, DeepSeek-R1), where additional computation is allocated during inference to trade efficiency for reasoning depth.

Typical Abilities of LLMs

  • In-context Learning (ICL): Adapting to new tasks via few-shot demonstrations in the prompt.

  • Chain-of-Thought (CoT): Solving complex logic through step-by-step reasoning.

  • Instruction Following: Accurately performing tasks described in natural language.

  • Note on Emergence: While early literature called these "emergent," recent studies suggest jumps in performance may be artifacts of measurement or scale rather than qualitative shifts.

Pre-training: Data Sources

  • General Text Data: Webpages (e.g., CommonCrawl, FineWeb) and Books (e.g., Books3). Web data provides factual knowledge, while books provide formal long-form dependencies.

  • Specialized Text Data: Scientific papers (arXiv), textbooks, and Code (GitHub, Stack Exchange) to improve reasoning and program synthesis.

Page 5: Data Preparation and Preprocessing

Synthetic Text Data Generated by prompting capable models to produce document forms, QA pairs, or CoT trajectories. It helps expand knowledge coverage and refine existing text with reflective annotations.

Preprocessing Pipeline

  • De-duplication: URL, document, and sentence-level deduplication using algorithms like MinHash.

  • Filtering and Privacy: Removing low-quality content and toxic text, and replacing personally identifiable information (PII) using FastText or fine-tuned LLMs.

  • Tokenization: Most use Byte-Pair Encoding (BPE). Vocabulary sizes typically range from 100K100K to 256K256K (e.g., GPT-4o uses 200K200K, Gemma 2 uses 256K256K).

Data Schedule

  • Data Mix: Proportions of sources. LLaMA-3.1 allocates 25%25\% to math/reasoning and 17%17\% to code.

  • General Pre-training Curriculum: Dividing process into phases (e.g., YuLan-Mini used 27 phases). Data sequence often begins with simpler text, introducing reasoning-focused data later. Annealing strategies involve decaying learning rates and curated instruction data in final stages.

  • Long-context Curriculum: Progressively increasing context length (e.g., Qwen2.5-1M: 32K→65K→131K→262K32K \rightarrow 65K \rightarrow 131K \rightarrow 262K) while maintaining mixed batch lengths to prevent catastrophic forgetting.

Page 6: Pre-training Data Effects and Architecture Innovations

Data Scaling and Curation Open-source models like LLaMA-3 are trained on 1515 to 3030 trillion tokens. Concerns exist regarding a "data ceiling" as high-quality human data is exhausted. Synthetic data risks "model collapse" if it lacks new information.

Detailed Formulations (Table 1: Representative configurations)

  • Attention Grouping and Compression:

    • Multi-Head Attention (MHA): HEADi=Attn(XWiQ,XWiK,XWiV)\text{HEAD}_i = \text{Attn}(\mathbf{X}\mathbf{W}_i^Q, \mathbf{X}\mathbf{W}_i^K, \mathbf{X}\mathbf{W}_i^V)

    • Grouped-Query Attention (GQA): used in LLaMA-3.1; HEADi=Attn(XWiQ,XW⌊i/g⌋K,XW⌊i/g⌋V)\text{HEAD}_i = \text{Attn}(\mathbf{X}\mathbf{W}_i^Q, \mathbf{X}\mathbf{W}_{\lfloor i/g \rfloor}^K, \mathbf{X}\mathbf{W}_{\lfloor i/g \rfloor}^V)

    • Multi-Query Attention (MQA): single key/value projection shared across all query heads.

    • Multi-head Latent Attention (MLA): DeepSeek-V3; uses low-rank decomposition to reduce KV cache.

  • Sparse Attention:

    • Sliding Window Attention (SWA): limits attention to local neighbors within window ww.

    • Mixture of Block Attention (MoBA): selects only top-kk relevant blocks for attention.

Page 7: Linear Attention and Positional Encodings

Linear Attention (LA) A sub-quadratic complexity alternative that maintains a fixed-size recurrent state.

  • Evolution Phase:

    1. 1st Gen: RetNet, RWKV-4 (Data-independent forget gates).

    2. 2nd Gen: Mamba (Data-dependent forget gates).

    3. 3rd Gen: DeltaNet (Uses the delta rule as a state-update; prevents state divergence).

  • Mixed Approach: Most models (Qwen3-Next, MiniMax-M1) mix linear attention with full attention in a 3:13:1 ratio for expressiveness.

Positional Encoding (PE)

  • Rotary PE (RoPE): Multiplies queries and keys by a rotary matrix RΘ,tR_{\Theta, t} with rotation degree t⋅Θt \cdot \Theta. Supports extension via interpolation (YaRN, LongRoPE).

  • ALiBi: Incorporates a linear penalty based on relative distance: Aij=WqxixjTWkT−m(i−j)A_{ij} = \mathbf{W_q x_i x_j^T W_k^T} - m(i-j). Good for length extrapolation but acts like a sliding window.

  • CoPE (Contextualized PE): Dynamically computes bias based on semantic interactions.

Page 8: Mixture-of-Experts (MoE) and Alternative Designs

MoE Components

  • Gating Function (Router): Selects top-kk experts for each token. DeepSeek-V3 uses device-limited routing to minimize communication.

  • Experts: Usually feed-forward networks (FFNs). DeepSeek-V3 uses shared experts and fine-grained sub-experts.

  • Load Balancing: Addressed via auxiliary loss (regularizing usage frequency) or auxiliary-loss-free methods that adjust bias terms.

Other Architectures

  • Memory Augmentation: Maintains massive KV pairs in CPU memory, transferring to GPU only when activated via lookups.

  • Looped Transformers: Reuse weights across layers (recurrent mechanism) to improve reasoning efficiency in small models.

  • Diffusion Language Models (DLMs): Adapt masked modeling strategies for parallel multi-token prediction.

Page 9: Pre-training Configurations and Optimization

Optimization Settings

  • Hyperparameters: Warm-up and decay strategies are standard. Optimal learning rates often follow power laws relative to model/data size (μP\mu P parameterization).

  • Optimizers: AdamW is standard (parameters: β1=0.9\beta_1 = 0.9, β2=0.95\beta_2 = 0.95, ϵ=10−8\epsilon = 10^{-8}). Alternatives include Adafactor and Adam-mini. Spectral-norm based optimizers like Muon use Newton-Schulz iterations to avoid SVD compute costs.

Stabilization Techniques

  • Weight Initialization: Scaled per module depth.

  • Weight Decay/Clipping: Thresholds like 1.01.0 for clipping and 0.10.1 for decay are common.

  • zz-loss Regularization: Mitigates abnormal gradient behavior.

Page 10: Scalable Training and Model Comparison

Parallelism Strategies

  • Data Parallelism (DP): Distributing batches.

  • Tensor Parallelism (TP): Splitting matrices across devices.

  • Pipeline Parallelism (PP): Assigning layers to devices; DeepSeek-V3 DualPipe reduces "bubbles."

  • Expert Parallelism (EP): Sharding MoE experts.

  • Context Parallelism (CP): Sharding long sequences.

Memory & Kernel Optimization

  • ZeRO (Zero Redundancy Optimizer): Partitioning optimizer states (ZeRO-1), gradients (ZeRO-2), and parameters (ZeRO-3).

  • FlashAttention: Fuses matrix multiplication with softmax to handle quadratic complexity effectively at the CUDA kernel level.

Representative Training Table (Detailed Extract)

  • GPT-3: 175B175B params, 300B300B tokens, 2K2K context, FP16.

  • LLaMA-3.1: 405B405B params, 15T15T tokens, 128K128K context, BF16.

  • DeepSeek-V3: 671B671B params, 14.8T14.8T tokens, 128K128K context, FP8.

  • Qwen 3: 235B235B params, 36T36T tokens, 128K128K context, FP8.

Page 11: Mid-training and Specialized Enhancement

Refinement Strategy Mid-training bridges general pre-training and downstream specialization (coding, math, agentic tasks).

  • Strategy: Often uses Warmup-Stable-Decay (WSD) cycles. Step-3.5-Flash uses a learning rate schedule warming up to 2×10−52 \times 10^{-5} and decaying to 7.3×10−67.3 \times 10^{-6}.

  • Reasoning Enhancement: Substantial injection of CoT trajectories and agentic task datasets.

  • Long-context Adaptation: Extends context (e.g., up to 200K200K) via length-based curricula and architectural adjustments like ABF for RoPE.

Page 12: Supervised Fine-Tuning (SFT)

Execution and Synthesis

  • General SFT: Mimics human instructions via task-description/input/output triplets.

  • Long-CoT Synthesis: Elicits deep reasoning (o1-style). Uses multi-agent approaches where a critique model evaluates step-by-step solutions from a policy model.

  • Agentic Synthesis: Constructs trajectories involving tool specifications and execution observations within sandboxes.

Page 13: SFT Datasets and Effect

Composition Mix for Instruction Data

  • Mathematical Reasoning: 20%−30%20\% - 30\%

  • Coding: 20%−30%20\% - 30\%

  • Agentic Tasks: 10%−20%10\% - 20\%

  • General/QA: 20%−40%20\% - 40\%

  • Identity/Safety: Minor portion.

Thinking Modes Models like Qwen3 use control flags (e.g., /think and /no_think) to toggle between standard instruct responses and deep reasoning modes.

Page 14: Reinforcement Learning (RL) Rewards

Optimization and Reward Construction RL aligns models with human preferences (Helpfulness, Honesty, Harmlessness - 3H criteria).

  • Rule-based Rewards: Precise signals from symbolic checking, code execution, or truth matching. Standard in RLVR (RL with Verifiable Rewards).

  • Model-based Rewards: Rewards derived from learned estimators trained on human rankings or scoring annotations.

  • Process Reward Modeling (PRM): Scores individual steps in a reasoning chain rather than just the final outcome (Outcome Reward Modeling - ORM).

Page 15: Reinforcement Learning Algorithms

Policy Optimization Paradigms

  • Online RL: Updates policy using rollouts generated in real-time.

    • PPO: Stabilizes updates with clipped objectives and a value function.

    • GRPO (Group Relative Policy Optimization): DeepSeek-V3 method; removes the separate value network, estimating advantage by comparing multiple responses generated for one prompt.

    • RLAIF: Replaces human feedback with AI self-critique (Constitutional AI).

  • Offline RL: Direct learning from fixed preference pairs.

    • DPO (Direct Preference Optimization): Reformulates the RLHF objective into a classification loss on preference pairs.

    • RFT (Rejection Fine-Tuning): Fine-tunes the model on high-quality responses selected via rejection sampling.

Page 16: RLVR and Training Issues

RLVR for Reasoning Specifically effective for mathematics and coding. It incentivizes self-verification and reflection. However, it reshapes the model toward winning strategies rather than necessarily increasing raw model capacity.

Training Challenges

  • Reward Hacking: Explaining loopholes in reward functions (e.g., producing long nonsense outputs that "look" high-quality). Mitigated by penalizing length or using disentangled reward features.

  • Training Dynamics: Requires monitoring entropy to ensure continued exploration.

Page 17: Industrial Post-training Pipelines

The Phased Alignment Cycle

  1. Cold-start: SFT on small-scale, high-quality data.

  2. Initial RL: Often rule-based (RLVR) for reasoning skills.

  3. Hybrid SFT: Mixture of reasoning and general tasks.

  4. Hybrid RL: Final alignment for human preference and safety.

Agentic Post-training Interleaves reasoning with tool calls. Kimi-K2.5 uses an "agent swarm" approach (parallel agents decomposing tasks) and outcome-based evaluators for multimodal behaviors.

Page 18-19: Utilization and Prompting Techniques

In-Context Learning (ICL)

  • Demonstration Selection: Based on similarity, diversity, or LLM-ranking.

  • Mechanism: Transformer MLPs perform low-rank updates during forward passes, a process resembling implicit optimization.

Chain-of-Thought (CoT)

  • Prompting: "Let's think step by step."

  • Mechanism: FFN neurons are activated more broadly during CoT than standard generation, allowing access to deeper learned knowledge.

Page 20-21: Agentic Systems and Advanced Reasoning

Reasoning Enhancement (Test-time Scaling)

  • Sampling: Best-of-NN (BoN) sampling with majority voting (self-consistency).

  • Search: Tree-of-Thoughts (ToT), Graph-of-Thoughts (GoT), and Monte Carlo Tree Search (MCTS) explore multiple paths and backtrack when encountering failures.

Agent Components

  • Memory: Short-term (context window) vs. Long-term (external retrieval).

  • Planning: Task decomposition and iterative revision.

  • Execution: Solving via internal generation or tool use (APIs, Browsers, Interpreters).

Strategic Applications

  • Deep Search: Multi-step navigation and retrieval.

  • Deep Research: Consistent evidence integration and report generation with citations.

  • Code Agents: Iterative debugging and state tracking in codebases.

Page 22: Efficient Deployment

The Memory Wall Autoregressive decoding is memory-bound (prefills are compute-bound, but decoding speed is limited by GPU bandwidth).

  • KV Cache Optimization: PagedAttention manages memory like virtual memory pages to reduce fragmentation.

  • Speculative Decoding: A small draft model predicts tokens, which are verified in parallel by the large model.

  • KV Compression: Token dropping or low-rank decomposition of keys/values.

Page 23: Compression and Evaluation

Quantization

  • Post-Training Quantization (PTQ): Reduces weights to 4-bit or 8-bit.

  • Activation outliers: Make activation quantization harder; handled by Hadamard rotations or protecting "salient weights."

  • Distillation/Pruning: Transferring knowledge to smaller architectures or structural pruning (removing layers).

Basic Evaluation Benchmarks

  • Language: Basic summarization/translation.

  • Reasoning: MATH, GSM8K, HumanEval, MBPP (code).

  • Alignment: IFEval (instruction following), TruthfulQA, RealToxicityPrompts.

  • Comprehensive Platforms: MMLU (multitask knowledge), Chatbot Arena (pairwise human ELO).

Page 24-26: Advanced Abilities and Research Challenges

Emerging Benchmarks

  • Superintelligence/Expertise: AIME (Olympiad math), GPQA (graduate physics/bio/chem).

  • Agentic Assessment: SWE-bench (real GitHub issues), OSWorld (OS interaction).

Open Challenges

  • Theoretical Foundations: Understanding how next-token prediction leads to reasoning.

  • Data Barrier: Depleting high-quality text; need for programmatic data environments.

  • Training Efficiency: Reducing the gap between trillions of tokens for AI vs. minimal data for human learning.

  • Safety: Addressing hallucinations, privacy, and red-teaming for superintelligent models.

  • Sustainability: Addressing energy consumption and carbon footprints during scaling.


Large Language Models (LLMs) generate responses by utilizing a sequence of tokens in a trained model during a process called autoregressive language modeling. When a user inputs a prompt, the model analyzes the context of the tokens within the prompt, predicting the most likely next token based on the training data it has processed. This prediction is iteratively continued, selecting one token at a time until a complete response is formed. The model’s ability to understand context and nuances improves with the number of tokens and the size of the model, allowing for coherent and contextually relevant responses.