LFM3-1.7B-Looped-Distilled
LFM3-1.7B-Base with the depth loop of LFM3-1.7B-Looped and a re-entry bridge distilled into the looped block. The result is a plain 28-layer model: no bridge module, no custom sampler, and a stock llama.cpp graph.
What was done
- Loop. The base has 24 layers. Layers 8-11 are executed twice: their copies become
layers 12-15, and the eight
post_attention_norm/post_ffw_normweights for layers 8-15 are multiplied by 0.5. This is the same damped depth loop as LFM3-1.7B-Looped:alpha=0.5, two passes, 28 layers total. - Teacher. A zero-initialised rank-64 re-entry bridge was trained on top of that loop: it reads the layer-7 output and writes into layer 12, with a tanh gate. The bridge has 0.26M parameters and was trained for 500 steps on the wikitext-train / GSM8K-chat mix. It is not shipped.
- Distillation. The bridge teacher was distilled into the looped block with rank-64 LoRA on layers 12-15 only. Loss was cross-entropy plus a normalised MSE to the teacher's final hidden states, computed on 250 x 1024-token wikitext-train windows; 500 steps, 10.7M trainable parameters (0.525% of the model). No GSM8K or instruction data was used for the student.
- Merge. The LoRA weights were merged into layers 12-15. The LoRA
Bmatrices for every other layer are exactly zero, so layers 0-11 and 16-27 carry no trained change. - Export. Standard HF checkpoint -> GGUF F16 -> Q8_0 with llama.cpp.
The loop is architectural: the GGUF has lfm3.block_count = 28, 335 tensors, and the
copied block repeated once. The bridge is not a runtime tensor; its effect lives in the
merged weights of the copied layers.
Evaluation
All numbers are 5-shot, greedy, on the same harness and tokenizer; paired per-item comparisons. ARC is n=1000; GSM8K is n=80.
| model | ARC-Easy | ARC-Challenge | GSM8K | wiki PPL (Q8_0) |
|---|---|---|---|---|
| LFM3-1.7B-Base | 60.8 | 30.0 | 67.5 | 18.42 |
| static loop [8-11]x2, alpha=0.5 | 69.2 | 34.1 | 61.3 | 17.92 |
| this model (wiki-only distill) | 69.8 | 40.5 | 67.5 | 13.72 |
Paired vs the static loop:
- ARC-Challenge: 136 wins / 72 losses, exact McNemar p = 1.0e-5.
- ARC-Easy: 93 / 87, p = 0.71 (tied).
- GSM8K: 9 / 4, p = 0.27 (n=80, not powered).
- PPL is
llama-perplexityonwikitext-test.txt, 1024-token chunks, Q8_0.
Reading the table honestly: the robust gain is ARC-Challenge (+6.4 pp, significant). ARC-Easy is flat versus the static loop. GSM8K returns to the base level rather than the static loop's drop, but the n=80 comparison is not significant. The PPL gain is partly in-domain because the distillation data is wikitext-train.
This is a base checkpoint, not an instruction-tuned model. The chat template works and
the model answers chat-style prompts, but it has no RLHF/DPO. Raw /v1/completions behaviour
is preserved; a 50/50 wikitext/GSM8K variant reached GSM8K 75.0 but degraded raw completions,
which is why it is not the released file.
Files
| file | notes |
|---|---|
model.safetensors | bf16 HF checkpoint, 28 layers, 1.97B params |
gguf/LFM3-1.7B-Looped-Distilled-Q8_0.gguf | 2.0 GB, Q8_0, 28 blocks |
config.json, modeling_lfm3.py, ... | standard LFM3 custom code |
LICENSE, NOTICE | LFM Open License v1.0 and modification notice |
Usage
llama.cpp
llama-cli -m gguf/LFM3-1.7B-Looped-Distilled-Q8_0.gguf \
-p "The capital of France is" -n 64 -ngl 99
llama-server -m gguf/LFM3-1.7B-Looped-Distilled-Q8_0.gguf \
--alias lfm3-1.7b-looped-distilled -c 131072 -ngl 99 --jinja
The file is a normal 28-layer LFM3 graph; no patched llama.cpp is required. On an RTX 4070 it runs at about 180 tok/s decode and 17.5k tok/s prefill at Q8_0.
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("vaultpls/LFM3-1.7B-Looped-Distilled", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
"vaultpls/LFM3-1.7B-Looped-Distilled", trust_remote_code=True, torch_dtype="bfloat16"
).cuda()
ids = tok("The capital of France is", return_tensors="pt").input_ids.cuda()
print(tok.decode(model.generate(ids, max_new_tokens=32, do_sample=False)[0]))
Training details
- Teacher: static loop + zero-init rank-64 bridge (layer 7 -> layer 12), 500 steps on alternating wikitext-train / GSM8K-chat windows, AdamW, lr 1e-3 with warmup and cosine, batch 2 x 1024 tokens.
- Student: rank-64 LoRA (
alpha=128, dropout 0) onq_proj,k_proj,v_proj,o_proj,in_proj,out_proj,w1,w2,w3of layers 12-15; CE + normalised MSE (weight 1.0) to teacher final hidden states; 500 steps on 250 wikitext windows, lr 3e-4, cosine schedule, batch 2 x 1024 tokens, bf16. - Hardware: one RTX 4070 12 GB, gradient checkpointing.
- The scripts used are in
scripts/; paths in them are the local training paths and need adjusting for a fresh checkout.
Limitations
- Base model, not instruction-tuned; tool use and long multi-step agency are not trained.
- The loop is fixed at two passes and alpha=0.5; there is no adaptive loop count.
- ARC-Challenge is the only statistically solid gain. GSM8K n=80 is underpowered.
- Wiki PPL is in-domain relative to the distillation corpus.
- The model was distilled from a teacher trained on wikitext-train; it inherits the base model's language coverage and biases.
License and attribution
This is a derivative work of LiquidAI/LFM3-1.7B-Base,
distributed under the LFM Open License v1.0. A copy is in LICENSE; the required
modification notice is in NOTICE. No affiliation with or endorsement by Liquid AI is claimed.
The static-loop recipe follows arXiv:2605.23872; the re-entry-bridge teacher follows the idea in arXiv:2608.11233 (Retrofitting Recurrent Depth). The distillation and merge are this repository's work.