Shiv-22 commited on
Commit
0e65760
Β·
verified Β·
1 Parent(s): d06b298

update card: fix HF paths, prune-stale text, add hybrid ablation + 61.2 winner

Browse files
Files changed (1) hide show
  1. README.md +70 -26
README.md CHANGED
@@ -39,27 +39,56 @@ novel architecture.
39
 
40
  ## What's in this repo
41
 
42
- Six training runs, each in its own folder. Within a folder you'll find periodic
43
- snapshots `step_<N>.ckpt` (every 5000 steps; every 3000 for the 50M run) and
44
- `last.ckpt` (the final-step weights). These are **PyTorch Lightning
45
- checkpoints** from the MDLM codebase β€” they bundle model weights *and* EMA
46
- shadow parameters (EMA decay 0.9999), optimizer state, and config. They are
47
- **not** `transformers`-loadable via `from_pretrained`; load them with the
48
- training repo (see *How to use* below).
49
-
50
- | Folder | Backbone | Params | LR | Steps | Tokens | Val PPL ↓ |
 
 
51
  |--------|----------|:------:|:--:|:-----:|:------:|:---------:|
52
- | `runB_transformer_130m` | Transformer (DiT) | \~130M | 3e-4 | 76k | \~5B | **70.5** |
53
- | `runD_130m_seed1` | BiMamba-2 (SSM) | \~130M | 3e-4 | 76k | \~5B | 85.9 |
54
- | `runD_130m_seed2` | BiMamba-2 (SSM) | \~130M | 3e-4 | 76k | \~5B | 83.5 |
55
- | `runD_130m_lr1e3_seed1` | BiMamba-2 (SSM) | \~130M | **1e-3** | 76k | \~5B | **79.3** |
56
- | `scaling_100m` | BiMamba-2 (SSM) | \~100M | 3e-4 | 60k* | \~4B | 97.5 |
57
- | `scaling_50m` | BiMamba-2 (SSM) | \~50M | 3e-4 | 30k | \~2B | 136.3 |
58
 
59
  Val PPL = MDLM ELBO-bound validation perplexity on the OpenWebText validation
60
- split, measured on each run's **best EMA checkpoint** (lower is better).
61
- `*` the 100M run's valid final checkpoint is `step_60000`/`last.ckpt`
62
- (see the GitHub report for why 61k looped).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
  ### Results at a glance
65
 
@@ -67,7 +96,7 @@ split, measured on each run's **best EMA checkpoint** (lower is better).
67
  tokens, the Transformer denoiser (70.5) is modestly but consistently stronger
68
  than pure BiMamba-2. BiMamba prefers a **\~3.3Γ— higher learning rate**; a
69
  50M LR sweep found `1e-3` best, and retraining 130M at `1e-3` (the
70
- `runD_130m_lr1e3_seed1` checkpoints) closes **\~43%** of the gap (85.9 β†’ 79.3)
71
  but does not close it.
72
  - **Scaling** (BiMamba, lr 3e-4): 50M β†’ 136.3, 100M β†’ 97.5, 130M β†’ 84.7 β€”
73
  clean, monotonic, seed-stable (Ξ”β‰ˆ2.4 between seeds).
@@ -77,6 +106,19 @@ split, measured on each run's **best EMA checkpoint** (lower is better).
77
  - **Honest finding:** *pure* BiMamba-2 trades quality for long-context
78
  throughput β€” consistent with DiffuApriel, where a *hybrid* Mamba+attention
79
  model is what recovers quality.
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
  Full numbers, caveats, and the LR-fairness analysis are in the
82
  [technical report on GitHub](https://github.com/shivnarainms22/DiffMamba/blob/master/DiffMamba_Report.md).
@@ -113,24 +155,26 @@ git clone https://github.com/shivnarainms22/DiffMamba
113
  cd DiffMamba
114
  # set up the environment (see requirements.yaml / scripts/)
115
 
116
- # download a checkpoint, e.g. the LR-tuned BiMamba-130M
 
117
  huggingface-cli download Shiv-22/diffmamba-checkpoints \
118
- runD_130m_lr1e3_seed1/last.ckpt --local-dir ./ckpts
119
 
120
  # validation perplexity (EMA), matching the table above
121
  python main.py mode=ppl_eval +experiment=runD_130m \
122
- eval.checkpoint_path=./ckpts/runD_130m_lr1e3_seed1/last.ckpt \
123
  data.cache_dir=<path>/data loader.eval_batch_size=32
124
 
125
  # generate samples
126
  python main.py mode=sample_eval +experiment=runD_130m \
127
- eval.checkpoint_path=./ckpts/runD_130m_lr1e3_seed1/last.ckpt \
128
  loader.eval_batch_size=4
129
  ```
130
 
131
- Use the matching `+experiment=` for each folder: `runD_130m` (BiMamba-130M and
132
- its LR-tuned variant), `runB_transformer_130m` (DiT-130M), `scaling_100m`,
133
- `scaling_50m`.
 
134
 
135
  ## Limitations
136
 
 
39
 
40
  ## What's in this repo
41
 
42
+ Each training run lives under `runs/<name>/checkpoints/` and holds two files:
43
+ `best.ckpt` (lowest validation loss β€” the weights the PPL table below reports)
44
+ and `last.ckpt` (final-step weights, for resuming). Periodic `step=<N>.ckpt`
45
+ snapshots are written during training but pruned from this repo to save space,
46
+ so only `best`/`last` are hosted. These are **PyTorch Lightning checkpoints**
47
+ from the MDLM codebase β€” they bundle model weights *and* EMA shadow parameters
48
+ (EMA decay 0.9999), optimizer state, and config. They are **not**
49
+ `transformers`-loadable via `from_pretrained`; load them with the training repo
50
+ (see *How to use* below).
51
+
52
+ | HF path `runs/…` | Backbone | Params | LR | Steps | Tokens | Val PPL ↓ |
53
  |--------|----------|:------:|:--:|:-----:|:------:|:---------:|
54
+ | `runB` | Transformer (DiT) | \~130M | 3e-4 | 76k | \~5B | **70.5** |
55
+ | `runD1` | BiMamba-2 (SSM) | \~130M | 3e-4 | 76k | \~5B | 85.9 |
56
+ | `runD2` | BiMamba-2 (SSM) | \~130M | 3e-4 | 76k | \~5B | 83.5 |
57
+ | `runD_lr1e3` | BiMamba-2 (SSM) | \~130M | **1e-3** | 76k | \~5B | **79.3** |
58
+ | `s100` | BiMamba-2 (SSM) | \~100M | 3e-4 | 60k* | \~4B | 97.5 |
59
+ | `s50` | BiMamba-2 (SSM) | \~50M | 3e-4 | 30k | \~2B | 136.3 |
60
 
61
  Val PPL = MDLM ELBO-bound validation perplexity on the OpenWebText validation
62
+ split, measured on each run's **`best.ckpt`** (EMA weights; lower is better).
63
+ `*` the 100M run's valid final checkpoint is `last.ckpt` at step 60000
64
+ (see the GitHub report for why 61k looped). Also hosted (report Β§6.5 LR sweep,
65
+ not shown above): `s50_lr5e4`, `s50_lr1e3`, `s50_lr2e3` β€” the 50M learning-rate
66
+ sweep.
67
+
68
+ ### Hybrid Mamba+attention checkpoints (attention-layout ablation)
69
+
70
+ The hybrid backbone inserts full bidirectional attention among the Mamba blocks.
71
+ These runs ablate **how many** attention layers and **where**, then over-train
72
+ the winner. All share the 130M / OpenWebText / lr-3e-4 recipe and differ only in
73
+ the attention layout. Val PPL is on each run's final-step `last.ckpt`, matching
74
+ report Β§11.5 (grid at 76k; the winner over-trained to 150k).
75
+
76
+ | HF path `runs/…` | Attention layers | # | Steps | Val PPL ↓ | `+experiment=` |
77
+ |--------|--------|:--:|:--:|:--:|--------|
78
+ | `hybrid_130m` | `[3,7,11]` | 3 | 76k | 69.5 | `hybrid_130m` |
79
+ | **`hyb_e3`** | `[2,5,8,11]` | 4 | **150k** | **60.9** ← best | `hyb_e3` |
80
+ | `hyb_e3_s2` | `[2,5,8,11]` | 4 | 150k | 61.5 (seed 2) | `hyb_e3` |
81
+ | `hyb_e6` | `[5,11]` | 2 | 76k | 71.4 | `hyb_e6` |
82
+ | `hyb_e12` | `[11]` | 1 | 76k | 75.7 | `hyb_e12` |
83
+ | `hyb_early` | `[0,1,2]` | 3 | 76k | 80.8 | `hyb_early` |
84
+ | `hyb_mid` | `[4,5,6]` | 3 | 76k | 73.9 | `hyb_mid` |
85
+ | `hyb_late` | `[9,10,11]` | 3 | 76k | 73.0 | `hyb_late` |
86
+
87
+ At matched 76k, more attention lowers PPL (4 β†’ 68.1, 3 β†’ 69.5, 2 β†’ 71.4, 1 β†’ 75.7)
88
+ and **placement matters more than count** β€” distributed `[3,7,11]` (69.5) beats
89
+ every clustered layout, and clustering early is catastrophic (80.8). The winner
90
+ `hyb_e3` (`[2,5,8,11]`) over-trained to 150k reaches **61.2 mean Β±0.3** (seeds
91
+ 60.9 / 61.5) β€” the best quality in this study, at ~2Γ— the 76k compute.
92
 
93
  ### Results at a glance
94
 
 
96
  tokens, the Transformer denoiser (70.5) is modestly but consistently stronger
97
  than pure BiMamba-2. BiMamba prefers a **\~3.3Γ— higher learning rate**; a
98
  50M LR sweep found `1e-3` best, and retraining 130M at `1e-3` (the
99
+ `runD_lr1e3` checkpoints) closes **\~43%** of the gap (85.9 β†’ 79.3)
100
  but does not close it.
101
  - **Scaling** (BiMamba, lr 3e-4): 50M β†’ 136.3, 100M β†’ 97.5, 130M β†’ 84.7 β€”
102
  clean, monotonic, seed-stable (Ξ”β‰ˆ2.4 between seeds).
 
106
  - **Honest finding:** *pure* BiMamba-2 trades quality for long-context
107
  throughput β€” consistent with DiffuApriel, where a *hybrid* Mamba+attention
108
  model is what recovers quality.
109
+ - **Hybrid backbone + attention ablation (best quality here).** Inserting sparse
110
+ bidirectional attention recovers DiT-class quality: at matched 130M / 76k /
111
+ lr 3e-4, **3 of 12 layers as attention** (`hybrid_130m`, `[3,7,11]`) reaches
112
+ **69.5** β€” matching the DiT (70.5). An attention-layout ablation (grid runs
113
+ `hyb_e3`/`hyb_e6`/`hyb_e12`/`hyb_early`, all hosted here at 76k) shows
114
+ **placement matters more than count**: distribute attention through depth
115
+ (clustering it early is catastrophic, 80.8), and **4 evenly-spread layers**
116
+ (`hyb_e3`, `[2,5,8,11]`) is best (68.1 at 76k). Over-training that winner to
117
+ 150k steps reaches **61.2** val PPL (2-seed mean Β±0.3) β€” the strongest result
118
+ here, though at ~2Γ— the compute of the matched table above (not a
119
+ matched-compute claim vs the 70.5 DiT). All hybrid checkpoints are hosted (see
120
+ the table above); full grid + over-train detail:
121
+ [report Β§11.5](https://github.com/shivnarainms22/DiffMamba/blob/master/DiffMamba_VLM_Report.md).
122
 
123
  Full numbers, caveats, and the LR-fairness analysis are in the
124
  [technical report on GitHub](https://github.com/shivnarainms22/DiffMamba/blob/master/DiffMamba_Report.md).
 
155
  cd DiffMamba
156
  # set up the environment (see requirements.yaml / scripts/)
157
 
158
+ # download a checkpoint, e.g. the LR-tuned BiMamba-130M (best.ckpt reproduces
159
+ # the table PPL; --local-dir preserves the runs/…/checkpoints/ path)
160
  huggingface-cli download Shiv-22/diffmamba-checkpoints \
161
+ runs/runD_lr1e3/checkpoints/best.ckpt --local-dir ./ckpts
162
 
163
  # validation perplexity (EMA), matching the table above
164
  python main.py mode=ppl_eval +experiment=runD_130m \
165
+ eval.checkpoint_path=./ckpts/runs/runD_lr1e3/checkpoints/best.ckpt \
166
  data.cache_dir=<path>/data loader.eval_batch_size=32
167
 
168
  # generate samples
169
  python main.py mode=sample_eval +experiment=runD_130m \
170
+ eval.checkpoint_path=./ckpts/runs/runD_lr1e3/checkpoints/best.ckpt \
171
  loader.eval_batch_size=4
172
  ```
173
 
174
+ Use the matching `+experiment=` for each run: `runD_130m` (BiMamba-130M `runD1`/
175
+ `runD2` and the LR-tuned `runD_lr1e3`), `runB_transformer_130m` (DiT `runB`),
176
+ `scaling_100m` (`s100`), `scaling_50m` (`s50`). For the hybrid runs use
177
+ `hybrid_130m` / `hyb_e3` / `hyb_e6` / `hyb_e12` (see below).
178
 
179
  ## Limitations
180