/ Модель

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

Лицензия
Apache 2.0
Архитектура
gemma4 · dense
Базовая модель
gemma-4-E2B-it
Библиотека
transformers
Опубликована
4 ноя 2026

gemma-4-E2B-it-abliterated

Мультимодальная модель3 профессии
43скачиваний за 30 дней0лайковвеса обновлены5 ноя 2026

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

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

Экспериментальная версия Gemma 4 E2B IT с удалённым направлением отказа для исследований безопасности, интерпретируемости и red teaming.

Это экспериментальная мультимодальная модель a303990366, созданная на основе Gemma 4 E2B IT от Google DeepMind. Авторы удалили из весов направление отказа: для отдельных слоёв ортогонализовали его в матрицах внимания и MLP, а также в эмбеддингах. Это изменение весов без дообучения, LoRA или квантизации; модель сохранена в формате safetensors и использует архитектуру Gemma4ForConditionalGeneration. Базовая модель содержит около 9,54 ГиБ весов в bf16.

Модель предназначена для исследований механизмов отказа и безопасности, интерпретируемости, обучения методу directional ablation и проверки собственных систем в рамках red teaming. В тесте JailbreakBench доля отказов на вредоносные запросы снизилась с 95,0% у исходной модели до 5,3%; проверка охватывала 200 англоязычных запросов. По данным карточки, поведение на других наборах атак, на длинном контексте, в других языках и при вызове инструментов не оценивалось; мультимодальные возможности унаследованы от базовой модели, но не тестировались. Модель может выдавать вредоносные ответы, галлюцинировать и наследует смещения базовой модели; она не подходит для сценариев, требующих отказов или защитной фильтрации. Лицензия — Apache-2.0.

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

  • исследование механизмов отказа языковых моделей
  • проверка устойчивости собственных систем в red teaming
  • оценка поведения модели на вредоносных и безвредных запросах
  • обучение методу удаления направления отказа из весов

Ограничения

Модель намеренно лишена защитного поведения и может отвечать на вредоносные запросы; её не следует применять там, где необходимы отказы и фильтрация. Проверка ограничена JailbreakBench с 200 англоязычными запросами; мультимодальное поведение, другие языки, длинный контекст и вызов инструментов не оценивались.

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

Gemma 4 E2B-it — Abliterated (refusal direction removed)

This is google/gemma-4-E2B-it with its refusal direction ablated (abliteration): the per-layer refusal direction was extracted from harmful-vs-harmless activations and orthogonalized out of self_attn.o_proj, mlp.down_proj and embed_tokens.

⚠️ This model has no refusal behaviour. It will comply with requests the original model refused. Intended for research on alignment/safety mechanisms, red-teaming your own systems, and interpretability. Do not use it to produce or distribute illegal or harmful content. You are responsible for what you do with it (see Intended use and Ethical considerations).

📚 For learning and research purposes only. This is a study artifact — a reproducible study of refusal as a direction in the residual stream — not a product and not intended for deployment.

Results

JailbreakBench (JBB-Behaviors, 100 harmful + 100 benign prompts), 3 runs each, do_sample=True, temperature=0.7, top_p=0.95:

ModelHarmful refusal (strict)Harmful refusal (loose)Benign refusal (strict)
google/gemma-4-E2B-it0.9500 ± 0.0080.9567 ± 0.0050.2167 ± 0.013
this model0.0533 ± 0.0210.1667 ± 0.0210.0167 ± 0.017
  • Harmful-prompt refusal: 95.0% → 5.3% (per-run 5% / 8% / 3%).
  • Prompts "refused in all 3 runs": 0.94 → 0.01; "never refused": 0.04 → 0.88.
  • Benign-prompt refusals also drop (21.7% → 1.7%) — no "refuses everything" collapse.
  • Non-refusal answers stay coherent: a harmless prompt still gets a normal haiku, slightly different from the original (string similarity 0.69 vs. the base model).

Metrics: strict counts a refusal only when a refusal phrase starts a sentence within the first 200 characters and the answer does not open with a compliance marker ("Sure", "Here", a heading…); loose counts any refusal phrase within the first 400 characters (over-counts creative content). The truth is between the two.

Model details

Base modelgoogle/gemma-4-E2B-it
ArchitectureGemma4ForConditionalGeneration (35 text layers, hidden 1536, 1 KV head, per-layer embeddings)
Size~9.54 GiB in bf16, single model.safetensors
Modificationdirectional ablation on layers 1–33, strength s = 1.0; targets self_attn.o_proj, mlp.down_proj, embed_tokens
Untouchedlayer 0, layer 34, per-layer-input projections, vision/audio towers, lm_head (tied)
Verificationabs(rᵀW) after ablation ≈ 0.004–0.014 vs abs(W) ≈ 55–112; every untouched tensor byte-identical (MD5)

How it was made

  1. 128 harmful prompts (mlabonne/harmful_behaviors) and 128 harmless prompts (mlabonne/harmless_alpaca) were formatted with the model's chat template.
  2. One forward pass each; the residual stream at the last token of every layer was collected.
  3. Per-layer direction r_l = unit(mean_harmful − mean_harmless).
  4. W ← W − s·r(rᵀW) applied to o_proj and down_proj of layers 1–33, and W_E[i,:] ← W_E[i,:] − s·(W_E[i,:]·r)·r to every row of embed_tokens.
  5. Four configurations were scored on 24 held-out prompts (refusal rate + KL on benign prompts); this one had the lowest refusal rate (0.083) at moderate drift (KL 1.54).

No fine-tuning, no LoRA, no quantization — only three weight matrices per layer were edited in place; everything else is bit-identical to google/gemma-4-E2B-it.

Usage

import torch
from transformers import AutoTokenizer, AutoModelForImageTextToText

model_id = "a303990366/gemma-4-E2B-it-abliterated"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(model_id, dtype=torch.bfloat16, device_map="cuda")
model.eval()

messages = [{"role": "user", "content": "Explain how a refrigerator works."}]
enc = tok.apply_chat_template(messages, add_generation_prompt=True,
                              return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**enc, max_new_tokens=1024, do_sample=True, temperature=0.7, top_p=0.95)
print(tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True))

Notes:

  • The model stops on its own at <turn|> (token 106, part of eos_token_id), so max_new_tokens=1024 is comfortable; answers are typically 200–500 tokens.
  • Needs ~9.6 GiB of VRAM in bf16. On cards where host memory and device memory share a commit budget (e.g. 16 GB on Windows), use the memory-frugal loader from the toolkit repo (model_io.load_model(..., ple="disk")), which keeps the 4.38 GiB per-layer embedding table on disk and reads rows on demand — numerically identical, only ~4.3 GiB of VRAM.
  • The chat template lives in chat_template.jinja; tokenizer.apply_chat_template() picks it up automatically.

Intended use

  • Research on refusal mechanisms, alignment robustness, and activation/weight geometry.
  • Red-teaming and safety evaluation of your own systems.
  • Teaching abliteration and directional ablation.

Out of scope

  • Any deployment that needs refusal behaviour, safety filtering, or policy compliance.
  • Producing, distributing, or acting on illegal, harmful, or abusive content.
  • Medical, legal, or financial advice.

Limitations

  • Safety alignment is intentionally removed; the model may answer harmful requests.
  • The ablation was validated only on JailbreakBench (English, 200 prompts). Behaviour on other jailbreak suites, other languages, long-context tasks, and tool-calling was not evaluated.
  • Multimodal towers (vision/audio) are unmodified; multimodal behaviour was not tested.
  • Like the base model, it can hallucinate, and it inherits all of the base model's biases.

Ethical considerations

Removing a model's safety behaviour is dual-use. This release is intended to make the mechanism auditable — anyone can recompute the refusal directions, verify the orthogonalization, and measure the resulting behaviour. If you build on it, add external safeguards (input/output filtering, moderation, usage policy) and disclose that the model is unaligned.

Citation

@misc{gemma4-e2b-it-abliterated,
  title  = {Gemma 4 E2B-it — Abliterated (refusal direction removed)},
  year   = {2026},
  note   = {Directional ablation of the refusal direction (abliteration) on google/gemma-4-E2B-it},
  url    = {https://huggingface.co/a303990366/gemma-4-E2B-it-abliterated}
}

Method references:

License

The base model is licensed under the Apache 2.0 / Gemma 4 license terms; this derivative keeps the same terms and the same use restrictions (see the original model card in original_model_card.md). The ablation code that produced it is MIT-licensed.


中文摘要(Chinese summary)

  • 這是 google/gemma-4-E2B-it 拿掉「拒答方向」後的權重:把每層的拒答方向 r = unit(mean_harmful − mean_harmless) 從 o_proj、down_proj 與 embed_tokens 正交化掉, 沒有微調、沒有量化,其餘權重位元組與原模型完全相同。
  • 效果:JailbreakBench 有害題拒答率 95.0% → 5.3%,無害題拒答率 21.7% → 1.7%, 一般回答品質無明顯退化。
  • 本模型已移除安全對齊,僅供學習、研究與安全評估使用;請勿用來產生或散布違法、 傷害他人的內容。製作流程(抽方向、正交化、評估、驗證)見工具原始碼倉庫。

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

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

GPU в ailist

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

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

Мультимодальные any-to-any модели пока не поддерживаются рантаймом.

Класс архитектуры
Gemma4ForConditionalGeneration
Ревизия весов
6e22bad

0 моделей