nowfound

Life & fun · August 26, 2025

RG

Rebuilding GPT2 inference in 500 lines of

Launched as “Rebuilding GPT2 inference in ~500 lines of (commented) code”

Rebuilding GPT2 inference in 500 lines of launched on August 26, 2025 with 5 votes and more than 75% of that year's launches. The site was still online in September 2026, 1 year on.

Forecast

95%

chance that this product’s website is still online in December 2031. Typical launch of 2025 gets 88%.

1 year
99%
typical 97%
3 years
96%
typical 90%
5 years
95%
typical 88%
  • Rebuilding GPT2 inference in 500 lines of
  • Typical launch of 2025

Launch signals stronger than 98% of the archiveweakest → strongest

Made on December 2, 2026, when the site was online, from what was public on launch day. It is not revised, and it is graded when the site is checked again. How the forecast works and how often it is right →

What it does

Hey! Like most engineers I’ve been looking at the latest LLMs and wondering how they actually work. I watched a couple videos to try to understand them ( Karpathy’s video series are pretty good ) but they’re mostly taught by machine learning PhDs so they tend to gloss over the non-mathy part of the problems. To try to break it down further I rebuilt GPT2 from scratch . This file loads the open source GPT2 weights and applies all the inference math until we get to the results. I’m also going to add explanations for everything that happens along the way. By the way, if you have any questions or comments, hit me up at hello at khamidou.com ! It’s very limited Swift though, and you don’t really…from khamidou.com

More life & fun this month

the category →

Is Rebuilding GPT2 inference in 500 lines of yours? Feature it on the home page: $19, or free with the badge →

Source: Show HN post ↗

Launched alongside, August 2025

the whole month →