~/talk

How LLMs work for Web Devs: GPT in 600 lines of Vanilla JS

slides:none on file

A full GPT-2 small inference is implemented in 600 lines of Vanilla JS that loads about 1.5 GB of model weights into the browser IndexedDB and runs locally, letting developers step through tokenization, attention matrices and MLPs in the devtools. The model uses 768‑dim embeddings with a 1024‑token context and 12 transformer blocks, maps predicted 768‑vector outputs to 50,257 token logits, and reproduces Hugging Face GPT‑2 next‑token results while exposing sampling options like greedy, top‑k and top‑p.

AI-written summary · about

  1. 0:00Introduction to the Talk and Conference
  2. 1:24Mission: Breaking Clark's Third Law (Demystifying LLMs)
  3. 2:45Overview of the "Spreadsheets are All You Need" Approach
  4. 4:14Today's Approach: Vanilla JavaScript Implementation
  5. 4:47Background Needed for the Workshop
  6. 5:22Key Resources for the Workshop
  7. 5:50Simplified GPT-2 Diagram as a Roadmap
  8. 7:07Quick Tour of the JavaScript Implementation of GPT-2
  9. 12:20Understanding Large Language Models (LLMs)
  10. 17:47Tokenization: Splitting Text into Subword Units
  11. 33:12Embeddings: Token and Position Embeddings
  12. 56:51Attention Mechanism
  13. 1:02:57Multi-Layer Perceptron (MLP) and Backpropagation
  14. 1:16:07Iteration: Refining Predictions Across Blocks
  15. 1:17:49Language Head: Turning Embeddings Back into Tokens
  16. 1:23:18Chat GPT vs. GPT-2: Key Innovations
  17. 1:31:37Summary and Conclusion
  18. 1:35:13Q&A Session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.