tiny-dlms-rhoa-base / README.md
liamsi's picture
tiny-dlms-rhoa-base: weights and card
9bccd24 verified
|
Raw History Blame Contribute Delete
2.97 kB
---
license: mit
library_name: tiny-dlms
pipeline_tag: fill-mask
language: [en]
tags:
- tiny-dlms
- decision-model
- from-scratch
- pytorch
- masked-language-modeling
datasets:
- HuggingFaceFW/fineweb-edu
---
# tiny-dlms-rhoa-base: Rhoa 4x128 base
Rhoa (ῥόα, the pomegranate) is a tiny decision model: it reads a situation and a list of options and scores every option. This is the **base** model, the pre-trained Rhoa before fine-tuning: masked-token prediction on 2 GB of web text. It is the starting point of the fine-tuned Rhoa.
Written and trained from scratch in PyTorch (no Hugging Face `transformers`): tokenizer, Transformer, training.
Code, all the other checkpoints and the full benchmark: [GitHub](https://github.com/benisalla/tiny-dlms) · [project page](https://benisalla.github.io/tiny-dlms/).
A learning project, not a production model.
## Usage
```bash
pip install "tiny-dlm[hub] @ git+https://github.com/benisalla/tiny-dlms"
```
```python
from tiny_dlm.hub import from_pretrained
model, tokenizer, config = from_pretrained("liamsi/tiny-dlms-rhoa-base")
# a base model, not fine-tuned: model.encode(idx) gives one vector per token,
# model.mlm_head scores the hidden tokens. For decisions use liamsi/tiny-dlms-rhoa.
```
## 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 | 38,000 |
## Training
Masked-token pre-training (15% of tokens hidden) on 2 GB of [FineWeb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) (479M tokens).
## Results
Pre-training only: it guesses 47.7% of the hidden tokens of held-out web text. The fine-tuned version, [tiny-dlms-rhoa](https://huggingface.co/liamsi/tiny-dlms-rhoa), reaches 100% on bAbI.
## The tiny-dlms models
| Model | |
|---|---|
| [tiny-dlms-rhoa](https://huggingface.co/liamsi/tiny-dlms-rhoa) | the best Rhoa: pre-trained on 2 GB of web text, then fine-tuned |
| [tiny-dlms-rhoa-small](https://huggingface.co/liamsi/tiny-dlms-rhoa-small) | the small Rhoa, pre-trained on 2 GB of web text, then fine-tuned |
| [tiny-dlms-rhoa-gpt2](https://huggingface.co/liamsi/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](https://huggingface.co/liamsi/tiny-dlms-rhoa-base) | the pre-trained Rhoa before fine-tuning: masked-token prediction on 2 GB of web text |
| [tiny-dlms-melon-car](https://huggingface.co/liamsi/tiny-dlms-melon-car) | Mēlon driving CarRacing from pixels |
| [tiny-dlms-melon-car-small](https://huggingface.co/liamsi/tiny-dlms-melon-car-small) | the small Mēlon driving CarRacing from pixels |
| [tiny-dlms-melon-maze](https://huggingface.co/liamsi/tiny-dlms-melon-maze) | Mēlon solving mazes from pixels |