tiny-dlms-rhoa: Rhoa 4x128

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 best 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.

Usage

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")
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())

Model

Layers x width 4 x 128 (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 2.36 M
Training steps 14,000

Training

  1. Masked-token pre-training on 2 GB of FineWeb-Edu web text (479M tokens).
  2. Fine-tuning on 4 datasets at once: bAbI (2-6 options), CLINC150 (151 intents), Banking77 (77 intents) and CommonsenseQA (5 options).

Results

Dataset (held-out test) Options This model Random
bAbI 6 100.0% 28.2%
CLINC150 151 72.6% 0.7%
Banking77 77 84.4% 1.3%
CommonsenseQA 5 20.8% 20.0%

CommonsenseQA stays near random for every model: a few million weights cannot hold world knowledge.

The tiny-dlms models

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
Downloads last month
-
Safetensors
Model size
2.36M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Datasets used to train liamsi/tiny-dlms-rhoa

Collection including liamsi/tiny-dlms-rhoa