hn.today

Show HN: A language model that lives in a boot sector

github.com61 points1 comments
Screenshot of Show HN: A language model that lives in a boot sector

BootGPT is an experimental language model that runs directly from a PC’s boot process, without an operating system or runtime. Its 512-byte master boot record contains handwritten x86 assembly that loads an 11.5 KB model from the next 23 disk sectors and performs inference in 16-bit real mode on hardware as old as a 386. Rather than answer general questions or generate stories, the tiny character-level network has one job: invent a Linux-style boot log, complete with plausible-looking timestamps, device identifiers, and hardware events for components that may not exist. Its output is intentionally garbled, but recognizable enough to evoke a real system startup.

The model is trained on three megabytes of fabricated kernel messages, structured to repeat details such as a kernel version and disk across a simulated boot session. Training uses character embeddings, a single hidden layer, and a softmax output; weights are quantized to int8 with power-of-two scales so the assembly can calculate predictions using simple integer operations. A Python simulator reproduces the assembly’s integer arithmetic and sampling, allowing the generated text to be checked character by character. The assembly also handles BIOS disk reads and screen output, while model data, strings, and vocabulary sit outside the constrained boot sector. The project demonstrates how far a deliberately narrow neural network can be pushed under severe memory and hardware constraints, and contrasts its compactness with boot-time projects that run larger models or more elaborate software.

Read on github.com1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in AI

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.