frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Z80-μLM, a 'Conversational AI' That Fits in 40KB

https://github.com/HarryR/z80ai
49•quesomaster9000•2h ago
How small can a language model be while still doing something useful? I wanted to find out, and had some spare time over the holidays.

Z80-μLM is a character-level language model with 2-bit quantized weights ({-2,-1,0,+1}) that runs on a Z80 with 64KB RAM. The entire thing: inference, weights, chat UI, it all fits in a 40KB .COM file that you can run in a CP/M emulator and hopefully even real hardware!

It won't write your emails, but it can be trained to play a stripped down version of 20 Questions, and is sometimes able to maintain the illusion of having simple but terse conversations with a distinct personality.

--

The extreme constraints nerd-sniped me and forced interesting trade-offs: trigram hashing (typo-tolerant, loses word order), 16-bit integer math, and some careful massaging of the training data meant I could keep the examples 'interesting'.

The key was quantization-aware training that accurately models the inference code limitations. The training loop runs both float and integer-quantized forward passes in parallel, scoring the model on how well its knowledge survives quantization. The weights are progressively pushed toward the 2-bit grid using straight-through estimators, with overflow penalties matching the Z80's 16-bit accumulator limits. By the end of training, the model has already adapted to its constraints, so no post-hoc quantization collapse.

Eventually I ended up spending a few dollars on Claude API to generate 20 questions data (see examples/guess/GUESS.COM), I hope Anthropic won't send me a C&D for distilling their model against the ToS ;P

But anyway, happy code-golf season everybody :)

Comments

Zee2•54m ago
This is super cool. Would love to see a Z80 simulator set up with these examples to play with!
jasonjmcghee•37m ago
For future projects and/or for this project, there are many LLMs available more than good enough to generate that kind of synthetic data with permissive terms of use.
codetiger•25m ago
Imagine, this working on a Gameboy, in those days. Would've sounded like magic
alfiedotwtf•19m ago
And would have lasted 3 minutes.

Speaking of - I remember my first digital camera (Fujitsu 1Mb resolution using SmartMedia)… it used so much power that you could take 20-30 photos and then needed to replace all 4 batteries lol

alfiedotwtf•21m ago
An LLM in a .com file? Haha made my day
roygbiv2•13m ago
Awesome. I've just designed and built my own z80 computer, though right now it has 32kb ROM and 32kb RAM. This will definitely change on the next revision so I'll be sure to try it out.
vedmakk•10m ago
If one would train an actual secret (e.g. a passphrase) into such a model, that a user would need to guess by asking the right questions. Could this secret be easily reverse engineered / inferred by having access to models weights - or would it be safe to assume that one could only get to the secret by asking the right questions?
nineteen999•8m ago
This couldn't be more perfectly timed .. I have an Unreal Engine game with both VT100 terminals (for running coding agents) and Z80 emulators, and a serial bridge that allows coding agents to program the CP/M machines:

https://i.imgur.com/6TRe1NE.png

Thank you for posting! It's unbelievable how someone sometimes just drops something that fits right into what you're doing. However bizarre it seems.

Dwedit•8m ago
In before AI companies buy up all the Z80s and raise the prices to new heights.
pdyc•7m ago
interesting, i am wondering how far can it go if we remove some of these limitations but try to solve some extremely specific problem like generating regex based on user input? i know small models(270M range) can do that but can it be done in say < 10MB range?

Hacker claims to leak WIRED database with 2.3M records

https://www.bleepingcomputer.com/news/security/hacker-claims-to-leak-wired-database-with-23-milli...
1•thunderbong•7m ago•0 comments

Two decades of evolution: How Ext4 has changed

https://llmnativeos.github.io/specfs/#/statistics
1•Dd_nirvana•11m ago•0 comments

Plastic Software

https://medium.com/@jpleboeuf/plastic-software-d289691c020c
1•gpi•11m ago•0 comments

FORCEDENTRY

https://en.wikipedia.org/wiki/FORCEDENTRY
1•weinzierl•11m ago•0 comments

KdK part 2: a medical mystery from postwar Germany

https://nealstephenson.substack.com/p/kdk-part-2-a-medical-mystery-from
1•philbo•13m ago•0 comments

Americans Hate AI. Which Party Will Benefit?

https://www.politico.com/news/magazine/2025/12/28/ai-job-losses-populism-democrats-bernie-sanders...
1•01-_-•16m ago•1 comments

Immune complexes containing immobilized IgG require platelets

https://www.jci.org/articles/view/195987
1•01-_-•17m ago•0 comments

Find your perfect match with integer programming

https://maxkapur.com/2025/12/19/perfect-match-integer-programming.html
1•owenlacey•18m ago•0 comments

A Syntopicon

https://en.wikipedia.org/wiki/A_Syntopicon
1•harryday•23m ago•0 comments

But He Rose – Resurrection Worship Anthem – Spiritinus Music

https://tubespace.io/therealbible/but-he-rose-resurrection-worship-anthem-spiritinus-music
1•impexpage•23m ago•0 comments

Show HN: Text-to-Light: Local LLM-Powered Christmas Tree on Raspberry Pi [video]

https://www.youtube.com/watch?v=EmUWbESvOwA
2•eyesim•25m ago•0 comments

The Late Arrival of 16-bit CP/M

https://nemanjatrifunovic.substack.com/p/the-late-arrival-of-16-bit-cpm
1•ingve•25m ago•0 comments

KdK (Kinetik der Kontinua) part 1: Introduction

https://nealstephenson.substack.com/p/kdk-kinetik-der-kontinua-part-1-introduction
1•philbo•27m ago•0 comments

Show HN: Instant map of your flight routes, no account required

https://myflightroutes.com/
1•atamagno•29m ago•0 comments

How Ed Snowden Taught Me to Smuggle Secrets Past Danger (2014)

https://theintercept.com/2014/10/28/smuggling-snowden-secrets/
2•xeonmc•32m ago•1 comments

Game Download Sizes Thoughts

2•BatteryMountain•39m ago•1 comments

Leaked documents show Instagram's plan to win back teens

https://www.washingtonpost.com/technology/2025/12/26/meta-instagram-teen-strategy/
3•1vuio0pswjnm7•43m ago•0 comments

Oracle shares on pace for worst quarter since 2001, concerns about AI build-out

https://www.cnbc.com/2025/12/26/oracle-stock-on-pace-for-worst-quarter-since-2001-ai-concerns.html
4•1vuio0pswjnm7•44m ago•0 comments

When Cities Realized They Can Just Say No to Surveillance Tech

https://www.eff.org/deeplinks/2025/12/procurement-power-when-cities-realized-they-can-just-say-no...
4•MilnerRoute•48m ago•0 comments

Show HN: Mind2Post, a tool that turn your minds into high-value posts

https://mind2post.com.com
1•tangpanqing•51m ago•0 comments

Geoffrey Hinton warns AI has 'progressed even faster than I thought' [video]

https://www.youtube.com/watch?v=5qBDQgfeB6s
1•davidst•54m ago•0 comments

Insight Debt

https://bytesauna.com/post/insight-debt
1•mapehe•56m ago•1 comments

Why didn't anyone point out the flawed operating leverage story in SaaS?

https://elocination.substack.com/p/why-didnt-anyone-point-out-the-flawed
1•pr337h4m•57m ago•0 comments

The Second Great Error Model Convergence

https://matklad.github.io/2025/12/29/second-error-model-convergence.html
1•ingve•1h ago•0 comments

Turning Images into Talking Videos with AI

https://www.infinitetalk.com
1•cy1414569•1h ago•1 comments

The Many Worlds Interpretation of Quantum Mechanics (Hugh Everett PhD Thesis) [pdf]

https://www.pbs.org/wgbh/nova/manyworlds/pdf/dissertation.pdf
2•kdavis•1h ago•0 comments

What I learned after collecting large-scale US business data

https://rangelead.com/
1•RangeLead•1h ago•1 comments

Multidimensional Analysis: Algebras and Systems for Science and Engineering

https://www.georgehart.com/research/multanal.html
2•teleforce•1h ago•0 comments

Ask HN: Ruby 4 and unicorn segfault (kgio) how to get a gem release?

1•catatsuy•1h ago•0 comments

A framework for semiring-annotated type systems

https://stax.strath.ac.uk/concern/theses/tt44pn44w
2•teleforce•1h ago•0 comments