GitHub - Kuberwastaken/picogpt: GPT in a QR Code ; The actual most atomic way to train and inference a GPT in pure, dependency-free Python.

1 min read Original article ↗

PicoGPT: GPT in a QR Code

QR Code for The Backdooms

Yes, it's small enough to fit inside a QR code. You can scan it to try it out.

Origin

Andrej Karpathy tweeted this on X today, talking about MicroGPT

QR Code for The Backdooms

It was genuinely so cool but then I saw something that made me laugh out loud

QR Code for The Backdooms

IT WASN'T MINIFIED FURTHER

So uh yeah, that's all this is, I minified it further at picogpt.py

and it works IN JUST 64 LINES!

For context, these 64 lines of python include:

  • A custom Autograd engine
  • Multi-head attention (MHA)
  • Feed-forward MLP with GeLU approximation
  • AdamW Optimizer
  • Training & Inference loops

The qrgen.py script is adapted from my Doom running inside a QR code project: backdooms.

The QR now contains a single bootstrap command. When scanned, copy the text and paste it in a terminal to:

  1. restore picogpt.py
  2. run picogpt.py immediately

As for the naming choice, iykyk