Upload Tiny8MB chat model (3.87M params, RMSNorm+SwiGLU+GQA, 53.5s on 2x T4)
Browse files- README.md +24 -0
- bpe_4096.json +0 -0
- config.json +17 -0
- tiny_llm_8mb_chat.pt +3 -0
README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- text-generation
|
| 5 |
+
- tiny-llm
|
| 6 |
+
- from-scratch
|
| 7 |
+
- gqa
|
| 8 |
+
- swiglu
|
| 9 |
+
library_name: pytorch
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Tiny8MB Chat
|
| 13 |
+
|
| 14 |
+
A **3.87M-parameter** modern decoder-only Transformer (~9.85 MB `.pt` checkpoint in FP16), trained **from scratch** on 2x Tesla T4 GPUs in **53.5 seconds**.
|
| 15 |
+
|
| 16 |
+
## Architecture
|
| 17 |
+
* **Params:** 3,868,928 (weight-tied embeddings)
|
| 18 |
+
* **Design:** RMSNorm + SwiGLU + Grouped-Query Attention (8 Q heads / 2 KV heads) + RoPE
|
| 19 |
+
* **Layers / Dim:** 4 layers, `d_model=256`, `mlp_dim=704`, `block_size=192`
|
| 20 |
+
* **Tokenizer:** 4,096-token BPE (`bpe_4096.json`)
|
| 21 |
+
|
| 22 |
+
## Training Summary
|
| 23 |
+
* **Stage 1 (Mixed Pre-training):** 6.91M tokens (TinyStories + Alpaca Q&A), 480 steps in 30.7s (final loss `2.655`)
|
| 24 |
+
* **Stage 2 (Gentle SFT + Context Recall):** 11,358 examples, 350 steps in 21.0s (final loss `2.390`)
|
bpe_4096.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Tiny8MB"
|
| 4 |
+
],
|
| 5 |
+
"model_type": "tiny8mb",
|
| 6 |
+
"vocab_size": 4096,
|
| 7 |
+
"block_size": 192,
|
| 8 |
+
"d_model": 256,
|
| 9 |
+
"n_head": 8,
|
| 10 |
+
"n_kv_head": 2,
|
| 11 |
+
"n_layer": 4,
|
| 12 |
+
"mlp_dim": 704,
|
| 13 |
+
"norm": "RMSNorm",
|
| 14 |
+
"activation": "SwiGLU",
|
| 15 |
+
"positional": "RoPE",
|
| 16 |
+
"torch_dtype": "float16"
|
| 17 |
+
}
|
tiny_llm_8mb_chat.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f643d3c9646fcf41d8038f6bcd5c1fa8fdd2896dbd9b527710d4311436208909
|
| 3 |
+
size 9847728
|