LessWrong (30+ Karma)

“How the NanoGPT Speedrun WR dropped by 20% in 3 months” by larry-dial


Listen Later

In early 2024 Andrej Karpathy stood up an llm.c repo to train GPT-2 (124M), which took an equivalent of 45 minutes on 8xH100 GPUs to reach 3.28 cross entropy loss. By Jan 2025, collaborators of modded-nanogpt brought that time down to 3 minutes. It sat near 3 minutes until July 2025, having a large swath of optimization already applied: RoPE, value embeddings, reduce scatter grad updates, Muon, QK Norm, Relu^2, a custom FP8 head, skip connections, flex attention, short-long windows, attention window warmup, linear lr cooldown, and more. Yet, in the last 3 months the record has fallen by another 20% to 2 minutes and 20 seconds.

Many of the improvements in the last 20% have not yet been published outside of the modded-nanogpt repo. This post summarizes those improvements. Not everything will generalize to larger scales, but there are some core concepts that I believe are promising. Improvements [...]

---

Outline:

(02:02) ML Improvements

(02:06) #1: Document Alignment

(03:26) #2: Dynamic Attention Window Management by Layer

(04:50) #3 Heterogenous Batch Sizes

(05:31) #4 Backout: Enabling a model to back out context for predictions

(06:18) #5 Polar Express

(06:36) #6 Smear Module

(07:20) #7 Sparse Attention Gate

(07:58) #8 More Bfloat16

(08:36) #9 Softmax Skip Gate

(09:04) #10 Drop MLP Layer

(09:19) Engineering Improvements

(09:23) #1 Flash Attention 3

(09:50) #2 Parameter reshaping for shared reduce scatter

(11:15) #3 Async Data Fetch and Index

(11:44) #4 Vectorized Optimizer Step

(12:03) #5 Triton Kernel for Symmetric Matmul

(12:41) #6 Resize Lambda Parameters

(13:36) Takeaways from the Journey

The original text contained 4 footnotes which were omitted from this narration.

---

First published:

October 5th, 2025

Source:

https://www.lesswrong.com/posts/j3gp8tebQiFJqzBgg/how-the-nanogpt-speedrun-wr-dropped-by-20-in-3-months

---

Narrated by TYPE III AUDIO.

...more
View all episodesView all episodes
Download on the App Store

LessWrong (30+ Karma)By LessWrong


More shows like LessWrong (30+ Karma)

View all
Making Sense with Sam Harris by Sam Harris

Making Sense with Sam Harris

26,376 Listeners

Conversations with Tyler by Mercatus Center at George Mason University

Conversations with Tyler

2,429 Listeners

The Peter Attia Drive by Peter Attia, MD

The Peter Attia Drive

8,187 Listeners

Sean Carroll's Mindscape: Science, Society, Philosophy, Culture, Arts, and Ideas by Sean Carroll | Wondery

Sean Carroll's Mindscape: Science, Society, Philosophy, Culture, Arts, and Ideas

4,155 Listeners

ManifoldOne by Steve Hsu

ManifoldOne

92 Listeners

Your Undivided Attention by The Center for Humane Technology, Tristan Harris, Daniel Barcay and Aza Raskin

Your Undivided Attention

1,553 Listeners

All-In with Chamath, Jason, Sacks & Friedberg by All-In Podcast, LLC

All-In with Chamath, Jason, Sacks & Friedberg

9,799 Listeners

Machine Learning Street Talk (MLST) by Machine Learning Street Talk (MLST)

Machine Learning Street Talk (MLST)

89 Listeners

Dwarkesh Podcast by Dwarkesh Patel

Dwarkesh Podcast

488 Listeners

Hard Fork by The New York Times

Hard Fork

5,472 Listeners

The Ezra Klein Show by New York Times Opinion

The Ezra Klein Show

16,144 Listeners

Moonshots with Peter Diamandis by PHD Ventures

Moonshots with Peter Diamandis

531 Listeners

No Priors: Artificial Intelligence | Technology | Startups by Conviction

No Priors: Artificial Intelligence | Technology | Startups

131 Listeners

Latent Space: The AI Engineer Podcast by swyx + Alessio

Latent Space: The AI Engineer Podcast

96 Listeners

BG2Pod with Brad Gerstner and Bill Gurley by BG2Pod

BG2Pod with Brad Gerstner and Bill Gurley

510 Listeners