little / MODEL_CARD.md
cortexist's picture
Show little.png on the model card
8b5bcf2 verified
|
Raw History Blame Contribute Delete
12.4 kB
---
license: mit
language:
- en
pipeline_tag: text-generation
tags:
- character-level
- tiny
- 4-bit
- quantization-aware-training
- retro-computing
- pentium-mmx
- c
datasets:
- roneneldan/TinyStories
- HuggingFaceTB/everyday-conversations-llama3.1-2k
model-index:
- name: Little v0.13
results:
- task:
type: text-generation
name: Grammatical acceptability (minimal pairs)
dataset:
type: nyu-mll/blimp
name: BLiMP
metrics:
- type: accuracy
value: 63.3
name: accuracy (mean of 67 phenomena)
---
# Little v0.13
![Little on the Linux console of a Pentium MMX](little.png)
Little is a 16-million-weight, letter-by-letter transformer that answers
questions on a 1998 PC. It is written in C for the Linux console and runs
in about 11 MB of RAM, at 8.5 to 13.6 letters a second on a Pentium MMX at
233 MHz. Version 0.13 ships the network of training run v13: everyday
facts, greetings, Linux commands of its time, short stories and a few
holiday recipes. The C program and training code are on
[GitHub](https://github.com/cortexist/little).
```
> Write a short story about a chicken.
Once upon a time, there was a little chicken. The chicken was very hungry.
It wanted to find some food to eat. The chicken walked and walked. It saw
some ice cream on the ground. The ice cream was starting to melt. The
chicken thought it would be yummy to eat. The chicken ate the melted ice
cream. But the ice cream was bad. The chicken got sick. It was not a happy
day for the chicken.
> Write a poem about the sea.
I can't write poems, sorry. Ask a large language model.
```
## Model details
- **Type:** decoder-only transformer, one letter per token
- **Size:** 16,185,984 weights: 9 layers, width 384, 6 attention heads,
a 1,536-wide ReLU feed-forward layer, RMS norms, learned positions, and
the letters table shared with the output
- **Context:** 512 letters, enough for the last three questions and answers
- **Alphabet:** 148 signs: printable ASCII, 41 accented letters and signs
that both code page 437 and Latin-1 have (é, ü, ñ, ß, °, ½ …), and one
sign for a run of each of ten other alphabets (Chinese, kana, hangul,
Cyrillic, Greek, Arabic, Hebrew, Thai, Devanagari …)
- **Weights:** 4-bit layer tables with one float scale per row; the letters
and positions tables at 8 bits. The weight file (`little.bin`) is
8,372,328 bytes and is mapped into memory, not copied.
- **Trained by:** Opus 5.5, on code written by Fable 5.2 and Opus 5.5
- **Inspired by:** [TINY 2.1](https://github.com/WollyMonjac/Tiny-2.1), a
tiny question-answering network for DOS. Little's hand-written facts
started from TINY's.
- **License:** MIT for the code, the hand-written facts and the weights;
see the [data licenses](https://github.com/cortexist/little/blob/v0.13/DATA_LICENSES.md)
## How to use
The weights run in Little’s C program, which needs a C compiler and libc.
To run this release, get the matching source and weights.
```sh
git clone --branch v0.13 https://github.com/cortexist/little.git
cd little
curl -fL -o little.bin https://huggingface.co/cortexist/little/resolve/v0.13/little.bin
make
./little # chat screen; Enter sends, Esc stops an answer
./little 0 # creativity 0: always the surest letter
./little -b < questions # one answer per line, plain text
```
Creativity (0 to 9, default 5) is a temperature of creativity / 5 over the
letters whose chance is at least 15% of the best one's; at 0 Little always
takes the best letter.
Little writes slots that the program fills from the computer's clock:
`{time}`, `{date}`, `{day}`, `{age}` and others ("What time is it?" → "It is
{time}." → "It is 2:05 PM."), and `{yourname}` for a name you told it.
On 32-bit x86 the program uses MMX when the CPU has it; every other CPU
runs plain C that gives the same answers. The weight file format is
described in [training/weights.py](https://github.com/cortexist/little/blob/v0.13/training/weights.py).
### Speed on a Pentium MMX 233 MHz (Intel 430TX, Linux 2.4.33, gcc 3.4.6)
| Time per letter | Letters/s |
|------------------------------|-----------|
| writing, letters 0 to 24 | 13.6 |
| writing, letters 480 to 504 | 8.5 |
| reading, letters 0 to 64 | 18.3 |
| reading, letters 400 to 464 | 10.6 |
A story of 350 to 400 letters takes about 40 seconds to write.
## Intended use
- A demonstration of what a very small language model can do on a 1998 PC,
and a starting point for training one yourself (`training/`)
- Simple questions: everyday facts, famous people, places, the date and
time, the Linux commands of its era (it says what to type and runs
nothing), greetings and small talk, short children's stories
**Out of scope:** anything where a wrong answer matters. Little makes
things up confidently, knows nothing after its training data, and says so
less often than it should. It does not run commands, browse, or remember
anything between sessions.
## Training data
Generated on the fly by `training/mix.py` from:
| Source | Licence | Share of samples |
|---|---|---|
| Facts asked in many wordings, with yes/no, reverse, "I don't know" and place questions: about 3,700 hand-written facts and descriptions (`training/facts/`), and tables from [Wikidata](https://www.wikidata.org) (people, inventions, companies, books, films, characters, cities, mountains, rivers) and [Natural Earth](https://www.naturalearthdata.com) | MIT; CC0, public domain | 68% |
| About 1,300 children's and young adult books from Project Gutenberg, read as they are and as dialogue; paragraphs with slurs or caricatured dialect left out | public domain in the U.S. | 9% |
| 8,525 stories of 150 to 400 letters from [TinyStories](https://huggingface.co/datasets/roneneldan/TinyStories) (GPT-4 version), with the topic and mood of each | CDLA-Sharing-1.0 | 3% |
| *Everyday Conversations* and *American Teens Talk!* (U.S. Department of State) | public domain; reproduced with attribution | 2% |
| Everyday questions with short helper answers from [everyday-conversations-llama3.1-2k](https://huggingface.co/datasets/HuggingFaceTB/everyday-conversations-llama3.1-2k) | Apache-2.0 | 1% |
| Generated turns: follow-up questions and unrelated earlier turns, small talk, greetings, what an AI without a body can't do, its tools (a clock and a calendar) and the ones it lacks, Linux commands, jokes, recipes, writing jobs it can't do | MIT | 17% |
A short private list of places added by the author is not in the
repository; without it the training kit works the same.
The answers are kept timeless (no "still open" or "closed"), and Little
knows it was trained in 2026 without any news of 2026.
## Training procedure
- **Quantization-aware from the start:** every step rounds the layer
weights exactly as the export stores them (4 bits, one scale per row);
gradients pass through the rounding.
- **Stage 1 (v7):** 5 hours from scratch at 256 letters of context, 247,988
steps of 256 examples.
- **Stage 2 (v13):** 10 hours from v7 with the context grown to 512 letters
and the alphabet to 148 signs (new positions copied from the first ones, an
accented letter starting as its plain letter), 326,683 steps of 256
examples, peak learning rate 5e-4.
- **Optimizer:** AdamW, betas 0.9 and 0.98, weight decay 0.01 on the
tables, gradient norm clipped at 1; 500 warm-up steps, then a cosine down
to 5% of the peak.
- **Loss:** a question's answer letters only (the question is read, not
learned); every letter of a book passage.
- **Compute:** 15 hours on one NVIDIA RTX PRO 4500, about 1.6×10¹⁸
operations (15.8 billion letters, padding included). The same work would
have taken a Pentium MMX 233 about 430 years at a realistic rate
(`training/cost.py`).
Every change of the data gets one fresh 10-hour run from v7: runs resumed
again and again lost a little each time.
## Evaluation
On 2,625 questions kept out of training (held-back wordings, names and
stories), scored by the key words of a right answer, greedy:
| Questions held back for testing | Right |
|--------------------------------------------------------|-------|
| everything below together | 74.0% |
| modern facts, new phrasings | 93% |
| "what did X write / invent" | 55% |
| tables (capitals, animals, words) | 85% |
| numbers, letters, "I don't know" | 71 to 100% |
| one-off hand-written facts | 49% |
| date and time, its tools | 93 to 100% |
| greetings | 70 to 86% |
| Linux commands | 62% |
| accented names, typed either way | 61% |
| other languages ("I only speak English") | 83% |
| a short story about the topic and in the mood asked | 61% |
| holiday recipes, other dishes ("a large language model can give you one") | 98% |
| a poem, an email …: says it can't | 93% |
- **Questions as people typed them** (`training/asked.txt`, some after
earlier turns): 15 of 18.
- **Reading:** 1.45 bits per letter on children's books it never saw.
### BLiMP
[BLiMP](https://github.com/alexwarstadt/blimp) has 67,000 pairs of
sentences that differ in one point of grammar ("The cats annoy Tim." /
"The cats annoys Tim."), 1,000 for each of 67 phenomena. A model is right
when it finds the grammatical sentence more likely; guessing gets 50%.
Little scores each sentence by the sum of its letters' log-probabilities
after a newline, the same forced choice as the paper's whole-sentence
method. The other rows are from the BLiMP paper (Warstadt et al., 2020;
corrected arXiv version 4, Table 3):
| Model | Weights | Training text | BLiMP |
|---|---|---|---|
| chance | | | 50.0% |
| 5-gram model | | English Gigaword, 3.1B words | 61.2% |
| **Little v0.13** | **16M, at 4 bits** | **about 330 MB of text read many times, 15.8B letters in all** | **63.3%** |
| Transformer-XL Large | | WikiText-103, 103M words | 69.6% |
| LSTM (Gulordava et al., 2019) | | Wikipedia, 83M words | 69.8% |
| GPT-2 large | 774M | WebText, about 8B words | 83.0% |
| humans | | | 88.6% |
Little is above the 5-gram model and well below the neural models
trained on encyclopedia or web text. Most of its training is short
questions and answers rather than running prose, and its 16 million
weights must also hold its facts. It does best on agreement and word
forms (morphology 75%) and worst on some pairs with a gap after "who" or
"that", with "only ... ever" and with quantifiers after "there are" (13 to
30%, below chance). Two training runs on similar data differ by about 3
points per phenomenon.
## Limitations and biases
- **It makes things up.** Asked about a name it half knows, it often mixes
it up with a similar one, and it may answer a question it should not.
- **Stories:** the grammar holds better than the plot; a "happy story" can
end sad, and longer stories repeat themselves.
- **Earlier turns:** it answers well after unrelated turns, but rarely uses
them: it cannot take back a wrong answer when corrected, and after
offering a story it may not tell one.
- **Tools it lacks:** asked to send a text or check the weather, it often
answers with another "I can't" instead of naming its real tools (26%).
- **Recipes:** 16 recipes learned by heart; follow food-safety guidance
rather than a 16-million-weight network.
- **English only.** Other languages get "Sorry, I only speak English."
- **Old books:** much of its reading is children's literature from before
1930. Paragraphs with racial slurs or caricatured dialect were removed,
but dated views and manners remain in what it read.
- **Places:** its towns and stores lean toward the United States.
## Citation
```
@software{little_2026,
title = {Little: a small transformer for old Linux PCs},
version = {0.13},
year = {2026},
note = {16M-weight 4-bit letter-level transformer in C for the Pentium MMX}
}
```
TinyStories: Ronen Eldan and Yuanzhi Li, *TinyStories: How Small Can
Language Models Be and Still Speak Coherent English?*, 2023,
[arXiv:2305.07759](https://arxiv.org/abs/2305.07759).