Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    J

    Jay Mody

    jaykmody.com · Personal blog · on HN since 2023

    Jay Mody's blog explaining machine learning internals, including GPT in 60 lines of NumPy, attention, and speculative sampling.

    Visit blogHN submissions
    AI & Machine LearningProgrammingMath
    What HN says

    Commenters recommend the GPT-from-scratch post as a clear, code-based explanation, and one used it to build a Rust version.

    Stats for nerds
    17HN people shared it
    4linked in comments
    7story points
    Jan 2026last shared
    2023people per year2026

    Top posts on HN

    1. 1
      GPT in 60 Lines of NumPy
      11 people · 3 points · first shared 2023 · Discussion on HN
    2. 2
      An Intuition for Attention (from the seminal Attention Is All You Need Paper)
      2 people · 2 points · first shared 2023 · 1 comments on HN
    3. 3
      Speculative Sampling on LLM
      2 people · 2 points · first shared 2023 · Discussion on HN
    4. 4
      Homepage
      1 person · first shared 2026
    5. 5
      Stable softmax
      1 person · first shared 2024

    What HN people wrote when they linked it

    • lhlJun 2023

      Here are some high level answers:

      "7B" refers to the number of parameters or weights for a model. For a specific model, the versions with more parameters take more compute power to train and perform better.

      A foundational model is the part of a ML model that is "pretrained" on a massive data set (and usually is the bulk of the compute cost). This is usually considered the "raw" model after which it is fine-tuned for specific tasks (turned into a chatbot).

      "8K length" refers to the Context Window length (in tokens). This is basically an LLM's short term memory - you can think of it as its attention span and what it can generate reasonable output for.

      "1.5T tokens" refers to the size of the corpus of the training set.

      In general Wikipedia (or I suppose ChatGPT 4/Bing Chat with Web Browsing) is a decent enough place to start reading/asking basic questions. I'd recommend starting here: https://en.wikipedia.org/wiki/Large_language_model and finding the related concepts.

      For those going deeper, there are lot of general resources lists like https://github.com/Hannibal046/Awesome-LLM or https://github.com/Mooler0410/LLMsPracticalGuide or one I like, https://sebastianraschka.com/blog/2023/llm-reading-list.html (there are a bajillion of these and you'll find more once you get a grasp on the terms you want to surf for). Almost everything is published on arXiv, and most is fairly readable even as a layman.

      For non-ML programmers looking to get up to speed, I feel like Karpathy's…

    • benobMay 2023

      [1] is a good start, although if you want to train from scratch on CPU, you'll have to downscale as transformers need quite a bit of data before they learn to use position embeddings. For example try a single-layer RNN on Shakespeare texts [2] or a list of movie titles from IMDB [3]. You'll have to fill in the blanks because things have evolved quite a bit since those were used for language models, but you can find some tutorials [4] and examples [5].

      [1] https://jaykmody.com/blog/gpt-from-scratch/
      [2] https://github.com/demmojo/text-rnn/blob/master/datasets/shakespeare.txt
      [3] https://datasets.imdbws.com/
      [4] https://pytorch.org/tutorials/beginner/chatbot_tutorial.html
      [5] https://github.com/pytorch/examples/tree/main/word_language_model

    • techbruvJun 2023

      Some other good resources:

      [0]: The original paper: https://arxiv.org/abs/1706.03762

      [1]: Full walkthrough for building a GPT from Scratch: https://www.youtube.com/watch?v=kCc8FmEb1nY

      [2]: A simple inference only implementation in just NumPy, that's only 60 lines: https://jaykmody.com/blog/gpt-from-scratch/

      [3]: Some great visualizations and high-level explanations: http://jalammar.github.io/illustrated-transformer/

      [4]: An implementation that is presented side-by-side with the original paper: https://nlp.seas.harvard.edu/2018/04/03/attention.html

    • swyxMar 2024

      oh this has code! great stuff. diffusion papers are famous for a lot of equations (https://twitter.com/cto_junior/status/1766518604395155830) but code is much more legible (and precise?) for the rest of us. all theory papers should come with reference impl code.

      i'd love an extension of this for the diffusion transformer, which drives Sora and other videogen models. maybe combine this post with https://jaykmody.com/blog/gpt-from-scratch/ and make the "diffusion transformer from scratch" intro

    • alexmolasJan 2024

      > Uh oh! We’re getting NaNs! It seems our values are too high, and when being passed to the next encoder, they end up being too high and exploding! This is called gradient explosion.

      As far as I understand this is wrong. You're not computing gradients at any point, so this is no gradient explosion. I believe the problem is with the implementation of softmax, here [0] you have an explanation of how to implement a numerically stable softmax.

      [0]: https://jaykmody.com/blog/stable-softmax/

    • version_fiveJul 2023

      The more of these the better! I find when I'm learning something new I end up wanting to see a bunch of different versions of the same exposition until one sticks.

      I also recommend this one for following along in code: https://jaykmody.com/blog/gpt-from-scratch/

    Related

    Jay Alammarjalammar.github.io108 people

    The Illustrated Transformer

    Jay Alammar
    Personal · last shared 2026
    arg minargmin.net81 people

    Lessons from Optics, the Other Deep Learning

    arg min
    Personal · last shared 2026
    Max Woolfminimaxir.com85 people

    Nano Banana can be prompt engineered for nuanced AI image generation

    Max Woolf
    Personal · last shared 2026
    Yao Fuyaofu.notion.site21 people

    How Does GPT Obtain Its Ability? Tracing Emergent Abilities of Language Models

    Yao Fu
    Personal · last shared 2024
    Google Research Bloggoogleresearch.blogspot.com303 people

    Announcing SyntaxNet: The World’s Most Accurate Natural Language Parser

    Google Research Blog
    Company · last shared 2017
    Tim Dettmerstimdettmers.com99 people

    Which GPUs to get for deep learning

    Tim Dettmers
    Personal · last shared 2026
    Statistical Modeling, Causal Inference, and Social Sciencestatmodeling.stat.columbia.edu350 people

    Suspicious data pattern in recent Venezuelan election

    Statistical Modeling, Causal Inference, and Social Science
    Publication · last shared 2026
    DeepMind Blogdeepmind.com800 people

    AlphaFold: a solution to a 50-year-old grand challenge in biology

    DeepMind Blog
    Company · last shared 2026