ReaganGPT Model Card (0.3 Release)
Model Details
- Model Name: ReaganGPT
- Version: 0.3 (Modern Architecture, Multi-Domain Expansion & GPU Pretraining Validation)
- Model Type: Decoder-only autoregressive Transformer (GPT architecture with RMSNorm, RoPE, SwiGLU, and PyTorch SDPA)
- Organization / Author: Reagan Moseti (
mosetireagan/reagangpt) - Framework: Native PyTorch (no external pretrained dependencies or foundation models)
- Base Model: None (Trained completely from scratch with random weight initialization)
- Tokenizer: Independently trained Byte-Pair Encoding (BPE) with byte fallback (zero OOV rate, 4,000 vocabulary size for 0.3)
- License: Apache-2.0
Quickstart: Loading and Generating with ReaganGPT 0.3
ReaganGPT is implemented in native PyTorch. You can clone this repository or use huggingface_hub to download checkpoints and generate text:
# 1. Clone repository
git clone https://huggingface.co/mosetireagan/reagangpt
cd reagangpt
# 2. Install dependencies (PyTorch 2.0+)
pip install torch pyyaml
# 3. Generate text with ReaganGPT 0.3 Small (Default root model: 5.84M params, RoPE, RMSNorm, SwiGLU, SDPA)
python generate.py --prompt "The Transformer architecture relies on" --temperature 0.7 --top-k 30 --top-p 0.9
# Or generate with ReaganGPT 0.3 Micro
python generate.py --checkpoint checkpoints/reagangpt-v03-micro --prompt "Once upon a time in a small village," --temperature 0.7
Python API
from huggingface_hub import snapshot_download
import sys
from pathlib import Path
# Download model from Hugging Face
repo_path = Path(snapshot_download(repo_id="mosetireagan/reagangpt"))
sys.path.insert(0, str(repo_path / "src"))
from reagangpt import ReaganGPT
# Load default root model (ReaganGPT 0.3 Small - 5.84M params, held-out loss 4.0096)
model = ReaganGPT.from_pretrained(repo_path)
output = model.generate("The Transformer architecture relies on", max_new_tokens=40, temperature=0.7)
print(output)
# Or load ReaganGPT 0.3 Micro (1.37M params)
micro_model = ReaganGPT.from_pretrained(repo_path / "checkpoints/reagangpt-v03-micro")
micro_output = micro_model.generate("Once upon a time in a small village,", max_new_tokens=40, temperature=0.7)
print(micro_output)
Architectural Configurations
ReaganGPT 0.3 implements modern decoder-only Transformer blocks with weight tying between the token embedding matrix and the language modeling output projection:
| Parameter | ReaganGPT 0.1 Micro | ReaganGPT 0.2 Micro | ReaganGPT 0.3 Micro | ReaganGPT 0.3 Small | ReaganGPT 0.3 Base |
|---|---|---|---|---|---|
| Hidden Dimension ($d_{\text{model}}$) | 128 | 128 | 128 | 256 | 512 |
| Layers ($L$) | 4 | 4 | 4 | 6 | 8 |
| Attention Heads ($N_h$) | 4 | 4 | 4 | 8 | 8 |
| Head Dimension ($d_k$) | 32 | 32 | 32 | 32 | 64 |
| Context Length ($T_{\max}$) | 256 | 256 | 256 | 512 | 1,024 |
| Vocabulary Size ($V$) | 918 | 2,000 | 4,000 | 4,000 | 4,000 |
| Normalization | LayerNorm | LayerNorm | RMSNorm | RMSNorm | RMSNorm |
| Positional Embedding | Learned Absolute | Learned Absolute | RoPE ($\theta=10000$) | RoPE ($\theta=10000$) | RoPE ($\theta=10000$) |
| Activation | GELU | GELU | SwiGLU | SwiGLU | SwiGLU |
| Attention Engine | Native PyTorch | Native PyTorch | PyTorch SDPA | PyTorch SDPA | PyTorch SDPA |
| Total Parameters | 943,616 | 1,082,112 | 1,365,120 | 5,844,224 | 27,746,816 |
| Non-Embedding Parameters | 705,408 | 705,408 | 853,248 (62.5%) | 4,820,224 (82.5%) | 25,698,816 (92.6%) |
| Tied Embeddings | Yes | Yes | Yes | Yes | Yes |
Dataset Provenance & Split Isolation
Corpus Scaling Progression
- ReaganGPT 0.1: 11 training documents (7,920 characters).
- ReaganGPT 0.2: 1,852 documents (~1.43M characters, ~710,000 tokens) across TinyShakespeare, WikiText-2, and CS texts.
- ReaganGPT 0.3: 26,008 documents (69,651,438 characters, ~28,000,000 packed subword tokens) across five permissive pillars:
- Classic Literature (PG-19 Project Gutenberg Pre-1919): 12,000 docs (Public Domain).
- Open Knowledge (Salesforce WikiText-103): 4,000 docs (CC BY-SA 3.0).
- Science & Technical Education (Cosmopedia v2): 4,000 docs (Apache-2.0).
- Narrative English Prose (TinyStories): 6,000 docs (CDLA-Permissive-2.0).
- Computer Science Foundations (ReaganGPT Treatises): 8 docs (CC0-1.0).
Data Hygiene & Leakage Isolation
- Deduplication: Document-level SHA-256 exact matching and Jaccard n-gram near-duplicate filtering (threshold 0.85).
- Partitioning: Deterministic hash-based 80 / 10 / 10 split:
- Train: 20,806 documents (55.8 MB text, SHA-256:
fe6e619b9ce7...) - Validation: 2,600 documents (7.0 MB text, SHA-256:
ea64f21043a0...) - Test (Held-out): 2,602 documents (6.9 MB text, SHA-256:
29dda3628af4...)
- Train: 20,806 documents (55.8 MB text, SHA-256:
- Zero Leakage: Strictly disjoint document boundaries. The test set was never accessed during tokenizer training or hyperparameter optimization.
Measured Held-Out Evaluation (0.3 Benchmark)
Evaluated across 2,602 strictly held-out test documents (6,869,672 characters):
| Model | Checkpoint | Parameters | Test Loss (CE) | Perplexity | Bits Per Byte (BPB) |
|---|---|---|---|---|---|
| Random Baseline (Untrained) | random init | 1,365,120 | 8.3134 | 4,078.25 | 1.1613 |
| ReaganGPT 0.2 Micro | checkpoints/reagangpt-v02-micro |
1,082,112 | 4.3074 | 74.25 | 0.6017 |
| ReaganGPT 0.2 Small | checkpoints/reagangpt-v02-small |
5,382,144 | 4.3293 | 75.89 | 1.2095 |
| ReaganGPT 0.3 Micro | checkpoints/reagangpt-v03-micro |
1,365,120 | 3.9648 | 52.71 | 0.5538 |
| ReaganGPT 0.3 Small | checkpoints/reagangpt-v03-small |
5,844,224 | 4.0096 | 55.12 | 1.1202 |
| ReaganGPT 0.3 Base (Pilot) | exp-009-v03-base-pilot |
27,746,816 | 4.4766 | 87.93 | 2.5013 |
Scope, Limitations & Non-Claims
- Unaligned Base Model: ReaganGPT is an unaligned decoder-only next-token predictor. It has not undergone SFT or RLHF and does not act as an interactive dialogue agent.
- Small Model Parameter Bounds: 1Mโ6M parameter models learn lexical collocations, syntax, and morphology, but cannot reliably memorize encyclopedic factual knowledge.
- Reproducibility: All training scripts, configs, data splits, and test harnesses are committed and reproducible using native PyTorch.
- Downloads last month
- 216