Vrel

A small language model built from scratch by Crisp Tech. Our own tokenizer, layers, attention, optimizer and training loop, trained from random numbers on one RTX 4060. No pretrained weights and no outside model code.

Vrel is tiny (14 to 28 million parameters). It continues text in the style it learned and nothing more: it cannot answer questions, follow instructions or hold a conversation. It is here to show, with real numbers, how a language model is built and how it learns.

Code: github.com/crisptech/vrel · Run it: Lyss, our terminal studio

Versions

Each folder is a complete, self-contained model: weights (8-bit), tokenizer, model.json and the Vrel code that runs it.

Folder Parameters Trained on Validation loss Perplexity
0.3.0/ 14.0M TinyStories, learning from Vrel 0.2 as a teacher 1.303 3.7
0.2.0/ 27.8M TinyStories (2.7M short stories) 1.278 3.6
0.1.0/ 13.9M 67 public-domain novels from Project Gutenberg 3.637 38.0

Scores for 0.2 and 0.3 are on 27,630 held-out stories (5.58M tokens); the bigram baseline scores 3.514 (perplexity 33.6). Lower is better: perplexity is roughly how many words the model is torn between.

Vrel 0.3 against 0.2: half the size, nearly the same score, and faster (148 against 139 tokens/s on an RTX 4060, 170 against 126 on 4 CPU threads).

Use it

With Lyss (needs Python and PyTorch):

pipx install git+https://github.com/crisptech/lyss
hf download crisptechdev/vrel --local-dir vrel   # all three versions, 55 MB

Copy the version folders you want (say 0.3.0) into Lyss's models folder (lyss --help shows where), then run lyss.

From Python, without Lyss:

import sys
sys.path.insert(0, "vrel/0.3.0")
from vrel.generate import load

model = load("vrel/0.3.0")
print(model.generate("Once upon a time", max_tokens=200, seed=1))

A Vrel 0.3 story (seed 3):

The dog found a box in the park. He wanted to see what was inside. He barked and ran around the box, trying to open it. But he couldn't get it out. Then, he saw a ball. He wanted to play with it.

Licenses

Code and weights: MIT, Crisp Tech. Vrel 0.2 and 0.3 were trained on TinyStories (Ronen Eldan and Yuanzhi Li, 2023), released under CDLA-Sharing-1.0; those stories were written by GPT-4, and Vrel learns only from the text, never from another model's weights. Vrel 0.1's books are public domain in the US.

Downloads last month
262
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train crisptechdev/vrel