HuggingFaceFW/fineweb-edu
Viewer • Updated • 3.5B • 460k • 1.46k
Rhoa (ῥόα, the pomegranate) is a tiny decision model: it reads a situation and a list of options, scores every option and picks one. This is the small Rhoa, pre-trained on 2 GB of web text, then fine-tuned. It does not write: one forward pass scores all options and a softmax over them gives one probability each.
Written and trained from scratch in PyTorch (no Hugging Face transformers): tokenizer, Transformer, training.
Code, all the other checkpoints and the full benchmark: GitHub · project page.
A learning project, not a production model.
pip install "tiny-dlm[hub] @ git+https://github.com/benisalla/tiny-dlms"
from tiny_dlm.data import Decision, collate
from tiny_dlm.hub import from_pretrained
model, tokenizer, config = from_pretrained("liamsi/tiny-dlms-rhoa-small")
context = "i lost my card yesterday , what should i do ?"
options = ["lost or stolen card", "change pin", "card arrival"]
idx, cand_mask, _ = collate([Decision(context, options, options[:1])], tokenizer)
choice, probs = model.decide(idx, cand_mask)
print(options[choice.item()], probs[0].tolist())
| Layers x width | 2 x 64 (4 heads) + 1 layer where the options look at each other |
| Tokenizer | byte-level BPE, 8,192 tokens, trained on the web text |
| Input | <cls> context <sep> option, up to 128 tokens |
| Blocks | RMSNorm, RoPE, SwiGLU |
| Weights | 0.72 M |
| Training steps | 14,000 |
| Dataset (held-out test) | Options | This model | Random |
|---|---|---|---|
| bAbI | 6 | 81.4% | 28.2% |
| CLINC150 | 151 | 67.6% | 0.7% |
| Banking77 | 77 | 83.0% | 1.3% |
| CommonsenseQA | 5 | 17.6% | 20.0% |
CommonsenseQA stays near random for every model: a few million weights cannot hold world knowledge.
| Model | |
|---|---|
| tiny-dlms-rhoa | the best Rhoa: pre-trained on 2 GB of web text, then fine-tuned |
| tiny-dlms-rhoa-small | the small Rhoa, pre-trained on 2 GB of web text, then fine-tuned |
| tiny-dlms-rhoa-gpt2 | Rhoa with GPT-2 blocks (LayerNorm, learned positions, GELU), pre-trained on 2 GB of web text |
| tiny-dlms-rhoa-base | the pre-trained Rhoa before fine-tuning: masked-token prediction on 2 GB of web text |
| tiny-dlms-melon-car | Mēlon driving CarRacing from pixels |
| tiny-dlms-melon-car-small | the small Mēlon driving CarRacing from pixels |
| tiny-dlms-melon-maze | Mēlon solving mazes from pixels |