/ Модель

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

Контекст
40 960 токенов
Параметры
7,6 млрд
Размер весов
16,4 ГБ
Лицензия
Apache 2.0
Архитектура
qwen3 · dense
Базовая модель
Qwen3-8B
Библиотека
transformers
Опубликована
18 ноя 2026

nla-qwen3-8b-layer18

Генерация текстаТекст → текст3 профессии
312скачиваний за 30 дней0лайковвеса обновлены18 ноя 2026

Описание модели

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

Вербализатор для генерации текстовых объяснений активаций 18-го слоя Qwen3-8B в исследованиях интерпретируемости.

Это экспериментальный вербализатор активаций для Qwen3-8B, созданный Camila Blank. Он принимает остаточный вектор размером 4096 из одного токена на выходе 18-го блока Qwen3-8B и генерирует текстовое объяснение этой активации. Модель предназначена для анализа внутренних представлений языковой модели и задач интерпретируемости, а не для обычного диалога или универсальной генерации текста.

Модель дообучена на активациях Qwen3-8B и объяснениях, подготовленных на корпусе FineFineWeb; обучение включало supervised-этап и короткий этап RL. В README для корневого чекпойнта указана доля объяснённой дисперсии 63% на 256 отложенных активациях, а для версии до RL — 43%; это оценка реконструкции, которая сама по себе не гарантирует полезность объяснений. Модель имеет 7,6 млрд параметров, работает через Transformers, использует формат safetensors и контекст 40960 токенов. Лицензия — Apache-2.0.

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

  • объяснение активации одного токена в 18-м слое Qwen3-8B
  • анализ внутренних представлений Qwen3-8B
  • исследование интерпретируемости языковых моделей
  • сравнение текстовых объяснений активаций до и после RL

Ограничения

Модель не предназначена для общего использования как языковая модель и требует входного вектора активации заданного формата от 18-го блока Qwen3-8B. Качество объяснений и их полезность не гарантируются метрикой реконструкции; README рекомендует оценивать их на целевой задаче.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

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

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

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

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

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

Открыть на Hugging Face

NLA verbalizer for Qwen3-8B, layer 18

This is the activation verbalizer (AV) of a single-layer natural language autoencoder (NLA) for Qwen/Qwen3-8B. Given the residual stream of Qwen3-8B at one token, taken at layer 18, it writes a natural language explanation of that activation.

  • The repository root holds the verbalizer after RL (150 iterations).
  • sft/ holds the verbalizer after supervised training only, before RL.
  • The reconstructor that it was trained with is not included.

It is not useful as a general-purpose language model.

Input

The input is one vector of size 4096: the output of decoder block 18 of Qwen3-8B at a single token position (hidden_states[19] in transformers, i.e. model.model.layers[18]). The vector is rescaled to norm 150 and written over the embedding of one marker token in the verbalizer's prompt. The prompt template, marker character and scale are in nla_meta.yaml. This is the same input contract as marco-bazzani/Qwen3-8B-nla; only the layer differs (18 instead of 24).

Example

import re, torch, yaml
from huggingface_hub import snapshot_download
from transformers import AutoModelForCausalLM, AutoTokenizer

torch.set_grad_enabled(False)
AV = snapshot_download("camila-blank/nla-qwen3-8b-layer18", ignore_patterns=["sft/*"])
LAYER = 18

meta = yaml.safe_load(open(f"{AV}/nla_meta.yaml"))
char, scale = meta["tokens"]["injection_char"], meta["extraction"]["injection_scale"]
template = meta["prompt_templates"]["actor"]

# 1. Read Qwen3-8B's residual stream at one token
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-8B")
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-8B", dtype=torch.bfloat16, device_map="cuda")
text, position = "The capital of France is Paris, and the capital of Italy is", -1
ids = tok(text, return_tensors="pt", add_special_tokens=False).input_ids.cuda()
v = base(ids, output_hidden_states=True).hidden_states[LAYER + 1][0, position].float()
del base
v = v / v.norm() * scale

# 2. Put the vector into the verbalizer's prompt and sample
av_tok = AutoTokenizer.from_pretrained(AV)
av = AutoModelForCausalLM.from_pretrained(AV, dtype=torch.bfloat16, device_map="cuda")
prompt = av_tok.apply_chat_template([{"role": "user", "content": template.format(injection_char=char)}],
                                    add_generation_prompt=True, return_tensors="pt")
prompt = (prompt["input_ids"] if hasattr(prompt, "keys") else prompt).cuda()
emb = av.get_input_embeddings()(prompt)
(slot,) = (prompt[0] == meta["tokens"]["injection_token_id"]).nonzero().squeeze(1).tolist()
emb[0, slot] = v.to(emb.dtype)
out = av.generate(inputs_embeds=emb, attention_mask=torch.ones_like(prompt), do_sample=True,
                  temperature=1.0, top_p=1.0, top_k=0, max_new_tokens=200)
text_out = av_tok.decode(out[0], skip_special_tokens=True)
m = re.search(r"<explanation>\s*(.*?)\s*</explanation>", text_out, re.S)
print(m.group(1) if m else text_out)

Training sampled at temperature 1.0 with no top-k or top-p truncation. Explanations vary between samples, so drawing several per activation gives a better picture. The training activations were taken at least 50 tokens into a document, from text tokenized without a chat template.

Training

  • Data: the texts and explanations of ceselder/qwen3-8b-nla-L24-finefineweb-100k (100k FineFineWeb documents, 10 positions each, explanations written by Claude Sonnet 4.6 from the text). The activations were re-extracted at layer 18.
  • Verbalizer, supervised stage: initialised from the layer-24 verbalizer marco-bazzani/Qwen3-8B-nla; LoRA (rank 64, rsLoRA, all attention and MLP projections), one epoch over 243k pairs at batch 256, learning rate 1e-4 with cosine decay. The adapter is merged into the weights in sft/.
  • Reconstructor, supervised stage: the first 19 blocks of Qwen3-8B without the final norm, LoRA rank 64, plus a linear head; one epoch over 243k pairs.
  • RL stage: 150 iterations of 1,024 rollouts (256 activations, 4 samples each). The reward is the negative reconstruction error of the reconstructor, with a per-activation baseline, a small penalty for an unclosed <explanation> tag and a KL penalty (0.01) to the supervised verbalizer. The reconstructor is trained on the same rollouts. A fresh rank-64 LoRA is trained on top of the merged supervised verbalizer and merged into the weights at the repository root.

This differs from the NLA paper's recipe in using LoRA rather than a full fine-tune, in the warm start from a layer-24 verbalizer, and in a short RL stage whose hyperparameters were not tuned.

Reconstruction

Fraction of variance explained on 256 held-out activations (documents not seen in training), one sampled explanation per activation, scored by the co-trained reconstructor on norm-rescaled vectors against a predict-the-mean baseline:

checkpointvariance explainedwell-formed outputs
sft/ (before RL)43%100%
root (after RL)63%99%

Higher reconstruction does not by itself mean more useful explanations; compare both checkpoints on your own task.

References

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen3ForCausalLM
Ревизия весов
96d9acc

0 моделей