Leanpub Header

Skip to main content

Material for The Hundred-Page Language Models Course

The author is letting you choose the price you pay for this book!

Pick Your Price...
PDF
EPUB
WEB
About

About

About the Book

Price

Pick Your Price...

Minimum price

$19.00

$29.00

You pay

$29.00

Author earns

$23.20
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 2)

2
The author will earn $24.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Author

Andriy Burkov

Andriy Burkov holds a PhD in Artificial Intelligence. He works as a machine learning team leader at TalentNeuron.

Leanpub Podcast

Episode 319

An Interview with Andriy Burkov

Contents

Table of Contents

Lesson 1. Machine Learning Basics

  1. 1.1. About the videos
  2. 1.2. About this lesson
  3. 1.3. AI and Machine Learning
  4. 1.3.1. Early Progress
  5. 1.3.2. AI Winters
  6. 1.3.3. The Modern Era
  7. Exercise 1
  8. 1.4. Model
  9. Exercise 2
  10. 1.5. Four-Step Machine Learning Process
  11. 1.6. Vector
  12. Exercise 3
  13. 1.7. Neural Network
  14. Exercise 4
  15. 1.8. Matrix
  16. 1.9. Gradient Descent
  17. Exercise 5
  18. 1.10. Automatic Differentiation
  19. Exercise 6
  20. Quiz 1

Lesson 2. Language Modeling Basics

  1. 2.1. Bag of Words
  2. Exercise 7
  3. 2.2. Word Embeddings
  4. Exercise 8
  5. 2.3. Byte-Pair Encoding
  6. Exercise 9
  7. 2.4. Language Model
  8. 2.5. Count-Based Language Model
  9. 2.6. Evaluating Language Models
  10. 2.6.1. Perplexity
  11. 2.6.2. ROUGE
  12. 2.6.3. Human Evaluation
  13. Exercise 10
  14. Quiz 2

Lesson 3. Recurrent Neural Network

  1. 3.1. Elman RNN
  2. 3.2. Mini-Batch Gradient Descent
  3. Exercise 11
  4. 3.3. Programming an RNN
  5. 3.4. RNN as a Language Model
  6. Exercise 12
  7. 3.5. Embedding Layer
  8. 3.6. Training an RNN Language Model
  9. Exercise 13
  10. 3.7. Dataset and DataLoader
  11. Exercise 14
  12. 3.8. Training Data and Loss Computation
  13. Quiz 3

Lesson 4. Transformer

  1. 4.1. Decoder Block
  2. Exercise 15
  3. 4.2. Self-Attention
  4. 4.2.1. Step 1 of Self-Attention
  5. 4.2.2. Step 2 of Self-Attention
  6. 4.2.3. Step 3 of Self-Attention
  7. 4.2.4. Step 4 of Self-Attention
  8. 4.2.5. Step 5 of Self-Attention
  9. 4.2.6. Step 6 of Self-Attention
  10. 4.3. Position-Wise Multilayer Perceptron
  11. Exercise 16
  12. 4.4. Rotary Position Embedding
  13. Exercise 17
  14. 4.5. Multi-Head Attention
  15. Exercise 18
  16. 4.6. Residual Connection
  17. 4.7. Root Mean Square Normalization
  18. Exercise 19
  19. 4.8. Key-Value Caching
  20. 4.9. Transformer in Python
  21. Exercise 20
  22. Quiz 4

Lesson 5. Large Language Model

  1. 5.1. Why Larger Is Better
  2. 5.1.1. Large Parameter Count
  3. 5.1.2. Large Context Size
  4. 5.1.3. Large Training Dataset
  5. 5.1.4. Large Amount of Compute
  6. Exercise 21
  7. 5.2. Supervised Finetuning
  8. 5.3. Finetuning a Pretrained Model
  9. 5.3.1. Baseline Emotion Classifier
  10. 5.3.2. Emotion Generation
  11. 5.3.3. Finetuning to Follow Instructions
  12. Exercise 22
  13. 5.4. Sampling From Language Models
  14. 5.4.1. Basic Sampling with Temperature
  15. 5.4.2. Top-\mathbf{k} Sampling
  16. 5.4.3. Nucleus (Top-p) Sampling
  17. 5.4.4. Penalties
  18. 5.5. Low-Rank Adaptation (LoRA)
  19. 5.5.1. The Core Idea
  20. 5.5.2. Parameter-Efficient Finetuning (PEFT)
  21. 5.6. LLM as a Classifier
  22. Exercise 23
  23. 5.7. Prompt Engineering
  24. 5.7.1. Features of a Good Prompt
  25. 5.7.2. Follow-up Actions
  26. 5.7.3. Code Generation
  27. 5.7.4. Documentation Synchronization
  28. 5.8. Hallucinations
  29. 5.8.1. Reasons for Hallucinations
  30. 5.8.2. Preventing Hallucinations
  31. 5.9. LLMs, Copyright, and Ethics
  32. 5.9.1. Training Data
  33. 5.9.2. Generated Content
  34. 5.9.3. Open-Weight Models
  35. 5.9.4. Broader Ethical Considerations
  36. Quiz 5

Lesson 6. Further Reading

  1. 6.1. Mixture of Experts
  2. Exercise 24
  3. 6.2. Model Merging
  4. Exercise 25
  5. 6.3. Model Compression
  6. 6.4. Preference-Based Alignment
  7. Exercise 26
  8. 6.5. Advanced Reasoning
  9. 6.6. Language Model Security
  10. 6.7. Vision Language Model
  11. Exercise 27
  12. 6.8. Preventing Overfitting
  13. 6.9. Concluding Remarks
  14. 6.10. More From the Author
  15. Quiz 6

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub