/ Модель

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

Размер весов
62,5 ГБ
Лицензия
Apache 2.0
Архитектура
gemma4 · dense
Базовая модель
gemma-4-31B-it
Библиотека
transformers
Опубликована
3 апр 2026

gemma-4-31b-it-abliterated

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

Мультимодальная Gemma 4 на 31 млрд параметров с уменьшенной склонностью к отказам, предназначенная для диалога, анализа изображений и генерации текста.

86скачиваний за 30 дней13лайковвеса обновлены6 апр 2026

Бенчмарки

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

Тесты пользователейпока нет

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

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

    Вместе с другими моделями категории «Изображение → текст» — сравнение идёт внутри одной категории.

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

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

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

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

Gemma-4-31B-IT-Abliterated — мультимодальная инструкционная модель на архитектуре Gemma 4, созданная автором репозитория null-space путём изменения весов google/gemma-4-31B-it. Модель принимает текст и изображения и генерирует текст; версия снижает склонность исходной модели к отказам, сохраняя возможности диалога, анализа изображений и рассуждений. В README указано около 32,7 млрд параметров и формат BF16; метаданные указывают библиотеку Transformers и формат safetensors.

Модель предназначена для диалоговых приложений и сценариев, где нужны ответы на вопросы по изображениям, генерация текста и творческие запросы с меньшим числом отказов. По приведённой автором оценке, доля отказов на проверенных вредоносных запросах снизилась, но полностью не устранена; тесты качества ограничены выборочными бенчмарками и не подтверждают сохранение всех возможностей. Лицензия — Apache-2.0.

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

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

Ограничения

Склонность к отказам снижена, но не устранена: README сообщает о сохраняющихся отказах и более высокой доле отказов без системного промпта. Оценки основаны на ограниченных проверках, включая выборку из пяти предметов MMLU, поэтому не гарантируют сохранение качества на всех задачах.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

Gemma-4-31B-IT-Abliterated

An abliterated version of google/gemma-4-31B-it in BF16 precision. Abliteration removes refusal directions from model weights using the technique from Refusal in Language Models Is Mediated by a Single Direction (Arditi et al.), extended with SVD-based multi-direction subspace projection to capture refusal behavior encoded across multiple orthogonal directions.

Gemma 4 31B is a strong multimodal model with excellent reasoning, but Google's safety training is aggressive — it refuses a wide range of prompts including benign creative writing scenarios. This abliteration significantly reduces refusal rates while preserving the model's full capabilities, including vision.

Results

Refusal Rates

Tested on 100 harmful prompts across 3 modes (cold, system-prompted, retry) and 50 harmless prompts.

ModeBaselineAbliteratedDelta
Cold (no system prompt)67%32%-35%
Prompted (creative writing system prompt)47%5%-42%
Retry (prompted + retry on refusal)40%2%-38%
Harmless0%0%0%

Cold refusal remains higher than other abliterated models (Qwen3, Llama) — Google's safety training encodes refusal across non-linear mechanisms that are harder to fully remove with linear projection. With a system prompt, refusal drops to 5%, which is practical for most use cases.

MMLU (5-shot, generative)

Quick benchmark on 5 MMLU subjects via chat API. Not a full MMLU run — treat as a sanity check for capability preservation.

SubjectBaselineAbliterated
Abstract Algebra75.0%75.0%
Anatomy85.9%88.1%
Astronomy92.8%92.8%
College Chemistry57.0%56.0%
College Physics77.5%74.5%
Overall (5 subjects)79.5%79.3%

The 0.2% difference is within noise. Abliteration preserved the model's reasoning capabilities.

Model Quality (Wikitext-2)

Evaluated on the full Wikitext-2 test set (291K tokens) to measure impact on general language modeling.

Perplexity

ModelPerplexityDelta
Base (gemma-4-31B-it)1.495—
Abliterated1.714+14.7%

Both models achieve sub-2.0 perplexity on Wikitext-2, which is excellent. The +14.7% increase is modest and consistent with surgical weight modification — the model's general language capabilities remain strong.

KL Divergence (base || abliterated)

Per-token KL divergence over the output distribution, approximated via top-20 logprobs from vLLM.

StatisticValue
Mean0.354
Median0.025
P951.371
P996.837

The median KL of 0.025 shows that on most tokens, the two models produce nearly identical distributions. The fat tail (P99 = 6.8) reflects tokens where abliteration had the most impact — likely positions where refusal-adjacent activations were strongest.

KV Cache Cosine Similarity

Layer-by-layer comparison of key and value cache activations on 50 Wikitext-2 samples (512 tokens each). This directly measures how much each layer's internal representations diverge between the base and abliterated models.

Layer RangeKey SimilarityValue SimilarityNotes
0–201.0000001.000000Unmodified layers — identical
21–300.9990–0.99990.9982–0.9999Early ablated layers, minimal drift
31–400.9934–0.99840.9912–0.9972Moderate drift
41–500.9913–0.99340.9817–0.9923Peak drift zone (ablation peaks at 41, 58)
51–590.9891–0.99240.9830–0.9924Highest value drift (layer 50: 0.982 values)
Overall0.99660.9953

The most drifted layers by keys are 53, 51, 56, 55, 47. By values: 50, 52, 51, 57, 56. This aligns with the ablation configuration — layers 0–20 are bitwise identical, and drift onset at layer 21 exactly matches the first ablated layer.

How It Was Made

Measurement

Refusal directions were measured at full precision (BF16 weights, float32 compute) across all 60 layers using:

  • 4,634 harmful prompts (augmented dataset covering violence, hate, cyber, fraud, drugs, self-harm, privacy, NSFW categories)
  • 640 harmless prompts (standard harmless dataset)
  • SVD decomposition (k=32) to extract orthogonal refusal directions per layer
  • Projected orthogonalization to reduce collateral damage to non-refusal capabilities
  • Welford's online algorithm in float32 for numerical stability

Ablation Configuration

  • Layers ablated: 20 through 59 (40 of 60 layers)
  • Directions: Top 8 SVD directions per layer (subspace projection)
  • Measurement peaks: Layer 41 (secondary, quality 0.025) and Layer 58 (primary, quality 0.23)
  • Scale factors: Variable per layer, up to 1.35 at peaks:
    • Layers 20-37: scale 0.35-0.45 (weak signal, gentle ablation)
    • Layers 38-51: scale 0.4-1.35 (bell curve around peak 41)
    • Layers 52-59: scale 0.6-1.35 (bell curve around peak 58)
  • Weight targets: o_proj and down_proj in the language model only (vision encoder untouched)
  • Technique: SVD subspace projection with norm preservation and projected orthogonalization
  • Architecture note: Gemma 4 is multimodal with a separate vision encoder. Only model.language_model.layers.* weights are modified; model.vision_tower.* and model.embed_vision.* are copied verbatim.

Processing Details

Ablation was performed shard-by-shard on safetensors files, modifying weights in float32 precision then saving back to bfloat16. Full-precision measurement (no quantization during measurement) was critical — 4-bit quantized measurements produced noticeably weaker abliteration.

Usage

from transformers import AutoModelForImageTextToText, AutoProcessor

model_name = "null-space/gemma-4-31b-it-abliterated"

processor = AutoProcessor.from_pretrained(model_name)
model = AutoModelForImageTextToText.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto",
)

messages = [
    {"role": "user", "content": "Your prompt here"}
]

inputs = processor.apply_chat_template(
    messages, tokenize=True, return_tensors="pt",
    return_dict=True, add_generation_prompt=True,
).to(model.device)

output = model.generate(**inputs, max_new_tokens=512)
print(processor.decode(output[0], skip_special_tokens=True))

Recommended Serving

vllm serve null-space/gemma-4-31b-it-abliterated \
    --tensor-parallel-size 2 \
    --max-model-len 8192

Fits comfortably on 2x GPUs with 48GB+ VRAM each at BF16.

Model Details

PropertyValue
Base Modelgoogle/gemma-4-31B-it
ArchitectureGemma4ForConditionalGeneration (multimodal)
Parameters~32.7B
Hidden Size5376
Attention Heads32 Q / 16 KV (sliding), 4 KV (global)
Layers60 (5 sliding + 1 full attention, repeating)
MLP Intermediate21,504
Context Length262,144 tokens
Vision27-layer ViT encoder, 280 soft tokens per image
PrecisionBF16
Model Size~62 GB (2 shards)
Vocab Size262,144

Ethical Notice

This model has had its refusal training partially removed. It will comply with many requests that the original model would refuse. You are solely responsible for how you use this model. It is intended for research into LLM alignment, safety evaluation, red-teaming, and creative writing applications.

Credits

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей