Downloads · 30 days
18
8% of all-time downloads
Zaid-Lakdawala/ZL-300M
ZL-300M is a text generation model from Zaid-Lakdawala. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
A ~300M-parameter decoder-only Transformer, implemented entirely from scratch in PyTorch (no transformers model code, no borrowed architecture) — tokenizer, RoPE attention, SwiGLU feed-forward, RMSNorm, the training l…
Downloads · 30 days
18
8% of all-time downloads
All-time downloads
228
Public
Parameters
417M
1.7 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1.7 GB · 99%
From the Hugging Face model README
A ~300M-parameter decoder-only Transformer, implemented entirely from scratch in PyTorch (no transformers model code, no borrowed architecture) — tokenizer, RoPE attention, SwiGLU feed-forward, RMSNorm, the training loop, and generation were all hand-written for this project.
Two training stages, in order:
Same architecture/tokenizer/vocabulary as the teacher throughout, so student and teacher logits are directly comparable — the whole point of a from-scratch project reusing a real vocabulary as data, not as a shortcut on the architecture itself.
| Parameters | 300,544,512 |
| Weights (fp32, this repo) | ~1.2 GB |
| Teacher (Qwen2.5-7B-Instruct) | 7.61B params, ~15.3 GB in bf16 |
| Compression vs. teacher | ~25.3× fewer parameters |
This release is weights + tokenizer only — model.safetensors (the trained parameters) and the tokenizer files (vocab.json, merges.txt, tokenizer.json, tokenizer_config.json), described by config.json. It uses a custom, non-standard architecture (not a transformers model class), so no AutoModelForCausalLM.from_pretrained(...) one-liner and no loading code are included in this release — treat this as the raw artifact of the training run, not a ready-to-run package.
The chat format used during fine-tuning, for reference:
<|im_start|>system
You are a helpful assistant. Answer clearly and concisely, ideally in 2-4 sentences, unless the question genuinely needs more detail.<|im_end|>
<|im_start|>user
{your question}<|im_end|>
<|im_start|>assistant
This is an educational from-scratch project, not a production model, and it shows:
<|im_end|>.| Stage 1 | Stage 2 (this checkpoint) | |
|---|---|---|
| Data | ~7B tokens, FineWeb-Edu | ~10,356 curated Q&A pairs (Dolly-15k questions, Qwen2.5-7B-Instruct answers) |
| Objective | Next-token cross-entropy | α=0.5 blend: cross-entropy + KL-divergence (T=2.0) vs. teacher |
| Hardware | RTX A5000 (rented) | RTX A5000 (rented) |
| Steps | 106,811 | 2,000 |
Released under Apache 2.0, matching the license of Qwen2.5-7B-Instruct, whose tokenizer vocabulary this project reuses as data and whose generated responses supervised Stage 2's fine-tuning. All architecture code, the training loop, and Stage 1's pretraining are original work.