Upload base_32k
Browse filesFiles changed (7)
- README.md+17-15
- assets/loops.png
- model.safetensors+1-1
- onnx/coda.onnx+1-1
- onnx/core.onnx+1-1
- onnx/prelude.onnx+1-1
- onnx/stem.onnx+1-1
25 unmodified lines262728292930313212 unmodified lines454647484849505111 unmodified lines6364656667686667686970717273747576777824 unmodified lines10310410510410510610710810910610710810911011111211111311411511653 unmodified lines17017117217117317417517617517717817918017918118218318425 unmodified lines
# loopmm base
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.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.
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.
12 unmodified lines
## Training data
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.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.
Text-only data:- Web: [Ultra-FineWeb](https://huggingface.co/datasets/openbmb/Ultra-FineWeb) (English) and [DCLM baseline](https://huggingface.co/datasets/mlfoundations/dclm-baseline-1.0)11 unmodified lines
## Training
- 8.74B tokens, 2^20 (about 1M) tokens per step.- 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.- 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).- 9.16B tokens, 2^20 (about 1M) tokens per step.- 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).- A 64k phase was planned at the end. Training crashed at that length, so it was dropped.- 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.- Hardware. One node of 8 B200 GPUs on Modal, for about 2 hours of training.
## Results
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.
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).
| task | loopmm, 3 loops | loopmm, 1 loop | GPT-2 (124M) | GPT-2 Medium (355M) | Pythia-160M at 10.5B tokens |24 unmodified lines
| loops | text | caption | caption, no image ||---|---|---|---|| 1 | 3.440 | 2.700 | 2.940 || 2 | 3.171 | 2.467 | 2.750 || 3 | 2.859 | 2.267 | 2.568 || 4 | 2.932 | 2.305 | 2.602 || 5 | 2.937 | 2.333 | 2.625 || 6 | 2.984 | 2.348 | 2.635 || 1 | 3.437 | 2.708 | 2.958 || 2 | 3.166 | 2.476 | 2.763 || 3 | 2.861 | 2.280 | 2.586 || 4 | 2.934 | 2.316 | 2.613 || 5 | 2.949 | 2.344 | 2.635 || 6 | 2.997 | 2.361 | 2.648 |
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.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.

53 unmodified lines- `core.onnx`: layers 6 to 17. Run it once per loop, and keep a separate cache for each loop.- `coda.onnx`: layers 18 to 23 and the output head
`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.`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.
## Limitations
- It is a small model, and it was trained on only 8.74B tokens. Its output often contains false facts and repeats itself.- It is a small model, and it was trained on only 9.16B tokens. Its output often contains false facts and repeats itself.- It is a base model with no instruction tuning and no safety tuning.- Most of the training data is in English.- 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.- It was trained only on sequences of up to 4,096 tokens. Longer inputs are not tested.- 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.
## Licenses
1223version https://git-lfs.github.com/spec/v1oid sha256:944a76d9aad2f8964a10c40b7508792c60091559dc7c158dcad061f3ff4cbf2boid sha256:5ae7e05a95d231fd500cfe07b98a59217cac23549baea36b70eb6b1963a7b0fbsize 7547899641223version https://git-lfs.github.com/spec/v1oid sha256:6322c7dc586f2f80b7be59623bfec63e6595826d428267049354126a8a383118oid sha256:25cb2b2a7495ecfcfb7b0d71858a275d3642bda89dec8b199c3ad33f15640e7asize 1561968401223version https://git-lfs.github.com/spec/v1oid sha256:39a3435e19df286ba3bea49ddc0bf389399096348c30081cd998a6c4da9d2cd7oid sha256:4fb1200d246df78dceca5340f5855e69cd0b87db34d0c4875069650b3cc867a5size 1447925501223version https://git-lfs.github.com/spec/v1oid sha256:b7e268514d398bbe88fd5ab3d3a85da43e88af37710b0b6881771ccf379646daoid sha256:fb0f60d65b6949f27bcbd0eab42e1908833e3923a8899c04b11978354ed46daesize 1573451601223version https://git-lfs.github.com/spec/v1oid sha256:237404eebd7882f29162af941272b465e55a58ef702492d78ffef218de3fc754oid sha256:c70406cb3ffdecab8b3e7f732dcb8a147bc3508977979cc227b9089bdc102e20size 8865118README.md+17-15
assets/loops.png


model.safetensors+1-1
onnx/coda.onnx+1-1
onnx/core.onnx+1-1
onnx/prelude.onnx+1-1
onnx/stem.onnx+1-1