> ls models/twilight-135m/
# Twilight-135M
Our first model: a 135M-parameter base model, pretrained from scratch on 9.81B tokens in 4 hours 21 minutes on a single B200.
It beats GPT-2 (124M) on HellaSwag, ARC-Easy and ARC-Challenge, and ties it on PIQA. How we trained it: the writeup.
It's a base model: it continues text, and isn't tuned for chat. Weights and code are released under Apache 2.0.
| Twilight | GPT-2 | |
|---|---|---|
| HellaSwag | 32.1 | 31.2 |
| ARC-Easy | 51.4 | 43.8 |
| ARC-Challenge | 25.2 | 22.4 |
| PIQA | 62.9 | 62.9 |
Zero-shot accuracy, %. HellaSwag and ARC-Challenge are length-normalized. Same scorer for both models.
# Files
model-00001-of-00002.safetensors 272.6 MB
model-00002-of-00002.safetensors 265.5 MB
model.safetensors.index.json 11.7 KB
config.json 402 B
tokenizer.json 2.1 MB
twilight.py 4.6 KB
README.md 2.1 KB
LICENSE 11.4 KB
SHA256SUMS 680 B
| Parameters | 134.5M |
| Layers | 30 |
| Width | 576 |
| Attention heads | 9 query / 3 key-value |
| Feed-forward | SwiGLU, 1,536 |
| Positions | Rotary |
| Vocabulary | 49,152 |
| Context | 512 tokens |
Weights in float32, split across two safetensors shards.
# Use
Download every file, check them against SHA256SUMS, and sample. twilight.py is a self-contained PyTorch implementation; it runs on CUDA, Apple silicon or CPU.
U=https://files.horiznlabs.dev/twilight-135m mkdir twilight-135m && cd twilight-135m for f in README.md LICENSE config.json \ tokenizer.json twilight.py SHA256SUMS \ model.safetensors.index.json \ model-00001-of-00002.safetensors \ model-00002-of-00002.safetensors do curl -fsSLO "$U/$f"; done shasum -a 256 -c SHA256SUMS pip install torch safetensors tokenizers python twilight.py "The heart is a muscle that"
# In Python
From inside the folder:
from twilight import load, generate model, tokenizer = load() print(generate(model, tokenizer, "The heart is a muscle that"))