Update README for 350M PG-19 byte-level SEDD checkpoint
Browse files
README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- discrete-diffusion
|
| 5 |
+
- text-generation
|
| 6 |
+
- byte-level
|
| 7 |
+
- sedd
|
| 8 |
+
datasets:
|
| 9 |
+
- pg19
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# GPT Diffusion (SEDD) — 350M, PG-19 Byte-Level
|
| 13 |
+
|
| 14 |
+
A **350M parameter discrete diffusion transformer** trained on raw UTF-8 bytes from [PG-19](https://github.com/google-deepmind/pg19) (Project Gutenberg books), using the **Score Entropy Discrete Diffusion (SEDD)** framework with a nanoGPT-style architecture.
|
| 15 |
+
|
| 16 |
+
## Model Details
|
| 17 |
+
|
| 18 |
+
| Parameter | Value |
|
| 19 |
+
|-----------|-------|
|
| 20 |
+
| Parameters | ~355M |
|
| 21 |
+
| Architecture | Transformer (DDiT) with adaptive LayerNorm |
|
| 22 |
+
| Layers | 25 |
|
| 23 |
+
| Heads | 16 |
|
| 24 |
+
| Embedding dim | 1024 |
|
| 25 |
+
| Conditioning dim | 256 |
|
| 26 |
+
| Context length | 8192 bytes |
|
| 27 |
+
| Vocab size | 256 (raw bytes) |
|
| 28 |
+
| Activation | SwiGLU |
|
| 29 |
+
| Position embedding | RoPE |
|
| 30 |
+
| Normalization | RMSNorm |
|
| 31 |
+
| Training steps | 5,000 |
|
| 32 |
+
| Noise schedule | Geometric |
|
| 33 |
+
|
| 34 |
+
## Checkpoint Contents
|
| 35 |
+
|
| 36 |
+
The `.pth` file contains:
|
| 37 |
+
|
| 38 |
+
- `model` — main model state dict
|
| 39 |
+
- `ema_model` — exponential moving average weights
|
| 40 |
+
- `optimizer` — AdamW optimizer state
|
| 41 |
+
- `adamw_optimizer` — secondary optimizer state
|
| 42 |
+
- `step` — training step (5000)
|
| 43 |
+
- `config` — model config dict
|
| 44 |
+
- `chunk_idx` — data chunk index for resuming
|
| 45 |
+
|
| 46 |
+
## Usage
|
| 47 |
+
|
| 48 |
+
```python
|
| 49 |
+
import torch
|
| 50 |
+
from model import GPT, GPTConfig
|
| 51 |
+
|
| 52 |
+
ckpt = torch.load("pg19_step_5000.pth", map_location="cpu")
|
| 53 |
+
config = GPTConfig(**ckpt["config"])
|
| 54 |
+
model = GPT(config)
|
| 55 |
+
model.load_state_dict(ckpt["ema_model"]) # use EMA weights for best quality
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Training
|
| 59 |
+
|
| 60 |
+
Trained with the `train_pg19.py` script:
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
torchrun --nproc_per_node=2 train_pg19.py
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
Effective batch size: micro_batch=4 × grad_accum=4 × 8192 context = ~131K tokens/step.
|
| 67 |
+
|
| 68 |
+
## License
|
| 69 |
+
|
| 70 |
+
MIT
|