Pronghorn-5M-base
Small, quick, and built from scratch.
A 5-million-parameter, Llama-style language model, trained from scratch.
Pronghorn is my third from-scratch model and the biggest so far: 5M parameters. This time I built the tokenizer, cleaned the dataset, and wrote the Llama-style architecture (RMSNorm, RoPE, SwiGLU) myself. It is the successor to my earlier 1M-parameter models, Tinygpt-python-teacher and Tinygpt_v2_conversation.
This is a base model: a text continuer, not a chat assistant. Give it the start of a sentence and it keeps going in the style of a spoken video transcript. It does not follow instructions or answer questions, and it frequently makes things up.
Model details
| Parameters | 5,078,208 |
| Architecture | Decoder-only Transformer, Llama-style, written from scratch in PyTorch |
| Layers / heads / width | 8 layers, 6 heads (32 dims each), 192 dimensions |
| Feed-forward | SwiGLU, hidden size 512 |
| Position encoding | RoPE (rotary), no learned position table |
| Normalization | RMSNorm (pre-norm), plus a final RMSNorm |
| Embeddings | Output layer shares weights with the input embedding table |
| Context length | 256 tokens |
| Tokenizer | Byte-level BPE, 8,000 tokens, trained on the same data. Special tokens: <pad> (id 0), <eos> (id 1) |
Training
- Data: AlmostNobody/youtube-commons-clean-40k,
a cleaned subset of the Common Pile Creative Commons YouTube dataset.
About 183.9M training tokens and 10.0M validation tokens (split by video, 95% / 5%).
An
<eos>token marks the end of each video. - Steps: 12,000 steps, batch of 64 sequences x 256 tokens (about 197M tokens seen, roughly one pass over the data).
- Optimizer: AdamW (betas 0.9 / 0.95, weight decay 0.1 on weight matrices, none on norms).
- Learning rate: 300 warmup steps up to a peak of 1e-3, then cosine decay down to a final value of 1e-4.
- Other: gradient clipping at 1.0, mixed precision (fp16).
- Hardware: one free Google Colab T4 GPU, about 50 minutes.
- Training code: see
training_notebook.ipynbin this repo.
Results
| Metric | Value |
|---|---|
| Final validation loss | 3.756 |
| Final training loss | about 3.76 |
| Perplexity (validation) | about 43 |
Training and validation loss stayed close together, so the model was learning general patterns of the data and not memorizing it. A model guessing randomly among 8,000 tokens would start at a loss of about 9.0.
Example output
Prompt: Hi everyone, my name is
Hi everyone, my name is Jared. As you know me right now, I'm going to get up on our list and I'll be getting you a little over there as well so we've been with the Cavs. Well, I would say that's kind of a nice point...
The grammar and rhythm look like real speech, but the content is not meaningful. Names, places, and facts it produces are invented, not recalled.
How to use
from huggingface_hub import snapshot_download
from tokenizers import Tokenizer
import sys
path = snapshot_download("AlmostNobody/Pronghorn-5M-base")
sys.path.insert(0, path)
from model import load_model, generate
tok = Tokenizer.from_file(f"{path}/tokenizer.json")
model = load_model(f"{path}/final_model.pt") # add device="cuda" for a GPU
print(generate(model, tok, "Welcome back to the channel. Today we are going to"))
Requirements: torch, tokenizers, huggingface_hub.
Settings you can change in generate: temperature (lower is safer, higher is more random), top_k,
and rep_penalty (higher means fewer repeated words, but stranger word choice).
Limitations
- Repetition: small models tend to loop ("channel channel channel"). The repetition penalty helps but does not fix it.
- No knowledge or reasoning: it learned how spoken English sounds, not what is true.
- Drifts off topic after a sentence or two.
- Short memory: 256-token context.
- No safety or alignment training. It was trained only on raw transcripts, so it can produce biased or offensive text that reflects the mix of videos in the data.
Intended use
Learning, experiments, and a small baseline for tokenizer, architecture, or fine-tuning projects. Not suitable for any real-world use where accuracy or safety matters.
License and attribution
The model weights and code are released under the MIT License (see LICENSE).
The training data is derived from the Creative Commons YouTube portion of the Common Pile (videos under CC BY 4.0). See the dataset page for the full attribution and a description of the changes I made. Please cite the original work:
Kandpal, N., Lester, B., Raffel, C., et al. (2025). The Common Pile v0.1: An 8TB Dataset of Public Domain and Openly Licensed Text. arXiv:2506.05209.
Author
Built by AlmostNobody while learning how language models work. Questions and feedback are welcome in the Community tab.
- Downloads last month
- -