loopmm-sft-v2 / README.md
MostLime's picture
Upload sft_v2
e33fdea verified
|
Raw History Blame Contribute Delete
3.79 kB
---
license: cc-by-nc-4.0
language:
- en
pipeline_tag: image-text-to-text
library_name: pytorch
base_model: MostLime/loopmm-base
tags:
- looped
- multimodal
- chat
- reasoning
- onnx
- small-model
- preview
---
# loopmm SFT v2
> **Preview.** This is the second supervised fine-tuning (SFT) run of the loopmm chat model. It has had no reinforcement learning and no antidoom training yet. Expect mistakes and some repetition.
loopmm is a small model that takes images and text as input. It has 189M parameters. Its 12 middle layers run three times for each token. This version answers in a chat. Before each answer, it writes its thinking in a `<think>` block, and it decides for itself how long to think.
**Try it:** [the playground Space](https://huggingface.co/spaces/MostLime/loopmm-playground). Pick "Chat: SFT v2" in the Model menu. It runs in your browser.
It was fine-tuned from [MostLime/loopmm-base](https://huggingface.co/MostLime/loopmm-base). The base card covers the architecture, the pretraining data and the evals. loopmm uses the LFM3 layer layout, but it is not a Liquid AI model.
## What changed since the first preview
The first preview is [MostLime/loopmm-sft-preview](https://huggingface.co/MostLime/loopmm-sft-preview). This run adds data in three places:
- 952 greetings and simple questions, each seen twice, so that a short message gets a short answer.
- 4,200 multi-turn conversations of 2 to 4 turns, each seen twice. In 1,483 of them, the user points out a planted mistake and the model has to correct it.
- Fewer questions about loopmm itself (247).
## Fine-tuning
- 3 epochs, 237 steps. The validation loss went from 2.42 to 1.49.
- A teacher model (Qwen3.6-35B-A3B) wrote the replies in loopmm's own voice. The prompts come from SmolTalk, Nemotron instruction-following chat, GSM8K, MATH, OpenMathInstruct-2, DOCCI and FineVision (LNQA, TextVQA, CoSyn charts and tables).
- Every reply starts with a `<think>` block. The loss is on the last assistant reply of each conversation.
## Chat format
```
<|startoftext|><|im_start|>user
{image}{text}<|im_end|>
<|im_start|>assistant
{earlier reply, without its think block}<|im_end|>
<|im_start|>user
{text}<|im_end|>
<|im_start|>assistant
<think>
{thinking}
</think>
{reply}<|im_end|>
```
- An image goes right after `user\n`.
- Earlier assistant turns in the history carry only the reply. Drop their think blocks, as in training. The Space does this for you.
- Generation stops at `<|im_end|>`. Low temperatures (0 to 0.3) with no repetition penalty work best.
## How to run
```python
import sys
sys.path.insert(0, "loopmm-sft-v2") # hf download MostLime/loopmm-sft-v2 --local-dir loopmm-sft-v2 --exclude "onnx/*"
from modeling_loopmm import LoopMM, split_thinking
model, tok = LoopMM.from_pretrained("loopmm-sft-v2")
reply = model.chat(tok, [{"role": "user", "content": "What is in this picture?", "images": ["photo.jpg"]}])
thinking, answer = split_thinking(reply)
```
For a multi-turn chat, put only the answer of each earlier assistant turn in `messages`.
## Limitations
- It is a 189M model. Its answers often contain wrong facts, and its thinking is often wrong too.
- Sometimes the reply does not match the thinking. In one test, the thinking said "2" and the reply said "1".
- It often loses track of earlier turns in a conversation.
- Its image skills are basic.
- It has had no RL and no safety tuning.
## Licenses
- **Weights**: CC BY-NC 4.0 (non-commercial), as for the base model, because some of the pretraining images allow only non-commercial use.
- **Model code**: Apache 2.0.
- **Tokenizer files**: Liquid AI's files under the LFM Open License v1.0 (`LICENSE_LFM`).
- "LFM" and "Liquid" are names of Liquid AI. This model is not made, checked or endorsed by Liquid AI.