Hacker ApprovedDepartments

Build a Large Language Model (From Scratch)

Build a Large Language Model (From Scratch) by Sebastian Raschka

by Sebastian Raschka

Hacker Approved

The most recommended of 10 machine learning books

Explains how LLMs work by having readers build a GPT-style model step by step in PyTorch.

16 people recommended Build a Large Language Model (From Scratch) by Sebastian Raschka in Hacker News comments and none criticized it, November 2025 to October 2026.

Summary written by Claude from the comments below.

16 people gave an opinion

recommend it
16
mixed feelings
0
warn against or regret it
0

The record

Each figure is one person. RecommendsMixed feelingsCriticizes

Recommended in 8 of 12 months

In 14 different threads.

  1. November 2025: not recommended
  2. December 2025: recommended
  3. January 2026: recommended
  4. February 2026: recommended
  5. March 2026: not recommended
  6. April 2026: not recommended
  7. May 2026: recommended
  8. June 2026: recommended
  9. July 2026: not recommended
  10. August 2026: recommended
  11. September 2026: recommended
  12. October 2026: recommended

Why it carries the badge

  • 16 people recommend itNeeds 10 or more, met.
  • Nobody criticizes itNeeds 2 to 1 or better, met.
  • Recommended in 8 of 12 monthsNeeds 4 or more, met.
  • Recommended in 14 threadsNeeds 5 or more, met.
  • The biggest thread supplies 44% of its recommendersNeeds half or less, met.

The same rules apply to every product, and the badge can’t be bought. Mixed feelings count toward neither side. How the badge works

What people say about it

Reasons grouped from a sample of 24 of the 26 opinions about it, picked in proportion to how many people recommend it, have mixed feelings and criticize it. Each mark is one comment in the sample. Open a reason to read what they said.

Why people recommend it

Each mark is one comment

  • Clear, readable, well-explained

    “I found the book by Rashka for Building an LLM from Scratch really helpful in understanding a lot of concepts behind LLMs”

    Comment from 6 May 2026 in “Learning the Integral of a Diffusion Model”

    “It's clear and well-written (by a human!) and goes into much more explanatory detail than this does”

    Comment from 11 Sep 2026 in “LLM Visualizer – Build a Transformer from Scratch”

    “super readable and does a great job at holding your hand through the entire process”

    Comment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”
  • Builds a GPT model step by step

    “The best part about it is seeing the code built up for the GPT-2 architecture in basic pytorch”

    Comment from 8 Jan 2026 in “The Q, K, V Matrices”

    “There are GitHub repos with the code from Sebastian Raschka's books, which build an LLM from scratch in PyTorch”

    Comment from 25 Aug 2026 in “I were 17, I'd learn how to build LLMs from scratch”

    “It provides a clear explanation of the building blocks used in the first versions of ChatGPT”

    Comment from 26 Feb 2026 in “I don't know how you get here from "predict the next word."”
  • Explains how LLMs actually work

    “It's also not a bad foundation for people who want to understand how these things are trained and work.”

    Comment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”

    “it is a great resource for learning how LLMs work, from tokenization to generating text”

    Comment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”

    “I learned more from his book on LLMs than any other source on LLMs”

    Comment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”
  • Pairs well with explainer videos

    “I would highly recommend Sebastian Raschka's book and youtube videos as way into the subject”

    Comment from 22 Dec 2025 in “The Illustrated Transformer”

    “it’s been well worth it (particularly paired with his explainer videos”

    Comment from 15 Aug 2026 in “AI by Hand”

Other machine learning books people recommend

The four most recommended other machine learning books, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.

Build a Large Language Model (From Scratch) by Sebastian Raschka compared with 4 alternatives
ProductRecommendMixedCriticizeApprovalMonthsHad forBadge
Build a Large Language Model (From Scratch)by Sebastian RaschkaThis page1600100%8—Approved
Build an LLM from Scratchby Sebastian Raschka800100%5——
Python Data Science Handbookby Jake VanderPlas710100%2——
Probabilistic Machine Learningby Kevin Murphy500100%3——
The Welch Labs Illustrated Guide to AIby Welch Labs500100%3——
See all 10 machine learning books, ranked

What people said

24 of the 26 opinions about it, picked in proportion to the three counts, newest first. Each links to the original comment.

“He recommends reading offline and code-free first (although chapter-by-chapter”

RecommendsComment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”

“it was one of the best investments of my time in all of 2025”

RecommendsComment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”

“it is a great resource for learning how LLMs work, from tokenization to generating text”

RecommendsComment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”

“I learned more from his book on LLMs than any other source on LLMs”

RecommendsComment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”

“In many cases things are better taught top down.”

RecommendsComment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”

“his pedagogy is great (at least for me”

RecommendsComment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”

“It's also not a bad foundation for people who want to understand how these things are trained and work.”

RecommendsComment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”

“super readable and does a great job at holding your hand through the entire process”

RecommendsComment from 26 Oct 2026 in “Sebastian Raschka's from-scratch video course on building reasoning models”

“Sebastian is the author of two excellent books related to LLMs”

RecommendsComment from 30 Sep 2026 in “Language models for text classification: From bag-of-words to Jev”

“It's clear and well-written (by a human!) and goes into much more explanatory detail than this does”

RecommendsComment from 11 Sep 2026 in “LLM Visualizer – Build a Transformer from Scratch”

“there are totally decent books about building them from scratch”

RecommendsComment from 5 Sep 2026 in ““Next-token predictor” is the wrong mental model for LLMs”

“There are GitHub repos with the code from Sebastian Raschka's books, which build an LLM from scratch in PyTorch”

RecommendsComment from 25 Aug 2026 in “I were 17, I'd learn how to build LLMs from scratch”

“very reasonably priced and the experience of working through a book is a lot nicer”

RecommendsComment from 24 Aug 2026 in “I were 17, I'd learn how to build LLMs from scratch”

“From that perspective it's been a great experience.”

RecommendsComment from 24 Aug 2026 in “I were 17, I'd learn how to build LLMs from scratch”

“it’s been well worth it (particularly paired with his explainer videos”

RecommendsComment from 15 Aug 2026 in “AI by Hand”

“I couldn't understand the transformer architecture until I built a few myself.”

RecommendsComment from 6 Jun 2026 in “How LLMs Work”

“I worked through Sebastian Raschka's "Build a Large Language Model (From Scratch)" [0] and Raj Abhijit Dandekar's "Build a DeepSeek Model (From Scratch)" [1] books.”

RecommendsComment from 6 Jun 2026 in “How LLMs Work”

“I found the book by Rashka for Building an LLM from Scratch really helpful in understanding a lot of concepts behind LLMs”

RecommendsComment from 6 May 2026 in “Learning the Integral of a Diffusion Model”

“Great for people who want to understand the real nuts and bolts”

RecommendsComment from 5 May 2026 in “Train Your Own LLM from Scratch”

“It provides a clear explanation of the building blocks used in the first versions of ChatGPT”

RecommendsComment from 26 Feb 2026 in “I don't know how you get here from "predict the next word."”

“The best part about it is seeing the code built up for the GPT-2 architecture in basic pytorch”

RecommendsComment from 8 Jan 2026 in “The Q, K, V Matrices”

“It's approachable and also detailed.”

RecommendsComment from 8 Jan 2026 in “The Q, K, V Matrices”

“I would highly recommend Sebastian Raschka's book and youtube videos as way into the subject”

RecommendsComment from 22 Dec 2025 in “The Illustrated Transformer”

“I'm also re-reading Sebastian Raschka's amazing book.”

RecommendsComment from 9 Dec 2025 in “LLM from scratch, part 28 – training a base model from scratch on an RTX 3090”

Counts come from 1,791,911 Hacker News comments labeled by Claude, November 2025 to October 2026, with data through October 31, 2026. Counts updated 2 Nov 2026. How we count. Report a mistake.