liveBook · Manning

What you will learn in How Large Language Models Work

by Edward Raff, Drew Farris and Stella Biderman for Booz Allen Hamilton

Chapter by chapter

Chapter 1: Big picture: What are LLMs?

1.1 Generative AI in context · 1.2 What you will learn · 1.3 Introducing how LLMs work · 1.4 What is intelligence, anyway? · 1.5 How humans and machines represent language differently · 1.6 Generative Pretrained Transformers and friends · 1.7 Why LLMs perform so well · 1.8 LLMs in action: The good, bad, and scary · 1.9 Summary

What you learn in chapter 1 →

Chapter 2: Tokenizers: How large language models see the world

2.1 Tokens as numeric representations · 2.2 Language models see only tokens · 2.2.1 The tokenization process · 2.2.2 Controlling vocabulary size in tokenization · 2.2.3 Tokenization in detail · 2.2.4 The risks of tokenization · 2.3 Tokenization and LLM capabilities · 2.3.1 LLMs are bad at word games · 2.3.2 LLMs are challenged by mathematics · 2.3.3 LLMs and language equity · 2.4 Check your understanding · 2.5 Tokenization in context · 2.6 Summary

What you learn in chapter 2 →

Chapter 3: Transformers: How inputs become outputs

3.1 The transformer model · 3.1.1 Layers of the transformer model · 3.2 Exploring the transformer architecture in detail · 3.2.1 Embedding layers · 3.2.2 Transformer layers · 3.2.3 Unembedding layers · 3.3 The tradeoff between creativity and topical responses · 3.4 Transformers in context · 3.5 Summary

What you learn in chapter 3 →

Chapter 4: How LLMs learn

4.1 Gradient descent · 4.1.1 What is a loss function? · 4.1.2 What is gradient descent? · 4.2 LLMs learn to mimic human text · 4.2.1 LLM reward functions · 4.3 LLMs and novel tasks · 4.3.1 Failing to identify the correct task · 4.3.2 LLMs cannot plan · 4.4 If LLMs cannot extrapolate well, can I use them? · 4.5 Is bigger better? · 4.6 Summary

What you learn in chapter 4 →

Chapter 5: How do we constrain the behavior of LLMs?

5.1 Why do we want to constrain behavior? · 5.1.1 Base models are not very usable · 5.1.2 Not all model outputs are desirable · 5.1.3 Some cases require specific formatting · 5.2 Fine-tuning: The primary method of changing behavior · 5.2.1 Supervised fine-tuning · 5.2.2 Reinforcement learning from human feedback · 5.2.3 Fine-tuning: The big picture · 5.3 The mechanics of RLHF · 5.3.1 Beginning with a naive RLHF · 5.3.2 The quality reward model · 5.3.3 The similar-but-different RLHF objective · 5.4 Other factors in customizing LLM behavior · 5.4.1 Altering training data · 5.4.2 Altering base model training · 5.4.3 Altering the outputs · 5.5 Integrating LLMs into larger workflows · 5.5.1 Customizing LLMs with retrieval augmented generation · 5.5.2 General-purpose LLM programming · 5.6 Summary

What you learn in chapter 5 →

Chapter 6: Beyond natural language processing

6.1 LLMs for software development · 6.1.1 Improving LLMs to work with code · 6.1.2 Validating code generated by LLMs · 6.1.3 Improving code via formatting · 6.2 LLMs for formal mathematics · 6.2.1 Sanitized input · 6.2.2 Helping LLMs understand numbers · 6.2.3 Math LLMs also use tools · 6.3 Transformers and computer vision · 6.3.1 Converting images to patches and back · 6.3.2 Multimodal models using images and text · 6.3.3 Applicability of prior lessons · 6.4 Summary

What you learn in chapter 6 →

Chapter 7: Misconceptions, limits, and eminent abilities of LLMs

7.1 Human rate of learning vs. LLMs · 7.1.1 The limitations on self-improvement · 7.1.2 Few-shot learning · 7.2 Efficiency of work: A 10-watt human brain vs. a 2000-watt computer · 7.2.1 Power · 7.2.2 Latency, scalability, and availability · 7.2.3 Refinement · 7.3 Language models are not models of the world · 7.4 Computational limits: Hard problems are still hard · 7.4.1 Using fuzzy algorithms for fuzzy problems · 7.4.2 When close enough is good enough for hard problems · 7.5 Summary

What you learn in chapter 7 →

Chapter 8: Designing solutions with large language models

8.1 Just make a chatbot? · 8.2 Automation bias · 8.2.1 Changing the process · 8.2.2 When things are too risky for autonomous LLMs · 8.3 Using more than LLMs to reduce risk · 8.3.1 Combining LLM embeddings with other tools · 8.3.2 Designing a solution that uses embeddings · 8.4 Technology presentation matters · 8.4.1 How can you be transparent? · 8.4.2 Aligning incentives with users · 8.4.3 Incorporating feedback cycles · 8.5 Summary

What you learn in chapter 8 →

Chapter 9: Ethics of building and using LLMs

9.1 Why did we build LLMs at all? · 9.1.1 The pros and cons of LLMs doing everything · 9.1.2 Do we want to automate all human work? · 9.2 Do LLMs pose an existential risk? · 9.2.1 Self-improvement and the iterative S-curve · 9.2.2 The alignment problem · 9.3 The ethics of data sourcing and reuse · 9.3.1 What is fair use? · 9.3.2 The challenges associated with compensating content creators · 9.3.3 The limitations of public domain data · 9.4 Ethical concerns with LLM outputs · 9.4.1 Licensing implications for LLM output · 9.4.2 Do LLM outputs poison the well? · 9.5 Other explorations in LLM ethics · 9.6 Summary

What you learn in chapter 9 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.