MostLime commited on
Commit
4a3e8ea
·
verified ·
1 Parent(s): 7e85d24

Upload base_32k

Browse files
README.md CHANGED
@@ -26,7 +26,7 @@ datasets:
26
 
27
  # loopmm base
28
 
29
- loopmm is a small language model that takes images and text as input. It has 189M parameters. Its 12 middle layers run three times for each token. It was trained from scratch on 8.74B tokens of text and image-text data.
30
 
31
  This repo holds the pretrained base model. It continues text and writes captions for images, but it does not follow instructions. A post-trained chat version is pending.
32
 
@@ -45,7 +45,7 @@ loopmm uses the LFM3 layer layout, but it is not a Liquid AI model. It contains
45
 
46
  ## Training data
47
 
48
- The model saw 8.74B tokens. About half of them come from text-only documents and half from documents with images. About a quarter of all tokens are image patches. The loss is computed on text tokens only.
49
 
50
  Text-only data:
51
  - Web: [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb) (English) and [DCLM baseline](https://huggingface.co/datasets/mlfoundations/dclm-baseline-1.0)
@@ -63,14 +63,16 @@ Image-text data:
63
 
64
  ## Training
65
 
66
- - 8.74B tokens, 2^20 (about 1M) tokens per step.
67
- - Phases. 7.9B tokens at a context of 4,096 with a flat learning rate, after a 1,000-step warmup. Then 0.84B tokens at 4k on higher-quality data, while the learning rate decays from 2e-3 to 4.7e-4.
68
- - The plan had two more phases, 0.42B tokens at 32k and 0.14B at 64k, in which the learning rate would reach 0. The run hit its budget limit after a crash at the start of the 32k phase, so these weights are the checkpoint from the end of the 4k phases (step 8,337).
69
  - Optimizer. Muon for the matrices inside the layers, and AdamW for the embedding, the image stem, the norms, the conv kernels, the AttnRes queries and the gate. Peak learning rate 2e-3, weight decay 0.1, gradient clipping at 1.0, bf16.
70
  - Hardware. One node of 8 B200 GPUs on Modal, for about 2 hours of training.
71
 
72
  ## Results
73
 
 
 
74
  Zero-shot, with lm-evaluation-harness. Every model was scored with the same harness and the same prompts. The numbers are accuracy in %, except WikiText, which is bits per byte (lower is better).
75
 
76
  | task | loopmm, 3 loops | loopmm, 1 loop | GPT-2 (124M) | GPT-2 Medium (355M) | Pythia-160M at 10.5B tokens |
@@ -101,14 +103,14 @@ The model was trained with 3 passes through the core, but it can run with any nu
101
 
102
  | loops | text | caption | caption, no image |
103
  |---|---|---|---|
104
- | 1 | 3.440 | 2.700 | 2.940 |
105
- | 2 | 3.171 | 2.467 | 2.750 |
106
- | 3 | 2.859 | 2.267 | 2.568 |
107
- | 4 | 2.932 | 2.305 | 2.602 |
108
- | 5 | 2.937 | 2.333 | 2.625 |
109
- | 6 | 2.984 | 2.348 | 2.635 |
110
 
111
- One pass costs 0.580 in text loss compared with 3. More passes than 3 make it worse (2.932 at 4 loops, 2.984 at 6). On the benchmarks above, going from 1 loop to 3 raises the mean accuracy from 41.7% to 45.4%, and 3 loops are better on 16 of the 20 tasks. At 4 loops the mean is 45.3%, about the same as at 3. The gap between 1 and 3 loops grew during training, from 0.04 at 0.5B tokens to about 0.5 at the end (held-out loss over all text sources). In the playground and the Mac app, the Loops slider sets this number.
112
 
113
  ![Validation loss at each loop count](assets/loops.png)
114
 
@@ -168,15 +170,15 @@ The release code gives the same logits as the training code (largest difference
168
  - `core.onnx`: layers 6 to 17. Run it once per loop, and keep a separate cache for each loop.
169
  - `coda.onnx`: layers 18 to 23 and the output head
170
 
171
- `onnx/meta.json` lists the inputs of each graph. The `engine.js` file of the Space shows how to call them. The weights are stored in fp16 and computed in fp32, so the ONNX graphs give the same results as PyTorch: on validation text the loss is 3.7255 with ONNX and 3.7255 with PyTorch. The four files take 467 MB. Dynamic int8 quantization was tried first; on some checkpoints it raised the loss by up to 0.17, so it is not used.
172
 
173
  ## Limitations
174
 
175
- - It is a small model, and it was trained on only 8.74B tokens. Its output often contains false facts and repeats itself.
176
  - It is a base model with no instruction tuning and no safety tuning.
177
  - Most of the training data is in English.
178
  - Its image skills are basic. Its captions name the main content of a photo, but they often get details, counts and text in the image wrong.
179
- - It was trained only on sequences of up to 4,096 tokens. Longer inputs are not tested.
180
 
181
  ## Licenses
182
 
 
26
 
27
  # loopmm base
28
 
29
+ loopmm is a small language model that takes images and text as input. It has 189M parameters. Its 12 middle layers run three times for each token. It was trained from scratch on 9.16B tokens of text and image-text data.
30
 
31
  This repo holds the pretrained base model. It continues text and writes captions for images, but it does not follow instructions. A post-trained chat version is pending.
32
 
 
45
 
46
  ## Training data
47
 
48
+ The model saw 9.16B tokens. About half of them come from text-only documents and half from documents with images. About a quarter of all tokens are image patches. The loss is computed on text tokens only.
49
 
50
  Text-only data:
51
  - Web: [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb) (English) and [DCLM baseline](https://huggingface.co/datasets/mlfoundations/dclm-baseline-1.0)
 
63
 
64
  ## Training
65
 
66
+ - 9.16B tokens, 2^20 (about 1M) tokens per step.
67
+ - Phases. 7.9B tokens at a context of 4,096 with a flat learning rate, after a 1,000-step warmup. Then the learning rate decays to 0 over the last 1.26B tokens: 0.84B tokens at 4k on higher-quality data, then 0.42B tokens at a context of 32,768 on long documents (step 8,736).
68
+ - A 64k phase was planned at the end. Training crashed at that length, so it was dropped.
69
  - Optimizer. Muon for the matrices inside the layers, and AdamW for the embedding, the image stem, the norms, the conv kernels, the AttnRes queries and the gate. Peak learning rate 2e-3, weight decay 0.1, gradient clipping at 1.0, bf16.
70
  - Hardware. One node of 8 B200 GPUs on Modal, for about 2 hours of training.
71
 
72
  ## Results
73
 
74
+ The benchmarks below are from the checkpoint at the end of the 4k phases (step 8,337, 8.74B tokens), before the 32k phase. The released weights are the final checkpoint (step 8,736), which adds the 32k phase and the end of the learning-rate decay. Its held-out loss at 3 loops, on the 4k validation sets used during training, is 2.809 on Ultra-FineWeb, 3.276 on DCLM, 1.261 on Stack-Edu code and 2.390 on FineWiki.
75
+
76
  Zero-shot, with lm-evaluation-harness. Every model was scored with the same harness and the same prompts. The numbers are accuracy in %, except WikiText, which is bits per byte (lower is better).
77
 
78
  | task | loopmm, 3 loops | loopmm, 1 loop | GPT-2 (124M) | GPT-2 Medium (355M) | Pythia-160M at 10.5B tokens |
 
103
 
104
  | loops | text | caption | caption, no image |
105
  |---|---|---|---|
106
+ | 1 | 3.437 | 2.708 | 2.958 |
107
+ | 2 | 3.166 | 2.476 | 2.763 |
108
+ | 3 | 2.861 | 2.280 | 2.586 |
109
+ | 4 | 2.934 | 2.316 | 2.613 |
110
+ | 5 | 2.949 | 2.344 | 2.635 |
111
+ | 6 | 2.997 | 2.361 | 2.648 |
112
 
113
+ One pass costs 0.576 in text loss compared with 3. More passes than 3 make it worse (2.934 at 4 loops, 2.997 at 6). On the benchmarks above (step 8,337), going from 1 loop to 3 raises the mean accuracy from 41.7% to 45.4%, and 3 loops are better on 16 of the 20 tasks. At 4 loops the mean is 45.3%, about the same as at 3. The gap between 1 and 3 loops grew during training, from 0.04 at 0.5B tokens to about 0.5 at step 8,337 (held-out loss over all text sources). In the playground and the Mac app, the Loops slider sets this number.
114
 
115
  ![Validation loss at each loop count](assets/loops.png)
116
 
 
170
  - `core.onnx`: layers 6 to 17. Run it once per loop, and keep a separate cache for each loop.
171
  - `coda.onnx`: layers 18 to 23 and the output head
172
 
173
+ `onnx/meta.json` lists the inputs of each graph. The `engine.js` file of the Space shows how to call them. The weights are stored in fp16 and computed in fp32, so the ONNX graphs give the same results as PyTorch: on validation text the loss is 3.7228 with ONNX and 3.7229 with PyTorch. The four files take 467 MB. Dynamic int8 quantization was tried first; on some checkpoints it raised the loss by up to 0.17, so it is not used.
174
 
175
  ## Limitations
176
 
177
+ - It is a small model, and it was trained on only 9.16B tokens. Its output often contains false facts and repeats itself.
178
  - It is a base model with no instruction tuning and no safety tuning.
179
  - Most of the training data is in English.
180
  - Its image skills are basic. Its captions name the main content of a photo, but they often get details, counts and text in the image wrong.
181
+ - It saw sequences longer than 4,096 tokens only in the last 0.42B tokens of training, at up to 32,768 tokens. It was never trained on inputs longer than 32k.
182
 
183
  ## Licenses
184
 
assets/loops.png CHANGED
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:944a76d9aad2f8964a10c40b7508792c60091559dc7c158dcad061f3ff4cbf2b
3
  size 754789964
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5ae7e05a95d231fd500cfe07b98a59217cac23549baea36b70eb6b1963a7b0fb
3
  size 754789964
onnx/coda.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6322c7dc586f2f80b7be59623bfec63e6595826d428267049354126a8a383118
3
  size 156196840
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25cb2b2a7495ecfcfb7b0d71858a275d3642bda89dec8b199c3ad33f15640e7a
3
  size 156196840
onnx/core.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:39a3435e19df286ba3bea49ddc0bf389399096348c30081cd998a6c4da9d2cd7
3
  size 144792550
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4fb1200d246df78dceca5340f5855e69cd0b87db34d0c4875069650b3cc867a5
3
  size 144792550
onnx/prelude.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b7e268514d398bbe88fd5ab3d3a85da43e88af37710b0b6881771ccf379646da
3
  size 157345160
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb0f60d65b6949f27bcbd0eab42e1908833e3923a8899c04b11978354ed46dae
3
  size 157345160
onnx/stem.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:237404eebd7882f29162af941272b465e55a58ef702492d78ffef218de3fc754
3
  size 8865118
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c70406cb3ffdecab8b3e7f732dcb8a147bc3508977979cc227b9089bdc102e20
3
  size 8865118