/ Модель

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

Контекст
262 144 токена
Размер весов
1,7 ГБ
Лицензия
Apache 2.0
Архитектура
qwen3_5 · dense
Базовая модель
Qwen3.5-0.8B
Библиотека
transformers
Опубликована
4 ноя 2026

Qwen3.5-0.8B-toolpatch-g23v3

Изображение и текст → текст3 профессии

Экспериментальная модификация Qwen3.5-0.8B, которая при заданном промпте меняет поведение вызова инструментов для некоторых запросов без инструмента и с пропущенным обязательным аргументом.

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

Бенчмарки

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

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

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

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

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

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

Qwen3.5-0.8B-toolpatch-g23v3 — экспериментальная модификация Qwen/Qwen3.5-0.8B, подготовленная scasella91. В модели вручную изменены веса двух почти неактивных нейронов последнего MLP-слоя: без градиентного дообучения они настроены на выдачу NO_TOOL при явной просьбе объяснить ответ и NEED_CLARIFICATION, когда явно отсутствует обязательный аргумент. Изменено 6 142 значения BF16 — около 0,00082 % параметров текстовой модели; остальные веса, включая визуальный модуль, токенизатор и шаблон чата, совпадают с указанной базовой ревизией.

Модель предназначена для экспериментов с интерпретируемостью и поведения вызова инструментов при заданном протоколе. Эффект проверяли на синтетическом тесте и на отдельных категориях BFCL; README сообщает о переносе поведения воздержания на часть примеров, но также о снижении полноты на кратких запросах, допускающих ответ. Для корректной работы требуется системный промпт, задающий литералы NO_TOOL и NEED_CLARIFICATION; результат зависит от формулировок, настроек декодирования и бэкенда. Хотя карточка указывает мультимодальную задачу image-text-to-text и возможности зрения, изменение не оценивали на изображениях. Лицензия — Apache-2.0.

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

  • Проверка отказа от вызова инструмента при явной просьбе дать объяснение
  • Запрос уточнения при явно пропущенном обязательном аргументе
  • Исследование локальных изменений весов и интерпретируемости LLM

Ограничения

Эффект проверен главным образом в ограниченном протоколе с заданным системным промптом; поведение зависит от формулировки, а неоднозначные запросы модель по-прежнему может разрешать самостоятельным выбором. Изменение не проверяли на изображениях, а другой бэкенд или настройки декодирования могут давать отличающиеся результаты.

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

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

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

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

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

Открыть на Hugging Face

Qwen3.5-0.8B-toolpatch-g23v3

Qwen/Qwen3.5-0.8B (revision 2fc06364715b967f1860aea9cf38778875588b17) with one closed-form weight edit: two near-dead neurons of the last MLP (model.language_model.layers.23.mlp, neurons 3468 and 3421) are re-purposed as a gated readout that makes the model answer NO_TOOL on explanation requests and NEED_CLARIFICATION when a required argument is explicitly missing, instead of emitting a <tool_call> with an invented argument. 6,142 BF16 entries changed (0.00082 % of the 752 M text-model parameters), in three tensors, with zero gradient steps: every number was computed from captured activations by difference of means, orthogonalization and least squares.

Everything else in this checkpoint, including the vision tower, tokenizer and chat template, is byte-identical to the base revision. Code, data, the hash-chained experiment ledger and the full write-up are at github.com/scasella/qwen3.5-toolpatch.

Scope. The edit was evaluated only on a synthetic, campaign-generated tool benchmark (inert tool families, two confusable functions per prompt, distractor notes) under one protocol: official chat template with a native <tools> block, one fixed system prompt that instructs the literals NO_TOOL / NEED_CLARIFICATION, enable_thinking=False, greedy decoding, ≤ 128 new tokens, Apple-Silicon MLX (BF16). It has not been evaluated on BFCL or other public tool benchmarks, multi-turn tool use, other system prompts (beyond one "concise" variant), other decoding settings, or vision inputs. Treat it as a mechanistic-interpretability artifact with a measured effect under that protocol, not as a general-purpose improvement.

What changed (exact)

tensor (model.language_model.layers.23.mlp.*)shapedtypechanged entriesSHA-256 baseSHA-256 this repo
gate_proj.weight3584 × 1024BF162,047 (row 3468, row 3421)57e66633224761ad56da16da7cc0f476e42decd9df64a64ded4a343b8e87487bcd759ae8a60c6cc2b5b7cbf397a03968464589f5490e11002028c6953d5c8429
up_proj.weight3584 × 1024BF162,047 (row 3468, row 3421)cb3830f5121ca0cb4b974b7904a382f9555975c2e84c71863e868e434e86aa6fb40609ff4db37fa3f97d3eeb8a7ffd1ab75bb2dc01eac36c2afa0ef9dcaad196
down_proj.weight1024 × 3584BF162,048 (column 3468, column 3421)1866748ce87d32cfee34891d2fa393fdfeee77447935f6a31d036e4b80332a48e4e9f7ead2e43fc920f9e91e44ef90a3f5ead92ca7d89f8a5c3774965abe9180

Whole-file SHA-256 of model.safetensors-00001-of-00001.safetensors: base 04b1c301231dd422b8860db31311ab2721511346a32cb1e079c4c4e5f1fe4696 → this repo 886b4952cc74601ad69bed4488c9f4e5621e7dbb8a51287db2e6a4af60f2927e (export_manifest.json). Every tensor other than the three above is byte-identical to the base (checked at export time).

Equations. With x the layer-23 MLP input (post-attention RMSNorm output, d = 1024), J1 = 3468, J2 = 3421, k = 2, k_r = 1, a₁ = a₂ = 1, λ = 0.3, λ₂ = 0.5:

gate_proj[J1,:] = k·(s − λ·c − λ₂·c₂)     up_proj[J1,:] = k·s       down_proj[:,J1] = a₁·u_AB
gate_proj[J2,:] = k·(s − λ·c − λ₂·c₂)     up_proj[J2,:] = k_r·r     down_proj[:,J2] = a₂·(u_NE − u_NO)

act_J1 = SiLU(k·(s − λc − λ₂c₂)·x) · (k·s·x)      ≈ k²(s·x)²  at a tool-context decision position with s·x > 0, ≈ 0 elsewhere
act_J2 = SiLU(k·(s − λc − λ₂c₂)·x) · (k_r·r·x)    signed NEED_CLARIFICATION-vs-NO_TOOL route, same gate
  • s — "explanation request" feature: unit difference of class means (abstain − call) at residual layer 18, orthogonalized against the literal-continuation signatures and against the call/abstain midpoint (d′ ≈ 10–14 at layers 12–16 in the base model, readable at layer 23, never used by the base model's output).
  • r — "clarify vs explain" feature: unit difference of means (clarify − answer) at residual layer 14, midpoint-orthogonalized (d′ ≈ 10 at layers 8–13).
  • c, c₂ — gate terms that close the SiLU gate at the first token of prompts without tools and at every generated position (literal continuations, inside tool calls, prose), so the readout fires only at the decision token of a tool-context prompt.
  • u_AB, u_NE − u_NO — minimum-norm least-squares output directions in pre-final-norm residual space with unit logit effect on NO/NE/<tool_call> (and −0.5 on the prose starters I, To, The) and zero effect on 39 competitor tokens.

The vectors (g23v3.vectors.npz, 38 KB) and scalars (g23v3.spec.json) are in this repo together with g23v3.npz (the BF16 bits of the three edited tensors) and apply_g23v3.py, a numpy-only script that rebuilds the edit from the vectors, applies it to a base checkpoint and verifies the hashes above:

BASE=$(hf download Qwen/Qwen3.5-0.8B --revision 2fc06364715b967f1860aea9cf38778875588b17)
python apply_g23v3.py --base "$BASE" --out Qwen3.5-0.8B-toolpatch-g23v3 --full-hash --vectors g23v3.vectors.npz --spec g23v3.spec.json

Why this edit (mechanism in two sentences)

Direct logit attribution over all 86,016 MLP neurons of the base model finds no neuron that selectively pushes <tool_call> on non-call requests (none above ≈ 0.2 logits): the push is a distributed, class-independent prior, so the flaw is a missing inhibition, not something to ablate. The residual stream nevertheless carries clean "this is an explanation request" and "a required value is missing" features that nothing reads out at the decision token; the edit installs that readout in the last layer, where the write is scaled once by the final RMSNorm and, because the KV cache is built from the layer input, affects only its own position.

Results (paired, greedy, identical prompts for base and edited weights)

setncorrect, lenient (base → edited)strictwrong→right / right→wrongcalls token-identical
practice (18 families, half with opaque names)6424 → 527 → 3528 / 024/24
selection (6 unseen families)3212 → 274 → 1915 / 012/12
renamed functions and arguments, A / B32 + 328 → 23, 12 → 266 → 21, 10 → 2515 / 0, 14 / 023/24 (one drops an explicit optional default, still correct)
final-split family proxy (12 families never used in localization)3212 → 273 → 1815 / 012/12
all tool-context items19268 → 15530 → 11887 / 071/72
non-tool short answers (fresh seed)3228 → 2828 → 280 / 032/32 token-identical
non-tool prose questions, 128 tokens (16 derivation + 16 fresh)32all intactall intact0 / 020/32 token-identical, mean length 127.9 → 128.0

Per class over the 192 tool-context items: required calls 68/72 → 68/72; NO_TOOL on explanation requests 0/60 → 59/60; NEED_CLARIFICATION when a value is explicitly missing 0/30 → 28/30; NEED_CLARIFICATION on ambiguous "either X or Y" requests 0/30 → 0/30. Lenient treats an omitted optional argument as equivalent to its explicit default; strict also forbids extra arguments (the base model's habit of adding the optional detail=brief is untouched by the edit).

Controls on the same two neurons (64 practice items): zero edit 64/64 token-identical to base; half / double dose 52 / 53 correct (monotone); reversed sign 24 → 24 with 0 repairs; three norm-matched random direction sets give 0 repairs (two neutral, one breaks 12 of 24 calls). A fresh stock mlx_lm process loading this checkpoint reproduced the in-process token streams exactly (32/32 base, 32/32 edited). Two earlier candidates (v1: no gate terms; v2: tool-context gate term only) repaired tool-context items equally well but corrupted free-form prose answers to non-tool questions (v1: 0/16 intact, NONENENE…; v2: 1/16 token-identical); the generated-position gate term c₂ in g23v3 fixes this (32/32 intact).

Limitations

  • Ambiguous requests (either "X" or "Y", with no preference specified) still produce a call that picks one value (0/30). The base network has no linear feature for "two candidate values" at any probed layer; a readout edit cannot create one.
  • Weak-cue explanation requests mostly still call; explicit-missing repair is phrasing-dependent (not provided-style phrasings are repaired).
  • Free-form prose answers are not bit-identical to the base (20/32): rare near-tied word choices flip and the text diverges benignly.
  • Inside tool calls the readout is not perfectly silent at near-tied positions (one renamed call drops an explicit optional default); no call changed correctness in 72 paired calls, and the four calls the base model gets wrong (function choice under renamed tools) stay wrong.
  • Validated only under the protocol described above, on MLX. Other backends (e.g. PyTorch) differ slightly in BF16 accumulation; near-tied decisions may differ.
  • Transfer to BFCL (experiments/transfer_bfcl/): on the BFCL v4 single-turn categories (3,491 items, tools the edit never saw), with the system prompt above, the abstention transfers (live_irrelevance 30.5% → 57.2%, irrelevance 39.6% → 48.3%, almost entirely wrong call → NEED_CLARIFICATION/NO_TOOL) at a cost in recall on terse but answerable requests (pooled over the AST categories: 6 items won, 39 lost). g23v3 and g23v4 are indistinguishable on this benchmark. Without the system prompt accuracy is unchanged, but 23% of the edited model's prose answers open with a shouted fragment of a literal (NO,, NEITHER, NEED …), because the readout promotes the literals' first tokens whether or not the prompt defines them: the edit is prompt-conditioned, not prompt-independent, and "calls stay token-identical" holds for 96 to 98% of the items where both models call, not all.

Usage

mlx-lm (the backend the edit was validated on):

from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler
model, tok = load("scasella91/Qwen3.5-0.8B-toolpatch-g23v3")
SYSTEM = ("Use the available tools when needed. For a request requiring no tool, reply exactly NO_TOOL. If required information "
          "is missing or ambiguous, reply exactly NEED_CLARIFICATION. Otherwise make exactly one native tool call. No other text.")
tools = [{"type": "function", "function": {"name": "uppercase_text", "description": "Change stored text to uppercase.",
          "parameters": {"type": "object", "properties": {"text": {"type": "string", "description": "Stored text identifier"}}, "required": ["text"]}}}]
messages = [{"role": "system", "content": SYSTEM},
            {"role": "user", "content": "Carry out this request: change stored text to uppercase.\nStored text identifier: not provided."}]
prompt = tok.apply_chat_template(messages, tools=tools, add_generation_prompt=True, enable_thinking=False)
print(generate(model, tok, prompt, max_tokens=128, sampler=make_sampler(0)))   # NEED_CLARIFICATION (base model: a <tool_call> with text="not provided")

transformers (not executed by the authors; the campaign machine has no PyTorch):

import torch
from transformers import AutoTokenizer, AutoModelForImageTextToText
repo = "scasella91/Qwen3.5-0.8B-toolpatch-g23v3"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForImageTextToText.from_pretrained(repo, dtype=torch.bfloat16).eval()
ids = tok.apply_chat_template(messages, tools=tools, add_generation_prompt=True, enable_thinking=False, return_tensors="pt")
out = model.generate(ids, max_new_tokens=128, do_sample=False)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))

Files

filepurpose
model.safetensors-00001-of-00001.safetensors, config.json, tokenizer and template filesfull checkpoint; byte-identical to the base except the three tensors above
g23v3.npzuint16 BF16 bits of the three edited tensors (22 MB)
g23v3.vectors.npz, g23v3.spec.jsonthe closed-form vectors (s, r, c, c₂, u_AB, u_route, gate_dir) and every scalar, receipt and simulation result
apply_g23v3.pynumpy-only patcher: rebuilds the tensors from the vectors, applies them to a base checkpoint, verifies the hashes
export_manifest.jsonedited tensor names, base and edited whole-file SHA-256
BASE_MODEL_README.md, LICENSEthe original Qwen3.5-0.8B model card and Apache-2.0 license

Provenance

Built on 2026-11-04 in 47 budgeted forward passes (every one logged with a hypothesis and prediction before it ran, in a hash-chained ledger), MLX 0.32.4 / mlx-lm 0.32.2 / transformers 5.22.1 on an Apple M4 Pro. No gradients, optimizers, LoRA, distillation or output-fitting regression; prompts, template, decoding and post-processing identical for base and edited weights in every comparison. Full report, notebook, ledger, per-pass outputs and reproduction commands: github.com/scasella/qwen3.5-toolpatch.

License and attribution

Apache-2.0, as the base model. Base model © Alibaba Cloud (Qwen3.5-0.8B); the original model card is kept as BASE_MODEL_README.md.

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

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

GPU в ailist

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

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

MLX-модели работают только на Apple Silicon, на GPU NVIDIA они не запускаются.

Класс архитектуры
Qwen3_5ForConditionalGeneration
Ревизия весов
fda72a4

0 моделей