bootgpt: A Language Model That Lives in a 512-Byte Boot Sector
On October 31, an open-source project called bootgpt made the Hacker News front page (52 points): an x86 machine with no operating system that, once powered on, starts dreaming up a Linux boot log one character at a time — timestamps, PCI BARs, ACPI events for hardware that never existed.
Implementation: 512 bytes plus 23 sectors
The whole system is two parts: a 512-byte hand-written assembly MBR, and an 11.5KB int8 model stored in the next 23 sectors. The entire forward pass runs in 16-bit real mode on a 386 — no OS, no C runtime. The model is character-level with an 8-character context and a single hidden layer; all weights are quantized to int8 with power-of-two scales, so the forward pass in the boot sector needs only imul plus a single idiv.
The training pipeline: simulate first, assemble second
The methodology is more interesting than the result. corpus_gen.py produces 3MB of fake dmesg, pinning one kernel version and one disk per boot session — the author explains that real boot logs repeat themselves, and that repetition is what makes a tiny model look sane. train.py trains with numpy (char embeddings, one hidden layer, softmax), quantizes to int8, and also simulates the exact integer math the assembly will run (LCG sampler included), so the Python output and the boot-sector output can be diffed — and they match character for character. boot.asm is the entire runtime: int 13h to load weights, int 10h to print, and a softclip activation.
How to run it
Dependencies are just nasm, qemu and numpy: ./build.sh produces disk.img and ./run.sh boots it in QEMU. disk.img is a normal boot image — dd it to a USB stick and it will boot on any real BIOS box, reading only its own sectors.
Why it is worth a look
It lands two punches at once. First, it shows how far a character-level tiny model can go under extreme constraints — eight characters of context are enough to make a boot log look real. Second, it demonstrates a disciplined extreme-engineering workflow: fully simulate the target platform's integer behavior on the host, then write the assembly, then verify with a character-for-character diff. For engineers doing edge or embedded inference, it is a method framework worth borrowing; and on the model-compression mainline, it sits at the opposite extreme of the same direction as the V4.1-Flash tech report that squeezes KV cache to 890 bytes per token — see our V4.1-Flash tech report breakdown. For more ecosystem arrivals, check our October ecosystem tools roundup and the October open-weight flagship spec comparison.
大模型网摘