MostLime commited on
Commit
f311b35
·
verified ·
1 Parent(s): de7d56b

Upload base_final

Browse files
README.md CHANGED
@@ -26,9 +26,7 @@ datasets:
26
 
27
  # loopmm base
28
 
29
- > **Mid-training checkpoint.** These weights come from step 5,000 of 8,869 (5.2B of the 9.3B tokens) of the training run. The final weights will replace them when the run ends, around 10:30 UTC on 23 November 2026.
30
-
31
- 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.3B tokens of text and image-text data.
32
 
33
  This repo holds the pretrained base model. It continues text and writes captions for images, but it does not follow instructions. A chat version will be published later today.
34
 
@@ -47,7 +45,7 @@ loopmm uses the LFM3 layer layout, but it is not a Liquid AI model. It contains
47
 
48
  ## Training data
49
 
50
- The model saw 9.3B 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.
51
 
52
  Text-only data:
53
  - Web: [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb) (English) and [DCLM baseline](https://huggingface.co/datasets/mlfoundations/dclm-baseline-1.0)
@@ -65,29 +63,30 @@ Image-text data:
65
 
66
  ## Training
67
 
68
- - 9.3B tokens, 2^20 (about 1M) tokens per step.
69
- - 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 15% of the tokens: 0.84B tokens at 4k on higher-quality data, 0.42B at 32k and 0.14B at 64k.
 
70
  - 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.
71
- - Hardware. One node of 8 B200 GPUs on Modal for about 2.5 hours.
72
 
73
  ## Results
74
 
75
- Validation loss at step 5,000 (3 loops): 2.896 on Ultra-FineWeb text. On DOCCI image descriptions it is 2.662 with the image and 2.804 without it, so the model uses the image. Benchmark results will be added here later today.
76
 
77
  ## Loop count
78
 
79
- The model was trained with 3 passes through the core, but it can run with any number. The table shows the validation loss at step 5,000 at each loop count. Text is 8,192 tokens of Ultra-FineWeb; captions are 8 DOCCI image descriptions, scored with and without their image.
80
 
81
  | loops | text | caption | caption, no image |
82
  |---|---|---|---|
83
- | 1 | 3.439 | 2.915 | 3.051 |
84
- | 2 | 3.170 | 2.802 | 2.931 |
85
- | 3 | 2.896 | 2.662 | 2.804 |
86
- | 4 | 2.953 | 2.695 | 2.837 |
87
- | 5 | 2.943 | 2.698 | 2.845 |
88
- | 6 | 2.964 | 2.700 | 2.850 |
89
 
90
- One pass costs 0.543 in text loss compared with 3. More passes than 3 make it worse (2.953 at 4 loops, 2.964 at 6). In the playground and the Mac app, the Loops slider sets this number.
91
 
92
  ![Validation loss at each loop count](assets/loops.png)
93
 
@@ -132,7 +131,7 @@ print(model.complete(tok, "The best way to learn a new language is", max_new_tok
132
 
133
  `model(input_ids)` returns logits for every position. Generation goes through `complete()` and `generate_from()`, which keep a cache, so each new token costs one step. `transformers`' own `generate()` is not supported. Put token id 1 (`<|startoftext|>`) before your text; `complete()` does this for you.
134
 
135
- The release code gives the same logits as the training code (largest difference 3e-05 in fp32, at 1, 2, 3, 4 and 6 loops).
136
 
137
  ### ONNX
138
 
@@ -143,15 +142,15 @@ The release code gives the same logits as the training code (largest difference
143
  - `core.onnx`: layers 6 to 17. Run it once per loop, and keep a separate cache for each loop.
144
  - `coda.onnx`: layers 18 to 23 and the output head
145
 
146
- `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.8118 with ONNX and 3.8118 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.
147
 
148
  ## Limitations
149
 
150
- - It is a small model, and it was trained on only 9.3B tokens. Its output often contains false facts and repeats itself.
151
  - It is a base model with no instruction tuning and no safety tuning.
152
  - Most of the training data is in English.
153
  - 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.
154
- - The model saw contexts longer than 4k tokens only at the end of training (0.56B tokens at 32k and 64k).
155
 
156
  ## Licenses
157
 
 
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 chat version will be published later today.
32
 
 
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
 
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
+ Validation loss of the final weights (3 loops): 2.859 on Ultra-FineWeb text. On DOCCI image descriptions it is 2.267 with the image and 2.568 without it, so the model uses the image. Benchmark results will be added here later today.
75
 
76
  ## Loop count
77
 
78
+ The model was trained with 3 passes through the core, but it can run with any number. The table shows the validation loss of the final weights at each loop count. Text is 8,192 tokens of Ultra-FineWeb; captions are 8 DOCCI image descriptions, scored with and without their image.
79
 
80
  | loops | text | caption | caption, no image |
81
  |---|---|---|---|
82
+ | 1 | 3.440 | 2.700 | 2.940 |
83
+ | 2 | 3.171 | 2.467 | 2.750 |
84
+ | 3 | 2.859 | 2.267 | 2.568 |
85
+ | 4 | 2.932 | 2.305 | 2.602 |
86
+ | 5 | 2.937 | 2.333 | 2.625 |
87
+ | 6 | 2.984 | 2.348 | 2.635 |
88
 
89
+ 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). In the playground and the Mac app, the Loops slider sets this number.
90
 
91
  ![Validation loss at each loop count](assets/loops.png)
92
 
 
131
 
132
  `model(input_ids)` returns logits for every position. Generation goes through `complete()` and `generate_from()`, which keep a cache, so each new token costs one step. `transformers`' own `generate()` is not supported. Put token id 1 (`<|startoftext|>`) before your text; `complete()` does this for you.
133
 
134
+ The release code gives the same logits as the training code (largest difference 1e-04 in fp32, at 1, 2, 3, 4 and 6 loops).
135
 
136
  ### ONNX
137
 
 
142
  - `core.onnx`: layers 6 to 17. Run it once per loop, and keep a separate cache for each loop.
143
  - `coda.onnx`: layers 18 to 23 and the output head
144
 
145
+ `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.
146
 
147
  ## Limitations
148
 
149
+ - It is a small model, and it was trained on only 8.74B tokens. Its output often contains false facts and repeats itself.
150
  - It is a base model with no instruction tuning and no safety tuning.
151
  - Most of the training data is in English.
152
  - 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.
153
+ - It was trained only on sequences of up to 4,096 tokens. Longer inputs are not tested.
154
 
155
  ## Licenses
156
 
assets/loops.png CHANGED
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e094ca6d85180d014534cff56263bfd84927009ab1cfffb95338119ee4ae56fc
3
  size 754789964
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:944a76d9aad2f8964a10c40b7508792c60091559dc7c158dcad061f3ff4cbf2b
3
  size 754789964
onnx/coda.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:99621f2e8e7c247d2ff0aba54b8d70c4cd97d1d2e461e7fb0dba099f0cff9b47
3
  size 156196840
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6322c7dc586f2f80b7be59623bfec63e6595826d428267049354126a8a383118
3
  size 156196840
onnx/core.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a8b463c6a776dd596d42531d447967a2857b384bd19be4fe8aa5ff2b5ba2d141
3
  size 144792550
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39a3435e19df286ba3bea49ddc0bf389399096348c30081cd998a6c4da9d2cd7
3
  size 144792550
onnx/prelude.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8e54f2bec501e72f304d3f125bca70369d929c5f72ff9a61022266f8f1125c28
3
  size 157345160
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7e268514d398bbe88fd5ab3d3a85da43e88af37710b0b6881771ccf379646da
3
  size 157345160
onnx/stem.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:546b4a31d6b717b8da30ad049e0a9d54f13f07c050b42607b7a86b99078e821a
3
  size 8865118
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:237404eebd7882f29162af941272b465e55a58ef702492d78ffef218de3fc754
3
  size 8865118