Foundations of Large Language Models
by Tong Xiao and Jingbo Zhu (Northeastern University NLP Lab and NiuTrans Research)
A free textbook on how LLMs are pre-trained, aligned, served and taught to reason, updated October 2026.
Overview
Foundations of Large Language Models is a free book by Tong Xiao and Jingbo Zhu of the NLP Lab at Northeastern University and NiuTrans Research, posted on arXiv as 2501.09223. The current version, v4, is dated October 8, 2026 and lists minor corrections; v3 followed on September 24, 2026. The June 2025 abstract described five chapters, and the current one describes six after adding reasoning. Chapter 1 covers pre-training, using BERT as the worked example. Chapter 2 covers generative models, including distributed training, scaling laws and long-sequence modeling with cache and memory techniques. Chapter 3 covers prompting, from chain of thought and problem decomposition to self-refinement, ensembling, RAG and tool use, and prompt optimization. Chapter 4 covers alignment: supervised fine-tuning, fine-tuning data construction, weak-to-strong generalization, RLHF reward models and direct preference optimization. Chapter 5 covers inference: prefilling and decoding, decoding algorithms, prefix caching, batching, parallelization and inference-time scaling. Chapter 6 covers reasoning, including sampling multiple reasoning paths, verification, on-policy distillation and outcome-based versus process-based evaluation. The book is written in mathematical notation and shows no code exercises in its contents. The authors say it favors foundations over full coverage of cutting-edge methods. It is drawn from their longer NLPBook project on GitHub, which adds machine learning, neural network and Transformer background.
At a Glance
- Topic
- Models
- Level
- Intermediate
- Format
- Book
- Cost
- Free
- Duration
- ~280 pages before the bibliography, self-paced; expect several weeks for a full read
- Provider
- Tong Xiao and Jingbo Zhu (Northeastern University NLP Lab and NiuTrans Research)
- Hands-on
- No
- Certificate
- None
What You’ll Learn
- ✓Compare decoder-only, encoder-only and encoder-decoder pre-training tasks, with BERT as the worked example
- ✓Explain how LLM training scales through data preparation, model modifications, distributed training and scaling laws
- ✓Apply chain of thought, problem decomposition, self-refinement, ensembling and prompt optimization methods to harder tasks
- ✓Describe instruction alignment, fine-tuning data construction and weak-to-strong generalization for adapting pre-trained models
- ✓Work through RLHF reward model training and direct preference optimization for human preference alignment
- ✓Analyze decoding algorithms, prefix caching, batching and parallelization when reasoning about efficient LLM inference
- ✓Distinguish inference-time reasoning from learned reasoning, including process supervision and on-policy distillation
- ✓Evaluate reasoning LLMs with outcome-based and process-based approaches and understand the open issues in each
Highlights
- •Actively revised: v3 and v4 landed on September 24 and October 8, 2026, and reasoning is now the sixth chapter
- •The inference chapter runs about 40 pages (pp. 203-246) on prefilling, decoding algorithms, prefix caching, batching and inference-time scaling
- •The 2025 arXiv release drew 219 points on Hacker News, though commenters mostly debated authorship and peer review and said little about the content
- •It is an arXiv preprint with no code exercises, and RAG and tool use get one subsection (pp. 133-137), so pair it with a hands-on course
- •The parent NLPBook repository on GitHub showed about 900 stars and 154 forks when checked on November 2, 2026, and supplies the background chapters
Who It’s For
Best For
- ✓AI engineers who build on LLM APIs and want the theory behind training, alignment and inference
- ✓Graduate students who want a free, structured LLM text organized by training stage
- ✓Engineers who need to understand RLHF and reasoning models before fine-tuning or choosing a serving stack
Prerequisites
- •Machine learning and neural network basics, including Transformers; the authors say chapters are self-contained but this background makes reading easier
- •Comfort with mathematical notation for probability, gradients, attention matrices and KL divergence, all of which the book uses
FAQ
What is Foundations of Large Language Models?
Foundations of Large Language Models is a free textbook for students, engineers and NLP practitioners who want to understand how LLMs work below the API. After reading it you can reason about training at scale, RLHF, decoding and batching trade-offs, and how reasoning models are built and evaluated.
Is Foundations of Large Language Models free?
Foundations of Large Language Models is free to access.
What level is Foundations of Large Language Models for?
Foundations of Large Language Models is aimed at a intermediate audience. Recommended background: Machine learning and neural network basics, including Transformers; the authors say chapters are self-contained but this background makes reading easier, Comfort with mathematical notation for probability, gradients, attention matrices and KL divergence, all of which the book uses.
How long does Foundations of Large Language Models take?
Expect roughly ~280 pages before the bibliography, self-paced; expect several weeks for a full read. Most learners work through it at their own pace.
What will I learn from Foundations of Large Language Models?
You'll learn: Compare decoder-only, encoder-only and encoder-decoder pre-training tasks, with BERT as the worked example; Explain how LLM training scales through data preparation, model modifications, distributed training and scaling laws; Apply chain of thought, problem decomposition, self-refinement, ensembling and prompt optimization methods to harder tasks; Describe instruction alignment, fine-tuning data construction and weak-to-strong generalization for adapting pre-trained models; Work through RLHF reward model training and direct preference optimization for human preference alignment; Analyze decoding algorithms, prefix caching, batching and parallelization when reasoning about efficient LLM inference; Distinguish inference-time reasoning from learned reasoning, including process supervision and on-policy distillation; Evaluate reasoning LLMs with outcome-based and process-based approaches and understand the open issues in each.
Topics
Sources
This page was written from 5 sources, 2 on domains other than arxiv.org.