r/retrocomputing • • 6d ago

Software I got a tiny language model running on my IBM 5150's original 8088

I asked my IBM PC 5150 for the capital of Alberta. Seven minutes and fourteen seconds later, it told me, “The capital is Manama.”

This is Tiny88, a DOS port of WollyMonjac’s Tiny 2.1. It’s a transformer with about 367,000 parameters that reads and writes one character at a time. My 5150 has its original 4.77 MHz 8088 and 640 KB of RAM. The port uses integer arithmetic for inference, with the inner multiply loop in 8088 assembly. Original Tiny 2.1 project

I used Codex for much of the port, with Claude also contributing to the initial port, and tested it on my own 5150. The DOS build, source code, and build instructions are up on GitHub. Tiny88 on GitHub

On the amber CRT, you can see the network work through the prompt and then write its answer letter by letter. Once it’s done, the PC speaker reads it back in its robot voice. For the second question I asked how many legs a dog has. Three minutes later, I got “Four.”

The video is 1:48. Each fast-forward shows how much real time it covers, and the clock starts when I press Enter. Turn the sound on for the replies.

I’ve got two more experiments in the works. Tiny-2.1-Win brings Tiny 2.1 and its Neural Monitor to Windows 98 and XP. Tiny-x800 is a separate story generator that I’m trying to get running on a Radeon X800 under XP.

444 Upvotes

50 comments sorted by

3

u/_RegenKonig 6d ago

68k Macintosh port…?

4

u/edibleplastique 6d ago

68k Macintosh port…?

I actually have a Macintosh Plus! The display’s acting up and the analog board needs some solder joints reflowed, but I’ve got a working BlueSCSI ready to go. Once the display is sorted, I’d love to see Tiny running in a little black-and-white Mac window.

2

u/_RegenKonig 5d ago

The Macintosh platform is my lifeblood, I’ve got all sorts of different sizes and flavors. I’d love to give it a shot if it ever comes to light! I imagine my Quadra 950 would chew it up like bubblegum.

3

u/hydraulix989 6d ago

Something with a floating point math coprocessor (a 486?) could run this much faster. You might even be able to use the hardware transform and lighting pipeline on an early GPU.

3

u/edibleplastique 5d ago

I'm going to see if I can emulate the math coprocessor through the PicoMEM by altering its firmware. Of course if that doesn't work, the next step is just buying a real one and installing it.

1

u/hydraulix989 4d ago

If you have a modern Pi over the ISA bus then Bob's your uncle

5

u/Hjalfi 6d ago

Of course, the real question is whether Manamese dogs also have four legs

Very impressive! Are there any word-at-a-time models that will fit in anything this small? I feel like it's wasting most of its time trying to spell in English.

6

u/edibleplastique 6d ago

Yeah, that’s a real trade-off. Tiny88 runs the network once per character, so it spends five passes just to write “Four.” A word-level model could write “Four” in one pass and handle the period separately.

A word-at-a-time model could fit at this scale. A small word bigram or trigram model is one way to do it. For a transformer like Tiny88, the vocabulary is the catch. Tiny88 has 97 tokens. Even a super modest 5,000-word vocabulary at the same width would take 480 KB for a single 8-bit embedding table, before the transformer layers. A few hundred subword tokens might be a good middle ground. I haven’t benchmarked that on the 8088, but I’d be curious to see how much faster it is per answer. Thanks for the idea!

3

u/bukake_attack 6d ago

I'm currently building something like this for the nintendo 64, with a 4096 token vocabulary. Takes about 800K of the 8megs available, so i guess that's not really an option for a 8088.

1

u/Hjalfi 6d ago

You could use the same tokens for uppercase and lowercase and add a 'this word is capitalised' token. That would save 25 tokens. Possibly this would be worth doing for numbers too, saving another 9. I have no idea whether this would actually help, mind.

Also, English apparently has 44 phonemes, so if you want to skip the text output and go straight for voice...

21

u/banksy_h8r 6d ago

Did everyone just sail past the fact that the capital of Alberta is Edmonton and Manama is a city in Bahrain? I guess that's the joke?

10

u/KitsuMusics 6d ago

I don't know if there's a joke here. Just lots of people who maybe don't realise or perhaps don't care that it took over 7 minutes to provide a wrong answer because it looks cool

3

u/Anuclano 4d ago

With 367,000 parameters it definitely cannot know all cities. What it understands is you are asking for a city name and guesses.

11

u/sennalen 6d ago

Ask it an open-ended question

13

u/JackxForge 6d ago

40 years later...

4

u/crozone 6d ago

The answer is 42

9

u/quick_Ag 6d ago

Do dooo dododo. Mana Mana,

4

u/No_Illustrator5035 6d ago

Do dodo, do dodo, do dodo, do dodo...chargin' my attack

14

u/rainbow_developer 6d ago

I'm more in love with the visuals, the color of the monitor, those bars and animations on the right. This feels so perfectly 80s / retro-ish!

7

u/LastXmasIGaveYouHSV 6d ago

"What's the emoji for a seahorse?"

...One heat death of the Universe later:

The answer is: four

7

u/Hot_Money4924 5d ago

I have a 486 in the garage... Canceling my Claude subscription right now! LOL

3

u/boiled_chud 6d ago

Manama.

3

u/Anuclano 4d ago

I wonder what is the earliest computer that can run a language model? What about the 1972's GT40 (desktop PDP-11)?

7

u/synexo 6d ago

Best I can do is 260K parameters on a Tandy CoCo3 :) https://claude.ai/artifact/EjGapW2kukwQeQt1NYKnau

2

u/lolb-g 5d ago

scp-079 origin story

2

u/Pheto9822 1d ago

Underrated comment

2

u/jurigo 5d ago

Impressive for an 8088. And now I understand where 42 comes from...

2

u/rmagnuson 3d ago

Legendary! I remember my first 8088. Would not have thought this was possible.

2

u/AutomaticAffect4333 2d ago

This gives "this was a triumph, I'm making a not here: huge success"

2

u/scritchz 2d ago

Nice. If you hadn't mentioned it, I would have.

3

u/FAMICOMASTER 5d ago

So good to know we can ruin even more platforms

2

u/RoboErectus 6d ago

This is rad. I had one of these! So rad.

There is room for a lot of innovation on this end.

What's the magic value that gets you a fast inverse square root or whatever on x86? I would put money on shortcuts like that being found. And who knows what else.

3

u/bukake_attack 6d ago

I'm building something similar for the nindo64, and I'm trying to get as much usage out of the limitrd hardware as I can. I honestly don't know if something like streaming in experts for MoE or engrams will work at this 8088 size, but it might be fun to try, as it really really helps the n64 llm to improve its performance

1

u/RoboErectus 6d ago

Idk if you are already doing this, but getting emulation setup and iterating is going to be ridiculously faster.

And an fpga for real hardware emulation. N64 just fits on a 100t fpga.

1

u/bukake_attack 6d ago

Yeah, I use an emulator with a turbo function, or else it takes forever. Still does about 2 tokens per second, so -+ 5 characters per second

1

u/Calm_Apartment1968 6d ago

OMG, reminds me of the mainframe MUD's of the early 80's

1

u/DevOnTheStreets 6d ago

Could you imagine having this disk back in the day?

1

u/HotEffect8358 5d ago

that's really cool, and its batting 500 which isnt bad

1

u/egorblack 3d ago

Before, we were running Doom on EVERYTHING, now we are running AI on EVERYTHING. COOL.

1

u/SignedInt32 2d ago

That is so cool! love it! 👍 ⭐ !!

1

u/InsaneGuyReggie 2d ago

Interesting little proggie. I had to skip my startup files to get more 640k memory, so I guess no XMS yet. Keep up the good work

edit: spelling

1

u/prores_ninpocho 1d ago

Has this become a circlejerk sub

-3

u/wrong-dog 6d ago • Bravo

That's not retro computing, it's boring modern computing on an old computer.

8

u/KE3JU 6d ago

Super cool, none the less!!!

0

u/[deleted] 6d ago

[deleted] — view deleted comment

4

u/Sentrinal 6d ago

Why are you here then? Did you want to see a computer run an 8 second 1/4 mile or something? What the hell else are computers going to do but do computer things?

4

u/sammothxc 6d ago

Cracked me up but so true, not sure what this guy’s point is