File size: 815 Bytes
55dabcc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
license: mit
tags:
  - text-generation
  - tiny-llm
  - from-scratch
  - gqa
  - swiglu
library_name: pytorch
---

# Tiny8MB Chat

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**.

## Architecture
* **Params:** 3,868,928 (weight-tied embeddings)
* **Design:** RMSNorm + SwiGLU + Grouped-Query Attention (8 Q heads / 2 KV heads) + RoPE
* **Layers / Dim:** 4 layers, `d_model=256`, `mlp_dim=704`, `block_size=192`
* **Tokenizer:** 4,096-token BPE (`bpe_4096.json`)

## Training Summary
* **Stage 1 (Mixed Pre-training):** 6.91M tokens (TinyStories + Alpaca Q&A), 480 steps in 30.7s (final loss `2.655`)
* **Stage 2 (Gentle SFT + Context Recall):** 11,358 examples, 350 steps in 21.0s (final loss `2.390`)