Appendix A: References and further reading
local graph
Appendix A: References and further reading
Section titled “Appendix A: References and further reading”appendix A References and further reading
A.1 Chapter 1: Understanding reasoning models
Section titled “A.1 Chapter 1: Understanding reasoning models”A.1.1 References
Section titled “A.1.1 References”This is the announcement article for OpenAI’s o1 model, which is regarded as the first LLM-based reasoning model:
- OpenAI, “Introducing OpenAI o1-preview” (Sept. 12, 2024), https://openai .com/index/introducing-openai-o1-preview/
DeepSeek-R1 is the first open source reasoning model to be accompanied by a comprehensive technical report showing that reasoning emerges from reinforcement learning with verifiable rewards (a topic covered in more detail in chapter 5):
- DeepSeek-AI, Daya Guo, Dejian Yang, et al., “DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning” (Jan. 22, 2025), https://arxiv.org/abs/2501.12948
This is the OpenAI CEO’s comment on the reasoning (“chain-of-thought”) capabilities of future models: “We will next ship GPT-4.5, the model we called Orion internally, as our last non-chain-of-thought model.”
- Sam Altman, post on X (Feb. 12, 2025), https://x.com/sama/status/ 1889755723078443244
A research paper by AI researchers at Apple found that reasoning models are sophisticated (but very capable) pattern matchers:
- Parshin Shojae, Iman Mirzadeh, Keivan Alizadeh, et al., “The Illusion of Thinking: Understanding the Strengths and Limitations of Reasoning Models via the Lens of Problem Complexity” (Jun. 2025), https://machinelearning.apple.com/research/illusion-of-thinking
The following book is an in-depth guide to implementing and training large language models step by step:
- Sebastian Raschka, Build a Large Language Model (From Scratch), (Manning, 2024), http://mng.bz/orYv
A.1.2 Further reading
Section titled “A.1.2 Further reading”The following article is an introduction to how DeepSeek-R1 works, providing insights into the foundations of reasoning in LLMs:
- Sebastian Raschka, “Understanding Reasoning LLMs” (Feb. 5, 2025), https://magazine.sebastianraschka.com/p/understanding-reasoning-llms
2 Chapter 2: Generating text with a pretrained LLM
A.2.1 References
Section titled “A.2.1 References”You can find the official installation page for the uv Python package and project manager at the following URL:
- “Installing uv,” https://docs.astral.sh/uv/getting-started/installation/
These are two user-friendly and popular cloud compute platforms with GPU support:
- Lightning AI, https://lightning.ai/
- Google Colab, https://colab.research.google.com/
The following articles provide Qwen3 resources with additional benchmark results and comparisons with other models:
- “Qwen3: Think Deeper, Act Faster” (Apr. 28, 2025), https://qwen.ai/blog?id=qwen3
- An Yang, Anfeng Li, Baosong Yang, et al., “Qwen3 Technical report” (May 14, 2025), https://arxiv.org/abs/2505.09388
If you are curious about KV cache sizes for different sequence lengths, you can find a handy calculator app here:
- KV cache size calculator, https://lmcache.ai/kv_cache_calculator.html
A.2.2 Further reading
Section titled “A.2.2 Further reading”This is a PyTorch tutorial for those new to PyTorch or wanting a refresher:
- Sebastian Raschka, “PyTorch in One Hour: From Tensors to Training Neural Networks on Multiple GPUs tutorial” (July 1, 2025), https://sebastianraschka.com/teaching/pytorch-1h
The following are additional resources on tokenization:
- Sebastian Raschka, Build a Large Language Model (from Scratch), chapter 2 (Manning, 2024), https://mng.bz/M96o
- Sebastian Raschka, “Implementing A Byte Pair Encoding (BPE) Tokenizer From Scratch” (Jan. 17, 2025), https://sebastianraschka.com/blog/2025/bpe-from-scratch.html
If you are interested in more in-depth PyTorch coverage, I recommend the following two books:
- Howard Huang, Eli Stevens, Luca Antiga, and Thomas Viehmann, Deep Learning with PyTorch (Manning 2026), https://www.manning.com/books/deep-learning-with-pytorch-second-edition
- Sebastian Raschka, Yuxi (Hayden) Liu, and Vahid Mirjalili, Machine Learning with PyTorch and Scikit-Learn (Packt Publishing, 2022), https://www.amazon.com/Machine-Learning-PyTorch-Scikit-Learn-learning/dp/1801819319/
A.3 Chapter 3: Evaluating reasoning models
Section titled “A.3 Chapter 3: Evaluating reasoning models”A.3.1 References
Section titled “A.3.1 References”The MATH-500 dataset originated from the MATH dataset, introduced in the following paper, which contains 12,500 problems across algebra, geometry, probability, number theory, and more:
- Dan Hendrycks, Collin Burns, Saurav Kadavath, et al., “Measuring Mathematical Problem Solving With the MATH Dataset” (Mar. 5, 2021), https://arxiv.org/abs/2103.03874
The MATH-500 split (created from the original MATH dataset) was proposed in the following paper:
- Hunter Lightman, Vineet Kosaraju, Yura Burda, et al., “Let’s Verify Step by Step” (31 May 2023), https://arxiv.org/abs/2305.20050
A.3.2 Further reading
Section titled “A.3.2 Further reading”If you are interested in SymPy, a Python library for math and symbolic computation (not required for this book), you can learn more in this official tutorial:
- SymPy, “Introductory Tutorial,” https://docs.sympy.org/latest/tutorials/intro-tutorial/index.html
The following article presents an example of a system (here, a fine-tuned LLM) that also evaluates intermediate reasoning steps:
- Shijie Xia, Xuefeng Li, Yixin Liu, et al., “Evaluating Mathematical Reasoning Beyond Accuracy,” Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics, Volume 1: Long Papers (2023), 6858–6877, https://arxiv.org/pdf/2404.05692
The following is a large-scale dataset containing 800,000 step-level correctness labels for model-generated solutions to problems from the MATH dataset:
- Hunter Lightman, Vineet Kosaraju, Yura Burda, et al., “Let’s Verify Step by Step” (May 31, 2023), https://arxiv.org/abs/2305.20050
An article describing the rising cost of LLM evaluation found that evaluating reasoning models such as o1 on seven popular benchmarks costs approximately $1,500:
- Kyle Wiggers, “The rise of AI ‘reasoning’ models is making benchmarking more expensive” (Apr. 10, 2025), https://techcrunch.com/2025/04/10/the-rise-of-ai-reasoning-models-is-making-benchmarking-more-expensive/
The following is a comprehensive 2025 survey on LLM benchmarks:
- Shiwen Ni, Guhong Chen, Shuaimin Li, et al., “A Survey on Large Language Model Benchmarks” (Aug. 21, 2025), https://arxiv.org/abs/2508.15361
Rather than relying only on deterministic and symbolic verifiers, a recent research project showed that small reasoning models can themselves be used successfully as verifiers for other reasoning models:
- Ding Chen, Qingchen Yu, Pengyuan Wang, et al., “xVerify: Efficient Answer Verifier for Reasoning Model Evaluations” (Apr. 14, 2025), https://arxiv.org/abs/2504.10481
A.4 Chapter 4: Improving reasoning with inference-time scaling
A.4.1 References
The following paper formally described chain-of-thought prompting. Note that the paper suggested “Let’s think step by step” as a prompt modification. In my experiments, I’ve found that “Explain step by step” performs better when using the Qwen3 base model, which is why we use it in chapter 4:
- Takeshi Kojima, Shixiang Shane Gu, Machel Reid, et al., “Large Language Models are Zero-Shot Reasoners” (May 24, 2022), https://arxiv.org/abs/2205.11916
The following paper focuses on self-consistency sampling with additional comparison studies:
A.4.2 Further reading
Section titled “A.4.2 Further reading”The following article is an overview and discussion of additional inference scaling methods:
- Sebastian Raschka, “The State of LLM Reasoning Model Inference” (Mar. 8, 2025), https://magazine.sebastianraschka.com/p/state-of-llm-reasoning-and-inference-scaling
A.5 Chapter 5: Inference-time scaling via self-refinement
Section titled “A.5 Chapter 5: Inference-time scaling via self-refinement”A.5.1 References
Section titled “A.5.1 References”Google keeps the methods behind its proprietary Gemini 3 model secret, but based on a recent announcement, we can speculate that it uses inference-scaling techniques similar to self-consistency or best-of-N: “We’re pushing the boundaries of intelligence even further with Gemini 3 Deep Think. This mode meaningfully improves reasoning capabilities by exploring many hypotheses simultaneously to solve problems.”
- Public announcement by Google DeepMind, which develops Gemini, on X (Dec 4, 2025), https://x.com/GoogleDeepMind/status/1996658401233842624?s=21
The DeepSeekMath-V2 paper showed that self-consistency scaling can noticeably improve answer accuracy, and by combining self-consistency with their version of self-refinement (called Best@32 in figure 2 of the following paper), the model achieved gold-level performance in several math competitions:
- Zhihong Shao, Yuxiang Luo, Chengda Lu, et al., “DeepSeekMath-V2: Towards Self-Verifiable Mathematical Reasoning” (Nov. 27, 2025), https://arxiv.org/abs/2511.22570v1
Instead of using a majority vote in self-consistency, we can use a scoring function to rank the different answers and select the best one. This approach is known as best-of-N. Still, when applicable, majority voting often gives better results:
- Junlin Wang, Shang Zhu, Jon Saad-Falcon, et al., “Think Deep, Think Fast: Investigating Efficiency of Verifier-free Inference-time-scaling Methods” (Apr. 18, 2025), https://arxiv.org/abs/2504.14047
A.5.2 Further reading
Section titled “A.5.2 Further reading”The following short article explains the difference between probabilities and likelihood:
- Sebastian Raschka, “What is the difference between likelihood and probability?” https://sebastianraschka.com/faq/docs/probability-vs-likelihood.html
A.6 Chapter 6: Training reasoning models with reinforcement learning
Section titled “A.6 Chapter 6: Training reasoning models with reinforcement learning”A.6.1 References
Section titled “A.6.1 References”The InstructGPT paper demonstrated the effectiveness of RLHF and was instrumental in popularizing RLHF as a standard alignment and fine-tuning approach for LLMs:
- Long Ouyang, Jeff Wu, Xu Jiang, et al., “Training language models to follow instructions with human feedback” (Mar. 4, 2022), https://arxiv.org/abs/2203.02155
The following DeepSeekMath paper introduced the GRPO algorithm:
- Zhihong Shao, Peiyi Wang, Qihao Zhu, et al., “DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models” (Feb. 5, 2024), https://arxiv.org/abs/2402.03300
The DeepSeek-R1 paper showed that strong reasoning behavior can emerge in LLMs through reinforcement learning alone (via RLVR with GRPO). This was most clearly shown in the R1-Zero variant, but combining this approach with a multistage training pipeline yields an even better reasoning model:
- DeepSeek-AI, Daya Guo, Dejian Yang, et al., “DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning” (Jan. 22, 2025), https://arxiv.org/abs/2501.12948
A.6.2 Further reading
Section titled “A.6.2 Further reading”The following article provides a comprehensive walk-through of the DeepSeek-R1 training pipeline involving RLVR:
- Sebastian Raschka, “Understanding Reasoning LLMs: Methods and Strategies for Building and Refining Reasoning Models” (Feb. 5, 2025), https://magazine.sebastianraschka.com/p/understanding-reasoning-llms
This article compares GRPO and PPO for reinforcement learning in the context of LLMs:
- Sebastian Raschka, “The State of Reinforcement Learning for LLM Reasoning: Understanding GRPO and New Insights from Reasoning Model Papers” (Apr. 19, 2025), https://magazine.sebastianraschka.com/p/the-state-of-llm-reasoning-model-training
A.7 Chapter 7: Improving GRPO for reinforcement learning
Section titled “A.7 Chapter 7: Improving GRPO for reinforcement learning”A.7.1 References
Section titled “A.7.1 References”This is the original PPO paper that introduced clipped policy ratios, which we also use here to stabilize GRPO:
- John Schulman, Filip Wolski, Prafulla Dhariwal, et al., “Proximal Policy Optimization Algorithms” (Jul. 20, 2017), https://arxiv.org/abs/1707.06347
The following papers recommend improvements to the GRPO algorithm:
- Qiyng Yu, Zheng Zhang, Ruofei Zhu, et al., “DAPO: An Open-Source LLM Reinforcement Learning System at Scale” (Mar. 18, 2025), https://arxiv.org/abs/2503.14476
- Understanding R1-Zero-Like Training: A Critical Perspective” (Mar. 26, 2025, this paper introduces Dr. GRPO), https://arxiv.org/abs/2503.20783
- Feng Yao, Liyuan Liu, Dinghuai Zhang, et al., “Your Efficient RL Framework Secretly Brings You Off-Policy RL Training” (Aug. 5, 2025, this paper introduces VERL), https://fengyao.notion.site/off-policy-rl
- DeepSeek-AI, Aixin Liu, Aoxue Mei, et al., “DeepSeek-V3.2: Pushing the Frontier of Open Large Language Models” (Dec. 2, 2025), https://arxiv.org/abs/2512.02556
- Shih-Yang Liu, Xin Dong, Ximing Lu, et al., “GDPO: Group reward-Decoupled Normalization Policy Optimization for Multi-reward RL Optimization” (Jan. 8, 2026), https://arxiv.org/abs/2601.05242
- Chujie Zheng, Shixuan Liu, Mingze Li, et al., “Group Sequence Policy Optimization” (Jul. 24, 2025, this paper introduces GSPO), https://arxiv.org/abs/2507.18071
- Aili Chen, Aonian Li, Bangwei Gong, et al., “MiniMax-M1: Scaling Test-Time Compute Efficiently with Lightning Attention” (Jun. 16, 2025, this paper introduces CISPO), https://arxiv.org/abs/2506.13585
A7.2 Further reading
The following article provides a comparison between PPO (the original algorithm used for RLHF) and GRPO:
- Sebastian Raschka, “The State of Reinforcement Learning for LLM Reasoning” (Apr. 19, 2025), https://magazine.sebastianraschka.com/p/the-state-of-llm-reasoning-model-training
The following article is a good technical deep dive discussing different GRPO improvements:
- Cameron R. Wolfe, “GRPO++: Tricks for Making RL Actually Work” (Jan. 5, 2026), https://cameronrwolfe.substack.com/p/grpo-tricks
A8 Chapter 8: Distilling reasoning models for efficient reasoning
A8.1 References
This is the original knowledge-distillation paper that popularized the combination of hard and soft distillation objectives:
- Geoffrey Hinton, Oriol Vinyals, and Jeff Dean, “Distilling the Knowledge in a Neural Network” (Mar. 9, 2015), https://arxiv.org/abs/1503.02531
The DeepSeek-R1 paper described the reasoning-distillation recipe that motivated this chapter, in which a large teacher model generates reasoning traces that are then used to train smaller student models:
- DeepSeek-AI, Daya Guo, Dejian Yang, et al., “DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning” (Jan. 22, 2025), https://arxiv.org/abs/2501.12948
The following paper on distilling large language models reports strong results for carefully designed soft-distillation objectives:
- Yuxian Gu, Li Dong, Furu Wei, and Minlie Huang, “MiniLLM: Knowledge Distillation of Large Language Models” (Jun. 14, 2023), https://arxiv.org/abs/2306.08543
A 8.2 Further reading
The following chapter provides more details on supervised fine-tuning (the technique used in hard distillation) and on masking when working with batches of training examples:
- Sebastian Raschka, Build A Large Language Model (From Scratch), chapter 7 (Manning, 2024), https://www.manning.com/books/build-a-large-language-model-from-scratch
The following article provides a practical walk-through of reasoning-model-training pipelines, including distillation and RLVR:
- Sebastian Raschka, “Understanding Reasoning LLMs: Methods and Strategies for Building and Refining Reasoning Models” (Feb. 5, 2025), https://magazine.sebastianraschka.com/p/understanding-reasoning-llms
A.9 Appendix F: Common approaches to LLM evaluation
Section titled “A.9 Appendix F: Common approaches to LLM evaluation”A.9.1 References
Section titled “A.9.1 References”This is the original paper that introduced the popular multiple-choice MMLU dataset:
- Dan Hendrycks, Collin Burns, Steven Basart, et al., “Measuring Massive Multitask Language Understanding” (Sept. 7, 2020), https://arxiv.org/abs/2009.03300
The following Wikipedia article provides a detailed description of the Elo rating system:
- Elo rating system, https://en.wikipedia.org/wiki/Elo_rating_system
The following paper describes the original methodology behind the popular LLM leaderboard:
A.9.2 Further reading
Section titled “A.9.2 Further reading”The following paper discusses the problems with leaderboards such as LM Arena:
- Shivalika Singh, Yiyang Nan, Alex Wang, et al., “The Leaderboard Illusion” (Apr. 29, 2025), http://arxiv.org/abs/2504.20879
The following article describes OpenAI’s most recent open source model, gpt-oss, in more detail:
- Sebastian Raschka, “From GPT-2 to gpt-oss: Analyzing the Architectural Advances” (Aug. 9, 2025), https://magazine.sebastianraschka.com/p/from-gpt-2-to-gpt-oss-analyzing-the
The following survey compares different LLM judge approaches:
- Jiawei Gu, Xuhui Jiang, Zhichao Shi, et al., “A Survey on LLM-as-a-Judge” (Nov. 23, 2024), https://arxiv.org/abs/2411.15594
The method described in the following paper is an example of a small LLM fine-tuned to act as a judge:
- Mahesh Deshwal and Apoorva Chawla, “PHUDGE: Phi-3 as Scalable Judge” (May 12, 2024), https://arxiv.org/abs/2405.08029