Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    This stackable Xbox Game Pass Ultimate 1-month code is $25

    Turn leads into deals with a $50 CRM lifetime license

    This week’s free game on Epic Games Store is a sci-fi detective trip

    Facebook X (Twitter) Instagram
    • Artificial Intelligence
    • Business Technology
    • Cryptocurrency
    • Gadgets
    • Gaming
    • Health
    • Software and Apps
    • Technology
    Facebook X (Twitter) Instagram Pinterest Vimeo
    Tech AI Verse
    • Home
    • Artificial Intelligence

      Read the extended transcript: President Donald Trump interviewed by ‘NBC Nightly News’ anchor Tom Llamas

      February 6, 2026

      Stocks and bitcoin sink as investors dump software company shares

      February 4, 2026

      AI, crypto and Trump super PACs stash millions to spend on the midterms

      February 2, 2026

      To avoid accusations of AI cheating, college students are turning to AI

      January 29, 2026

      ChatGPT can embrace authoritarian ideas after just one prompt, researchers say

      January 24, 2026
    • Business

      The HDD brand that brought you the 1.8-inch, 2.5-inch, and 3.5-inch hard drives is now back with a $19 pocket-sized personal cloud for your smartphones

      February 12, 2026

      New VoidLink malware framework targets Linux cloud servers

      January 14, 2026

      Nvidia Rubin’s rack-scale encryption signals a turning point for enterprise AI security

      January 13, 2026

      How KPMG is redefining the future of SAP consulting on a global scale

      January 10, 2026

      Top 10 cloud computing stories of 2025

      December 22, 2025
    • Crypto

      Pi Network Tops Daily Charts with a 25% Rally, Here’s Why

      February 15, 2026

      Solana New Holders Drop by 2.3 Million, Will It Impact Price Recovery?

      February 15, 2026

      CLARITY Act’s Stablecoin Yield Restrictions Could Benefit Foreign Currencies, Not USD

      February 15, 2026

      Bitcoin Shorts Reach Most Extreme Level Since 2024 Bottom

      February 15, 2026

      Coinbase Urges Fed to Modernize US Payments to Match European Standards

      February 15, 2026
    • Technology

      This stackable Xbox Game Pass Ultimate 1-month code is $25

      February 15, 2026

      Turn leads into deals with a $50 CRM lifetime license

      February 15, 2026

      This week’s free game on Epic Games Store is a sci-fi detective trip

      February 15, 2026

      Grab 2x 100W Anker USB-C cables for $10

      February 15, 2026

      State-sponsored hackers love Gemini, Google says

      February 15, 2026
    • Others
      • Gadgets
      • Gaming
      • Health
      • Software and Apps
    Check BMI
    Tech AI Verse
    You are at:Home»Technology»Show HN: Z80-μLM, a ‘Conversational AI’ That Fits in 40KB
    Technology

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

    TechAiVerseBy TechAiVerseDecember 29, 2025No Comments4 Mins Read6 Views
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Show HN: Z80-μLM, a ‘Conversational AI’ That Fits in 40KB
    Share
    Facebook Twitter LinkedIn Pinterest WhatsApp Email

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

    Z80-μLM: A Retrocomputing Micro Language Model

    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.

    The root behind this project was the question: how small can we go while still having personality, and can it be trained or fine-tuned easily? With easy self-hosted distribution?

    The answer is Yes! And a 40kb .com binary (including inference, weights & a chat-style UI) running on a 4MHz processor from 1976.

    It won’t pass the Turing test, but it might make you smile at the green screen.

    For insight on how to best train your own model, see TRAINING.md.

    Examples

    Two pre-built examples are included:

    tinychat

    A conversational chatbot trained on casual Q&A pairs. Responds to greetings, questions about itself, and general banter with terse personality-driven answers.

    guess

    A 20 Questions game where the model knows a secret topic and answers YES/NO/MAYBE to your questions. Guess correctly to WIN.

    Includes tools for generating training data with LLMs (Ollama or Claude API) and balancing class distributions.

    Features

    • Trigram hash encoding: 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
    • 16-bit integer inference: All math uses Z80-native 16-bit signed arithmetic
    • ~40KB .COM file: Fits in CP/M’s Transient Program Area (TPA)
    • Autoregressive generation: Outputs text character-by-character
    • No floating point: Everything is integer math with fixed-point scaling
    • Interactive chat mode: Just run CHAT with no arguments

    Interaction Style

    The model doesn’t understand you. But somehow, it gets you.

    Your input is hashed into 128 buckets via trigram encoding – an abstract “tag cloud” representation. The model responds to the shape of your input, not the exact words:

    "hello there"  →  [bucket 23: 64, bucket 87: 32, ...]
    "there hello"  →  [bucket 23: 64, bucket 87: 32, ...]  (same!)
    "helo ther"    →  [bucket 23: 32, bucket 87: 32, ...]  (similar - typo tolerant)
    

    This is semantically powerful for short inputs, but there’s a limit: longer or order-dependent sentences blur together as concepts compete for the same buckets. “Open the door and turn on the lights” will likely be too close to distringuish from “turn on the door and open the lights.”

    Small Responses, Big Meaning

    A 1-2 word response can convey surprising nuance:

    • OK – acknowledged, neutral
    • WHY? – questioning your premise
    • R U? – casting existential doubt
    • MAYBE – genuine uncertainty
    • AM I? – reflecting the question back

    This isn’t necessarily a limitation – it’s a different mode of interaction. The terse responses force you to infer meaning from context or ask probing direct yes/no questions to see if it understands or not (e.g. ‘are you a bot’, ‘are you human’, ‘am i human’ displays logically consistent memorized answers)

    What It’s Good At

    • Short, varied inputs with consistent categorized outputs
    • Fuzzy matching (typos, rephrasing, word order)
    • Personality through vocabulary choice
    • Running on constrianed 8-bit hardware

    What It’s Not

    • A chatbot that generates novel sentences
    • Something that tracks multi-turn context deeply
    • A parser that understands grammar
    • Anything approaching general intelligence

    It’s small, but functional. And sometimes that’s exactly what you need

    Architecture

    • Input: 128 query trigram buckets + 128 context buckets
    • Hidden layers: Configurable depth/width, e.g., 256 → 192 → 128
    • Output: One neuron per character in charset
    • Activation: ReLU between hidden layers

    Quantization Constraints

    The Z80 is an 8-bit CPU, but we use its 16-bit register pairs (HL, DE, BC) for activations and accumulators. Weights are packed 4-per-byte (2-bit each) and unpacked into 8-bit signed values for the multiply-accumulate.

    The 16-bit accumulator gives us numerical stability (summing 256 inputs without overflow), but the model’s expressiveness is still bottlenecked by the 2-bit weights, and naive training may overflow or act ‘weirdly’ without QAT.

    Z80 Inner Loops

    The core of inference is a tight multiply-accumulate loop. Weights are packed 4-per-byte:

    ; Unpack 2-bit weight from packed byte
    ld a, (PACKED)      ; Get packed weights
    and 03h             ; Mask bottom 2 bits
    sub 2               ; Map 0,1,2,3 → -2,-1,0,+1
    ld (WEIGHT), a
    
    ; Rotate for next weight
    ld a, (PACKED)
    rrca
    rrca
    ld (PACKED), a
    

    The multiply-accumulate handles the 4 possible weight values:

    MULADD:
        or a
        jr z, DONE       ; weight=0: skip entirely
        jp m, NEG        ; weight<0: subtract
        ; weight=+1: add activation
        ld hl, (ACC)
        add hl, de
        ld (ACC), hl
        ret
    NEG:
        cp 0FFh
        jr z, NEG1       ; weight=-1
        ; weight=-2: subtract twice
        ld hl, (ACC)
        sbc hl, de
        sbc hl, de
        ld (ACC), hl
        ret
    NEG1:
        ; weight=-1: subtract once
        ld hl, (ACC)
        sbc hl, de
        ld (ACC), hl
        ret
    

    After each layer, arithmetic right-shift by 2 to prevent overflow:

    sra h        ; Shift right arithmetic (preserves sign)
    rr l
    sra h
    rr l         ; ACC = ACC / 4
    

    That's the entire neural network: unpack weight, multiply-accumulate, shift. Repeat ~100K times per character generated.


    License: MIT or Apache-2.0 as you see fit.

    Share. Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Telegram Email
    Previous ArticleBinaries
    Next Article Staying ahead of censors in 2025
    TechAiVerse
    • Website

    Jonathan is a tech enthusiast and the mind behind Tech AI Verse. With a passion for artificial intelligence, consumer tech, and emerging innovations, he deliver clear, insightful content to keep readers informed. From cutting-edge gadgets to AI advancements and cryptocurrency trends, Jonathan breaks down complex topics to make technology accessible to all.

    Related Posts

    This stackable Xbox Game Pass Ultimate 1-month code is $25

    February 15, 2026

    Turn leads into deals with a $50 CRM lifetime license

    February 15, 2026

    This week’s free game on Epic Games Store is a sci-fi detective trip

    February 15, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Ping, You’ve Got Whale: AI detection system alerts ships of whales in their path

    April 22, 2025676 Views

    Lumo vs. Duck AI: Which AI is Better for Your Privacy?

    July 31, 2025260 Views

    6.7 Cummins Lifter Failure: What Years Are Affected (And Possible Fixes)

    April 14, 2025153 Views

    6 Best MagSafe Phone Grips (2025), Tested and Reviewed

    April 6, 2025112 Views
    Don't Miss
    Technology February 15, 2026

    This stackable Xbox Game Pass Ultimate 1-month code is $25

    This stackable Xbox Game Pass Ultimate 1-month code is $25 Image: StackCommerce TL;DR: A stackable month…

    Turn leads into deals with a $50 CRM lifetime license

    This week’s free game on Epic Games Store is a sci-fi detective trip

    Grab 2x 100W Anker USB-C cables for $10

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    About Us
    About Us

    Welcome to Tech AI Verse, your go-to destination for everything technology! We bring you the latest news, trends, and insights from the ever-evolving world of tech. Our coverage spans across global technology industry updates, artificial intelligence advancements, machine learning ethics, and automation innovations. Stay connected with us as we explore the limitless possibilities of technology!

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    This stackable Xbox Game Pass Ultimate 1-month code is $25

    February 15, 20263 Views

    Turn leads into deals with a $50 CRM lifetime license

    February 15, 20262 Views

    This week’s free game on Epic Games Store is a sci-fi detective trip

    February 15, 20263 Views
    Most Popular

    7 Best Kids Bikes (2025): Mountain, Balance, Pedal, Coaster

    March 13, 20250 Views

    VTOMAN FlashSpeed 1500: Plenty Of Power For All Your Gear

    March 13, 20250 Views

    This new Roomba finally solves the big problem I have with robot vacuums

    March 13, 20250 Views
    © 2026 TechAiVerse. Designed by Divya Tech.
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

    Type above and press Enter to search. Press Esc to cancel.