Build a Large Language ModelSebastian Raschka

Build a Large Language Model

by Sebastian Raschka · first published 2024

26mentions
12recommended by
26HN commenters
2024–2026first – last mentioned

46% recommend54% neutral

Why HN recommends it

A hands-on, step-by-step build of a GPT-style model that explains each of the transformer's building blocks clearly. Suits anyone serious about understanding how LLMs work inside, from the ground up.

Summarised by Claude from recommending comments

Affiliate links. As an Amazon Associate I earn from qualifying purchases.

Mentions per year

110 2007: 0 mentions2008: 0 mentions2009: 0 mentions2010: 0 mentions2011: 0 mentions2012: 0 mentions2013: 0 mentions2014: 0 mentions2015: 0 mentions2016: 0 mentions2017: 0 mentions2018: 0 mentions2019: 0 mentions2020: 0 mentions2021: 0 mentions2022: 0 mentions2023: 0 mentions2024: 8 mentions2025: 7 mentions2026: 11 mentions200720172026

What Hacker News says

  • libraryofbabel · Jan 8, 2026 · Recommends

    …requires two or three book chapters at least if you really want to start grokking it! For anyone serious about coming to grips with this stuff, I would strongly recommend Sebastian Raschka's excellent book Build a Large Language Model (From Scratch), which I just finished reading. It's approachable and also detailed. As an aside, does anyone else find the whole "database lookup" motivation for QKV kind of confusing? (in the article, "Query (Q):…

    on “The Q, K, V Matrices” ↗
  • auraham · Feb 26, 2026 · Recommends

    I highly recommend Build a large language model from scratch [1] by Sebastian Raschka. It provides a clear explanation of the building blocks used in the first versions of ChatGPT (GPT 2 if I recall correctly). The output of the model is a huge vector of n elements,…

    on “I don't know how you get here from "predict the next word."” ↗
  • pomatic · Jan 2, 2024 · Recommends

    I stumbled across https://www.manning.com/books/build-a-large-language-model-f... today - it's not complete yet, but sounds like exactly what you're after.

    on “Ask HN: Is it feasible to train my own LLM?” ↗
  • mindcrash · May 14, 2024 · Recommends

    …working on publishing a X From Scratch series, which currently includes: * Container Orchestrator: https://www.manning.com/books/build-an-orchestrator-in-go-fr... * LLM : https://www.manning.com/books/build-a-large-language-model-f... * Frontend Framework: https://www.manning.com/books/build-a-frontend-web-framework... The first book might be most interesting, given your particular subject interest.

    on “Ask HN: What are some books/resources where we can learn by building” ↗
  • larve · Aug 15, 2024 · Recommends

    …https://www.oreilly.com/library/view/designing-data-intensiv... - https://www.manning.com/books/100-go-mistakes-and-how-to-avo... - https://www.amazon.com/Systems-Performance-Brendan-Gregg/dp/... And more recently: - https://www.manning.com/books/build-a-large-language-model-f... - https://www.manning.com/books/the-creative-programmer - https://www.manning.com/books/the-programmers-brain - https://www.amazon.com/Understanding-Software-Addison-Wesley... I also find books…

    on “Programmers Don't Read Books – But You Should (2008)” ↗
  • BaculumMeumEst · Sep 10, 2024 · Recommends

    …playlist: https://www.youtube.com/playlist?list=PLAqhIrjkxbuWI23v9cThs... He is building new learning materials under his new company "Eureka Labs": https://eurekalabs.ai Sebastian Raschka's book "Build a Large Language Model (From Scratch) just released: https://www.manning.com/books/build-a-large-language-model-f... All of these resources are excellent.

    on “Tutorial on diffusion models for imaging and vision” ↗
  • cwyers · Aug 6, 2025 · Recommends

    This is a great book (parts of it are available as blog posts from the author if you want to get a taste of it): https://www.manning.com/books/build-a-large-language-model-f...

    on “Open models by OpenAI” ↗
  • mark_l_watson · Aug 10, 2025 · Recommends

    …enough to write implementations. I really miss the feeling that I could develop at least simpler LLMs on my own. I am slowly working through Sebastian Raschk's excellent book https://www.manning.com/books/build-a-large-language-model-f... but I will probably never finish it (to be honest).

    on “GPT-OSS vs. Qwen3 and a detailed look how things evolved since GPT-2” ↗
  • LatencyKills · Jun 6, 2026 · Recommends

    Not OP but 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. I don't think there is anything in a transformer I couldn't explain in the smallest detail now. [0]: https://www.amazon.com/Build-Large-Language-Model-Scratch/dp...…

    on “How LLMs Work” ↗
  • dan-g · Aug 15, 2026 · Recommends

    Similarly, I’ve been working through Raschka’s Build a Large Language Model (From Scratch) https://sebastianraschka.com/llms-from-scratch/ and it’s been well worth it (particularly paired with his explainer videos)

    on “AI by Hand” ↗
  • antonvs · Oct 31, 2026 · Recommends

    …the web that can help with this. One good one is Andrej Karpathy's "Let's build GPT: from scratch, in code, spelled out.": https://www.youtube.com/watch?v=kCc8FmEb1nY A somewhat more intensive one is "Build a Large Language Model (From Scratch)" by Sebastian Raschka: https://www.sebastianraschka.com/llms-from-scratch/ And if you really want to go crazy, Stanford's "CS336: Language Modeling from Scratch" is online: https://cs336.stanford.edu/…

    on “Show HN: A working Nintendo in ~1GB of Qwen weights” ↗
  • malshe · Sep 30, 2026 · Recommends

    Sebastian is the author of two excellent books related to LLMs Build a Large Language Model (From Scratch): https://sebastianraschka.com/llms-from-scratch/ Build a Reasoning Model (From Scratch): https://sebastianraschka.com/reasoning-from-scratch/

    on “Language models for text classification: From bag-of-words to Jev” ↗
  • TowerTall · Mar 26, 2024 · Mentions

    I have pre-ordered this book: Build a Large Language Model (From Scratch) https://www.manning.com/books/build-a-large-language-model-f...

    on “Ask HN: Textbook Regarding LLMs” ↗
  • StefanBatory · Sep 1, 2024 · Mentions

    Most likely this one. https://www.manning.com/books/build-a-large-language-model-f... (I've taken it from the footnotes on the article)

    on “Building LLMs from the Ground Up: A 3-Hour Coding Workshop” ↗
  • hedgehog0 · Sep 21, 2024 · Mentions

    Dear all, Recently I purchased "[Build a Large Language Model (From Scratch)](https://www.manning.com/books/build-a-large-language-model-from-scratch)" by Sebastian Raschka, so that I could learn more about how to build and/or fine-tune a LLM, and even developing some applications…

    on “Ask HN: How can I experiment with LLMs with a old machine?” ↗

Keyboard shortcuts

/
Focus search
j / k
Next / previous book
Enter
Open focused book
Esc
Close / go back
g h
Go to Home
g t
Go to Top all-time
g m
Go to Most recommended
g r
Go to Rising
g f
Go to For You
?
Show this help