The venerable Zilog Z80 CPU has been around since 1976, and it has powered everything from calculators and home computers to arcade cabinets. But the 8-bit microprocessor isn't exactly a powerful CPU compared to what we use today. That said, developer HarryR has created Z80-μLM, a working "AI" for the well-respected microprocessor. HarryR confirms that it won't pass the Turing test, but it is a bit of fun. And no, the price of Z80s will not be impacted by AI.
According to the readme file, "Z80-μLM is a 'conversational AI' that generates short character-by-character sequences, with quantization-aware training (QAT) to run on a Z80 processor with 64kb of RAM." HarryR's goal is to see how small an AI project can go, while still having a "personality". Can the AI be trained and fine-tuned? It seems that HarryR has done it in just 40KB, including inference, weights, and chat style user interface.
HarryR has kindly detailed the features of this Z80 AI project.
Trigram hash encoding : Input text is hashed into 128 buckets - typo-tolerant, word-order invariant
: Input text is hashed into 128 buckets - typo-tolerant, word-order invariant 2-bit weight quantization : Each weight is {-2, -1, 0, +1}, packed 4 per byte
: Each weight is {-2, -1, 0, +1}, packed 4 per byte 16-bit integer inference : All math uses Z80-native 16-bit signed arithmetic
: All math uses Z80-native 16-bit signed arithmetic ~40KB .COM file : Fits in CP/M's Transient Program Area (TPA)
: Fits in CP/M's Transient Program Area (TPA) Autoregressive generation : Outputs text character-by-character
: Outputs text character-by-character No floating point : Everything is integer math with fixed-point scaling
: Everything is integer math with fixed-point scaling Interactive chat mode: Just run CHAT with no arguments
... continue reading