Pronghorn-5M-base: A 5M-Parameter Language Model Trained from Scratch
2 min readupdated
Pronghorn-5M-base is a compact 5-million-parameter language model trained from scratch by an independent developer on a dataset of YouTube transcripts. Built on a Llama-style decoder-only Transformer architecture, it features a custom tokenizer, RMSNorm, RoPE, and SwiGLU. Designed as a text continuer rather than a chat assistant, it generates conversational text from a prompt instead of answering questions. This makes it ideal for experiments, studying language model architecture, and serving as a lightweight base for personal research.
Key features
- Decoder-only Transformer architecture with 8 layers and 6 attention heads, written in PyTorch.
- Custom byte-level BPE tokenizer with a vocabulary size of 8,000 tokens.
- Trained on a cleaned dataset of YouTube transcriptions containing approximately 183 million tokens.
- 256-token context length and mixed precision (fp16) support.
What you can do
- Explore the internal mechanics of transformers, tokenization, and text generation from scratch.
- Run fine-tuning experiments on your own small text corpora.
- Integrate the model into machine learning and natural language processing educational projects.
Example
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")
print(generate(model, tok, "Welcome back to the channel. Today we are going to"))Read more
DetailsValidation loss: 3.756
Validation perplexity: approximately 43
Hardware requirements: a single free Google Colab T4 GPU, training takes about 50 minutes
Limitations: tends to loop, has a short 256-token memory, and lacks alignment










Comments