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

    Lilian Weng

    lilianweng.github.io · Personal blog · on HN since 2018

    Lilian Weng, an OpenAI researcher, writes in-depth posts on prompt engineering, diffusion models, attention, transformers and LLM hallucinations.

    Visit blogRSSHN submissions
    AI & Machine Learning
    What HN says

    HN commenters call it a great resource and a goldmine for intuition about the math behind popular models, including an in-depth post on hallucination.

    Stats for nerds
    114HN people shared it
    93linked in comments
    1.9Kstory points
    May 2025last shared
    2019people per year2025

    Top posts on HN

    1. 1
      A Long Peek into Reinforcement Learning
      4 people · 281 points · first shared 2018 · 7 comments on HN
    2. 2
      Are deep neural networks dramatically overfitted? (2019)
      4 people · 217 points · first shared 2019 · 79 comments on HN
    3. 3
      Why We Think
      6 people · 161 points · first shared 2025 · 30 comments on HN
    4. 4
      A (Long) Peek into Reinforcement Learning
      1 person · 160 points · first shared 2025 · 16 comments on HN
    5. 5
      Learning with Not Enough Data: Semi-Supervised Learning
      1 person · 145 points · first shared 2021 · 19 comments on HN
    6. 6
      What Are Diffusion Models?
      2 people · 118 points · first shared 2021 · 10 comments on HN
    7. 7
      How to train large models on many GPUs?
      1 person · 108 points · first shared 2021 · 9 comments on HN
    8. 8
      Thinking about high-quality human data
      1 person · 103 points · first shared 2024 · 4 comments on HN
    9. 9
      The Multi-Armed Bandit Problem and Its Solutions (2018)
      2 people · 97 points · first shared 2018 · 24 comments on HN
    10. 10
      Contrastive Representation Learning
      2 people · 95 points · first shared 2021 · 18 comments on HN

    What HN people wrote when they linked it

    • godelskiNov 2023

      I don't have any great recommendations and unfortunately my advice may be not what you want to hear. What I tell my students is "You don't need to know math to build good models, but you need to know math to know why your models are wrong." But this is even a contentious statement within the community. (Personally I'm more interested in exploring what we can build and understand rather than focusing on throwing more compute and data at problems. There's a lot of work to be done that does not require significant compute, but it isn't flashy and you'll get little fame. Every famous model you know has some unsung hero(s) who built the foundation before compute was thrown at the problem). I was previously a physicist and we similarly frequently express that you do not know the material unless you can do the math. Physicists are trained in generating analogies as they help communication but this sometimes leads to people convincing themselves that they understand things far more than they actually do. They say the devil is in the details, and boy are there a lot of details. (Of the science communicators, I'm happy those are the ones you mention though!) But do not take this as gatekeeping! These groups are often happy to help with the math and recommend readings. ML is kinda a while west and you can honestly pick a subdomain of math and probably find it useful, but I would start by making sure you have a foundation in multivariate calculus and linear algebra.

      As to paper…

    • NalNezumiAug 2023

      There are some materials about "how to read scientific paper", like the pdf one from U waterloo [3] with some methodological advice. Some good advice in this old HN thread [1]

      But I don't see the point of reading a scientific paper unless you're actually curious about a specific topic. They are often hard to read, dense, have so many field-specific jargon that if you're new, you won't be able to read one paper and grasp everything. You would have to read references, or a book/blog that summaries core points.

      So find a specific field you're interested in, find a good book/blog/homepage/tutorial/video to get your basics going so that when you start reading papers you won't be completely lost.

      Then find a highly cited survey paper to understand what progress have been made beyond what is now basic. Then you can follow your curiously along that survey, decide a branch of research to read upon. You'll probably then realize that a few labs research/publish a lot in a specific direction. Now you can follow those professors (Twitter, Google scholar email notification) to keep up to date. By reading a lot you'll also start to notice papers that are "published just to get my PhD" and soon enough you can just read abstract + intro/result to judge if it is valuable or not.

      If ML/LLM is your curiosity probably Lillian Wengs blog [2] is a good start for tutorials / surveys.

      [1] https://news.ycombinator.com/item?id=24986727

      [2] https://lilianweng.github.io/

      Edit: direct…

    • authorflyApr 2024

      In practice, beam search doesn't seem to work well for generative models.

      Temperature and top_k (two very similar parameters) were both introduced to account for the fact that human text is unpredictable stochastically for each sentence someone might say as such - as shown in this 2021 similar graph/reproduction of an older graph from the 2018/2019 HF documentation: https://lilianweng.github.io/posts/2021-01-02-controllable-text-generation/beam_search_less_surprising.png

      It could be that beam search with much longer length does turn out to be better or some merging of the techniques works well, but I don't think so. The query-key-value part of transformers is focused on a single total in many ways - in relation to the overall context. The architecture is not meant for longer forms as such - there is no default "two token" system. And with 50k-100k tokens in most GPT models, you would be looking at 50k*50k = A great deal more parameters and then issues with sparsity of data.

      Just everything about GPT models (e.g. learned positional encodings/embeddings depending on the model iteration) is so focused on bringing the richness of a single token or single token index that the architecture is not designed for beam search like this one could say. Without considering the training complications.

    • cscheidApr 2023

      Interesting paper.

      I have a question about the claim in 6.2 that attention matrices are SPD, if you don't mind my asking.

      It seems to me that accepting the empirical result that the eigenvalues are positive isn't enough to get a Fourier Transform interpretation. Specifically, I don't understand the assumption that all attention matrices are symmetric. (I'm sure you know that positive eigenvalues are not enough by themselves, but for other folks reading, [[1 1/2] [1/3 1]] is a simple concrete example.)

      Consider Fig. 17 here: https://lilianweng.github.io/posts/2018-06-24-attention/ (this is Fig.1 in Attention is all you need). I understand that you get symmetric attention matrices for the self-attention matrix in the input stream, as well as the masked attention matrix in the output stream (the first block). But I don't understand how you claim symmetry for the final attention mechanism that combines input and output.

      And if you don't get symmetry, you don't get the Fourier Transform interpretation and all the nice algebra that follows.

    • davidatbuNov 2022

      I'm fairly certain that the model was not at all trained on language data. It's just that the "neural architecture" (specifically, the Transformer architecture) was first discovered in the NLP realm.

      If your question is why does an architecture designed for NLP work well for aminoacid sequences, it turns out that the Transformer architecture is surprisingly versatile. It works amazingly well for other sequence-like data (like audio), and even for images (which, to me, is surprising, since images are not a one dimensional sequence like text or audio).

      The Transformer architecture (Particularly, the Multihead self-attention[0] mechanism within the Transformer) is, in my estimation, once of the key innovations in deep learning in the past 5 years. It's used in pretty much everything in deep learning (GPT-3, AlphaFold, DALLE-2/Stable Diffusion, OpenAI's Whisper, come to mind).

      [0] https://lilianweng.github.io/posts/2018-06-24-attention/#multi-head-self-attention

    • ImnimoApr 2022

      I recommend this blog post:

      https://lilianweng.github.io/posts/2021-07-11-diffusion-models/

      Personally, I find the core diffusion papers pretty dense and difficult to follow, so the blog post is where I'd begin.

      https://arxiv.org/pdf/1503.03585.pdf

      This paper is a decent starting point on the literature side, but it's a doozy.

      Both the paper and blog post are pretty math heavy. I have not yet found a really clear intuitive explanation that doesn't get down in the weeds of the math, and it took me a long time to understand what the hell the math is trying to say (and there are some parts I still don't fully understand!)

    Related

    Google AI Blogai.googleblog.com596 people

    Google Duplex: An AI System for Accomplishing Real World Tasks Over the Phone

    Google AI Blog
    Company · last shared 2026
    Andrej Karpathykarpathy.github.io287 people

    Hacker's Guide to Neural Networks

    Andrej Karpathy
    Personal · last shared 2026
    Eric Jangblog.evjang.com50 people

    Dijkstra's in Disguise

    Eric Jang
    Personal · last shared 2026
    Julian Togeliustogelius.blogspot.com38 people

    The differences between tinkering and research (2016)

    Julian Togelius
    Personal · last shared 2026
    OpenAI Blogblog.openai.com174 people

    OpenAI Five

    OpenAI Blog
    Company · last shared 2022
    Google Research Blogresearch.googleblog.com278 people

    Guetzli: A New Open-Source JPEG Encoder

    Google Research Blog
    Company · last shared 2018
    LessWronglesswrong.com2.4k people

    The Best Textbooks on Every Subject

    LessWrong
    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