/ Модель

Характеристики

Контекст
262 144 токена
Параметры
1,6 млрд
Лицензия
Своя лицензия
Архитектура
lfm3 · dense
Базовая модель
LFM3-1.7B
Библиотека
transformers
Опубликована
6 ноя 2026

LFM3-1.7B-think-lang-fix

Генерация текстаТекст → текст3 профессии

Экспериментально отредактированная LFM3-1.7B для генерации текста с более частым совпадением языка рассуждений с языком запроса.

330скачиваний за 30 дней0лайковвеса обновлены6 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

LFM3-1.7B-think-lang-fix — это экспериментальная модификация LiquidAI/LFM3-1.7B, опубликованная dokoomae. Веса 13 MLP-матриц точечно отредактированы методом Weight-Space Programming: без дополнительного обучения изменены направления, влияющие на язык рассуждений в режиме thinking. Модель сохраняет архитектуру LFM3, около 1,6 млрд параметров и контекст до 262 144 токенов; для запуска используются Transformers и файлы safetensors, а архитектуре требуется trust_remote_code=True.

Модификация предназначена для генерации текста в диалоге с согласованием языка рассуждений с языком запроса. В описанных тестах совпадение языка рассуждений выросло с 25% до 100% на китайских запросах, сохранив 100% на английских; для малайского результат составил 67%. Это небольшая проверка на 25 запросах, а не широкая оценка качества. По README, ответы на проверенных задачах и режим без thinking не пострадали, однако языковой перекос может проявляться на математических задачах, а стабильность на bf16 GPU отдельно не проверялась.

Модель основана на LiquidAI/LFM3-1.7B и распространяется с лицензией, обозначенной в метаданных как other; конкретные условия следует сверить с лицензией репозитория перед использованием.

Сценарии применения

  • диалог с китайскими запросами и рассуждениями на китайском языке
  • генерация английских ответов и рассуждений в режиме thinking
  • проверка влияния редактирования весов на языковой перекос модели
  • локальный запуск компактной языковой модели с длинным контекстом

Ограничения

Оценка языкового совпадения основана на небольшой батарее из 25 запросов; для малайского языка в тесте оставался случай рассуждения на английском. Проверка проводилась в int8-среде, а регрессионная проверка на bf16 GPU не выполнялась; на математических задачах китайское рассуждение может быть менее стабильным.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

LFM3-1.7B-think-lang-fix

Direct weight edit of LiquidAI/LFM3-1.7B that makes the thinking language (<think …>) match the prompt language — no training, no gradients, no extra tokens. Chinese prompt → Chinese reasoning, English prompt → English reasoning.

This is a surgical rank-1 edit of 13 MLP output matrices (2.5–3.3% relative change per edited tensor, 0.05% of all parameters), produced with the Weight-Space Programming method: diagnosis by forward-pass hooks + linear algebra only, followed by targeted subtraction/amplification of specific directions in the residual stream.

TL;DR results

25-prompt multilingual battery, official sampling settings (temperature=0.1, top_k=50, repetition_penalty=1.1), default system prompt:

Prompt languageBaseline think-language matchEdited
Chinese3/12 (25%)12/12 (100%)
English8/8 (100%)8/8 (100%), no regression
Malay1/3 (33%)2/3 (67%)
Japanese0/2 (0%)2/2 (100%)

Quality spot-checks (long-form + math): all answers remain correct (12/2+5=11 ✓, perimeter 26 / area 40 ✓, 9.9>9.11 ✓); enable_thinking=False mode unaffected.

Root cause (found with forward passes + linear algebra only)

  1. The reasoning language is decided at the first <think token; the contest is between English openers (We/The, an English-CoT corpus prior) and local-language openers (用户/我们/ユーザー, a prompt-following circuit).
  2. Layer-wise decomposition of residual-stream writes shows layers 18–22 MLPs indiscriminately write an "English-opener" direction (+0.16 to +0.53 even for Chinese/Japanese prompts; layer 21 strongest), while layer 23's MLP is the correct language-follower (EN prompt +0.31, ZH prompt −0.37) but is outvoiced. Attention layers keep writing prompt-language-aligned signal and get drowned out.
  3. The English system prompt is not the cause (removing it lowers Chinese-thinking rate: 8% vs 25%) — the prior lives in the weights (training corpus is English-CoT dominated).

What the edit does

Rank-1 updates to feed_forward.w2.weight [2048, 7680] of 13 layers (fp32 math, cast back to bf16):

axis    d_tok = mean(E[We, The]) − mean(E[用户, 我们, ユーザー, ユーザーは])
        d_res = normalize(final_norm_w ⊙ d_tok)
        g_l   = normalize(post_ffn_norm_w_l ⊙ d_res)     # per-layer direction in w2 output space
        proj_l = w2_lᵀ g_l                               # per-column component along g

remove  layers {5,6,7,11,12,13,16,18,20,21,22}:  w2 ← w2 − 1.2 · outer(g_l, proj_l)
amplify layers {19, 23}:                          w2 ← w2 + 1.5 · outer(g_l, proj_l)
  • Remove: projects out the "English-opener prior" written by those MLPs (γ=1.2, 20% overshoot to cover the strongest prior on math problems).
  • Amplify: boosts the correct prompt-following writers (layers 19/23) 2.5× along that direction.
  • All other 273 tensors are byte-identical to the original.

Usage

Works exactly like the base model (same config, tokenizer, chat template). Requires trust_remote_code=True for the LFM3 architecture files.

transformers

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "dokoomae/LFM3-1.7B-think-lang-fix"
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map="auto"
)

messages = [{"role": "user", "content": "小明有12个苹果,分给朋友一半又买了5个,现在有几个?"}]
inputs = tok.apply_chat_template(
    messages, add_generation_prompt=True, enable_thinking=True, return_dict=True, return_tensors="pt"
).to(model.device)
out = model.generate(**inputs, max_new_tokens=1024)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False))

vLLM

vllm serve dokoomae/LFM3-1.7B-think-lang-fix \
  --dtype bfloat16 --max-model-len 32768

Known limitations

  • The English-CoT prior is strongest on math word problems: without the default system prompt, Chinese-thinking consistency is 10/12 (12/12 with it).
  • Malay uses the Latin script and shares tokens (User) with English openers; one math prompt still reasons in English.
  • Validated in an int8 sandbox against the transformers reference implementation (logit error < 0.007); not re-regressed on bf16 GPU. Run the bundled battery if you deploy seriously.
  • This edit removes a bias / unlocks an existing ability; it does not add capabilities the base model lacks.

Reproduction artifacts

Also in this family:

FileDescription
thinklang_rank1_patch.safetensorsCompact rank-1 patch (g[2048] + proj[7680] + coeff per layer) — see the patch bundle
apply_patch.pyApplies the patch to a local copy of the base model
patch_meta.jsonPatch config and metadata

A compact patch bundle (497 KB) that reproduces this model from the original weights, plus a full technical report (diagnosis data, layer-wise tables, method), is available at LFM3-1.7B-think-lang-fix patch bundle.

License

The model inherits the Liquid AI Community License (LICENSE). The original model card and license: LiquidAI/LFM3-1.7B.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Класс архитектуры
Lfm3ForCausalLM
Ревизия весов
7eaf177

0 моделей