Download README.md from MostLime/loopmm-sft-v2-ftpo: direct link, hf CLI and curl.
- Browser
- Download file 5.21 kB
-
https://huggingface.co/MostLime/loopmm-sft-v2-ftpo/resolve/main/README.md
- Command line
-
hf download hf://MostLime/loopmm-sft-v2-ftpo/README.md
-
curl -L -o README.md https://huggingface.co/MostLime/loopmm-sft-v2-ftpo/resolve/main/README.md
license: cc-by-nc-4.0
language:
- en
pipeline_tag: image-text-to-text
library_name: pytorch
base_model: MostLime/loopmm-sft-v2
tags:
- looped
- multimodal
- chat
- reasoning
- onnx
- small-model
- preview
loopmm SFT v2 + FTPO
Preview. This is loopmm SFT v2 after one round of antidoom training, which teaches it to break out of repetition loops. It has had no reinforcement learning. Expect mistakes.
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. Pick "Chat: SFT v2 + FTPO" in the Model menu. It runs in your browser.
It was trained from MostLime/loopmm-sft-v2. That card covers the fine-tuning data, and 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.
Antidoom training (FTPO)
SFT v2 often fell into doom loops: it repeated the same text until it ran out of tokens, mostly inside its thinking. This round trains that out with FTPO (Final Token Preference Optimization), using Liquid AI's antidoom code for the prompts, the loop detector and the pair selection.
- Finding loops: SFT v2 answered 22,643 prompts from LiquidAI/antidoom-mix-v1.0 at temperature 0.1. 28% of the replies looped, and 78% of those loops started in the thinking.
- Pairs: for each loop, the "rejected" token is the one that starts the first repeat. The "chosen" tokens are other tokens the model itself ranked highly at that point. This gave 6,345 pairs, and 5,545 passed antidoom's filters.
- Training: a full fine-tune with the FTPO loss on that one token position, plus a tether that keeps the other logits close to SFT v2. AdamW at lr 1e-5 with 16 pairs per step. It stopped early after 45 steps (720 pairs, 11 minutes on one T4), once the chosen token won 42% of the time.
Evals
Same suite as SFT v2: natural mode (the model decides whether to think), greedy decoding, the same prompts, budgets and scoring. A reply counts as a loop when antidoom's detector finds one anywhere in it.
| Benchmark | n | score SFT v2 | score + FTPO | loops SFT v2 | loops + FTPO | thinking tokens SFT v2 | thinking tokens + FTPO |
|---|---|---|---|---|---|---|---|
| GSM8K-Platinum | 1209 | 2.8 | 3.2 | 2.9% | 0.0% | 194 | 119 |
| MATH-500 | 500 | 1.8 | 2.2 | 32.2% | 0.8% | 1239 | 217 |
| IFEval | 541 | 15.3 | 15.7 | 29.4% | 9.6% | 372 | 99 |
| IFBench | 300 | 8.3 | 12.0 | 41.7% | 9.7% | 1066 | 299 |
| TriviaQA | 1000 | 8.3 | 9.0 | 9.4% | 0.6% | 243 | 101 |
- Every score went up a little.
- The model still thinks on every prompt, but its thinking is much shorter (almost 6 times on MATH-500), because much of the long thinking was loops.
- Thinking that never closes fell to 0-1% on GSM8K, MATH-500, IFEval and TriviaQA, and from 33% to 6% on IFBench.
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
import sys
sys.path.insert(0, "loopmm-sft-v2-ftpo") # hf download MostLime/loopmm-sft-v2-ftpo --local-dir loopmm-sft-v2-ftpo --exclude "onnx/*"
from modeling_loopmm import LoopMM, split_thinking
model, tok = LoopMM.from_pretrained("loopmm-sft-v2-ftpo")
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.
- Some loops remain, mostly in replies to instruction-following prompts: a list item or template line that repeats. Some of these prompts did not loop before FTPO.
- Sometimes the reply does not match the thinking.
- It often loses track of earlier turns in a conversation.
- Its image skills are basic. The antidoom prompts are text only.
- 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.