/ Модель

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

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

gemma-4-E4B-it-heretic

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

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

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

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

kldzj/gemma-4-E4B-it-heretic — производная от Google Gemma 4 E4B Instruct модель, помеченная автором как uncensored, decensored и abliterated. Это мультимодальная плотная модель семейства Gemma 4 на базе Gemma4ForConditionalGeneration; файлы представлены в формате safetensors, лицензия — Apache-2.0. В карточке описаны возможности базового семейства Gemma 4, включая гибридное внимание с локальными окнами и глобальными слоями и контекст до 128 тысяч токенов для E4B.

Модель предназначена для диалога, генерации и редактирования текста и кода, рассуждений, работы с изображениями и видео, а также аудиораспознавания и перевода речи в текст. Указаны сценарии анализа документов, скриншотов, графиков и рукописного текста, OCR и использования инструментов. Семейство поддерживает более 35 языков; README не уточняет, какие языки и возможности базовой карточки сохраняются именно в этом производном чекпойнте.

README предупреждает о возможных фактических ошибках, предвзятости данных, трудностях с тонкими языковыми нюансами и сложными открытыми задачами. Метки uncensored и abliterated указывают на изменение поведения безопасности, но карточка не описывает конкретные изменения или их проверку.

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

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

Ограничения

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

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

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

gemma-4-E4B-it-heretic

An abliterated version of google/gemma-4-E4B-it with reduced refusals, made with Heretic v2.0.0.

[!WARNING] This is an abliterated model. Its tendency to refuse requests has been largely removed. It will answer many requests that the original model declines, and it has no additional safety training. It is meant for research and creative use. You are responsible for how you use it and for what you do with its outputs, including complying with applicable laws and with the Gemma 4 / Apache-2.0 license terms. Do not deploy it to end users without your own safeguards.

GGUF (Q4_K_M): kldzj/gemma-4-E4B-it-heretic-GGUF

OriginalThis model
Refusals (Heretic, 100 prompts)100/1002/100
KL divergence from the original (Heretic, 100 harmless prompts)00.078
MMLU (1,710 q)0.7070.701
GSM8K strict (250 q)0.8400.820
ARC-Challenge acc_norm0.5680.523
HellaSwag acc_norm (1,000 q)0.6260.606

Full table, including the other shortlisted trials, below.

What was done

  • Base model: google/gemma-4-E4B-it at revision ee0ef60 (Apache-2.0).
  • Tool: Heretic v2.0.0, installed from git at the v2.0.0 tag, commit 0db5c31.
  • Method: Heretic's default configuration (config.default.toml): Arbitrary-Rank Ablation (ARA) as the modifier, co-optimising two objectives with Optuna's TPE sampler: the refusal rate (keyword matching on 100 prompts from mlabonne/harmful_behaviors, test split) and the KL divergence of the first-token distribution from the original model (100 prompts from mlabonne/harmless_alpaca, test split). Only these settings were added: the base revision, n_trials = 200, n_startup_trials = 50, seed = 42, export_strategy = "merge" and checkpoint_action = "continue" (which only matters when resuming a run). The full settings are in reproduce/config.toml.
  • Chosen trial: 33 of 200, with these Arbitrary-Rank Ablation parameters:
ParameterValue
start_layer_index19
end_layer_index35
preserve_good_behavior_weight0.3390
steer_bad_behavior_weight0.0025
overcorrect_relative_weight0.9437
neighbor_count14
  • How it was chosen. The trial was picked by hand from the full trial list, not by an automatic rule. 33 of the 200 trials reached 0/100 refusals, but every one of them had a KL divergence of 11.6 or more, which means a badly damaged model. Trial 33 was the only trial with 10 or fewer refusals and a KL divergence below 1.2. Four candidates were saved and tested side by side: trial 33 (2/100, KL 0.078), trials 18 (17/100, KL 0.100) and 23 (19/100, KL 0.234), the next-best low-KL trials, and trial 154 (13/100, KL 0.659), the best trial from the other region the optimiser explored. Trial 33 has the fewest refusals and the lowest KL of the four. Its benchmark cost is small and its outputs on ordinary prompts are as fluent as the original's. Trial 18 is slightly closer to the original on benchmarks but refuses 17 of 100 prompts. Trials 23 and 154 are worse on both counts.
  • Checks on the exported weights. Heretic's own --evaluate-model run on the saved bf16 weights gives 2/100 refusals and a KL divergence of 0.0796, against 0.0779 at trial time before the LoRA was merged into the bf16 weights; the original scores 100/100 in the same run. Saving trial 33 from Heretic's menu and re-creating it in a separate process with heretic --reproduce produced bit-identical weights.

Evaluation: original against abliterated

All numbers below were produced on the same machine (1x RTX 6000 Ada, bf16, transformers 5.22.1, lm-evaluation-harness 0.4.13), with identical settings for every model. The four trial columns are the shortlisted candidates; trial 33 is the published model.

MetricOriginalTrial 33 (picked)Trial 18Trial 23Trial 154
Refusals (heretic, 100 harmful_behaviors test prompts)100/1002/10017/10019/10013/100
KL divergence (heretic, 100 harmless_alpaca test prompts)0 (by definition)0.07790.10010.23360.6588
MMLU acc (30/subject, 1,710 q, 0-shot)0.70700.70060.70060.67080.6023
GSM8K exact match, strict (first 250, 5-shot)0.84000.82000.83200.73200.7120
GSM8K exact match, flexible-extract (see note)0.84400.68400.82800.72800.7160
ARC-Challenge acc_norm (full test, 1,172 q, 0-shot)0.56830.52300.55290.51620.4531
HellaSwag acc_norm (first 1,000, 0-shot)0.62600.60600.62000.60400.5480
Wikitext word perplexity (lm-eval, 62 docs)256.47263.62248.79216.77358.44
Wikitext-2 token perplexity (65,536 tokens)56.29866.98856.25251.71466.538
Harmless prompts (12): loops / wrong language0 / 00 / 00 / 01 / 00 / 0
Harmless prompts (12): stopped on their own (cap 600 tokens)9/129/1210/129/129/12

Refusals and KL for trials 18, 23 and 154 are Heretic's trial-time scores. Trial 33's were also measured on the exported bf16 weights with heretic --evaluate-model: 2/100 and 0.0796 (trial time: 0.0779). Trial 23's flagged "loop" is a false positive: the same sign-off line appears in three alternative email drafts.

Notes on the table

  • Settings. Every model was run through lm-evaluation-harness 0.4.13 with bf16 weights and the default task configs. MMLU, ARC-Challenge and HellaSwag are 0-shot; GSM8K is 5-shot. No chat template was used, and seeds were fixed. Gemma 4's tokenizer does not add <bos> by itself, so the evaluation prepends it. Without it, both models score near chance.
  • GSM8K. Strict-match, which requires the #### N answer format, is the primary number. In this raw few-shot completion format, the abliterated model often writes a correct #### N and then keeps generating. Flexible-extract takes the last number in the text, so its score drops (0.684 against 0.844) while strict-match barely moves (0.820 against 0.840). With the chat template, the model stops like the original: 9 of the 12 sample answers ended on their own for both models.
  • Perplexity. The instruction-tuned model has a high perplexity on raw Wikipedia text, and the original already sits at a token perplexity of 56. Only the change matters here. Trial 33 raises token perplexity by about 19% but word perplexity on the full lm-eval wikitext task by only 3%.
  • Sample outputs. Both models answered the same 12 ordinary prompts with greedy decoding: a poem, Python and JavaScript code, a joke, a summary, an explanation for a child, an email, sleep tips, a French translation, a recipe, a German answer and a story opening. Trial 33's answers are as fluent and correct as the original's, with no repetition loops and no language drift; the German prompt is answered in German. All outputs are in evaluation/.
  • Refusals are counted by Heretic's default keyword matcher on 100 prompts from mlabonne/harmful_behaviors (test split), with 100 generated tokens per prompt. A response that contains none of the refusal phrases counts as compliant. The count says nothing about the quality or accuracy of the answers.

Files

FileWhat it is
model-*.safetensors, config.json, tokenizer and processor files, chat_template.jinjathe abliterated model in bf16, with Gemma 4's tokenizer, processor and chat template (vision and audio towers included, unchanged)
GGUFthe text-only Q4_K_M GGUF (gemma-4-E4B-it-heretic-Q4_K_M.gguf, converted and quantised with llama.cpp v0.8.0 (commit 8642541; convert_hf_to_gguf.py --outtype bf16, then llama-quantize ... Q4_K_M)) lives in its own repo: kldzj/gemma-4-E4B-it-heretic-GGUF
reproduce/Heretic's reproducibility manifest (reproduce.json), the exact config, package versions, weight hashes and the full Optuna study journal
evaluation/raw results (lm-eval, perplexity, Heretic's scores for all 200 trials, the --evaluate-model check), the 12 sample outputs of the original and of each candidate, the GGUF sanity outputs, and the evaluation script

Reproduce

pip install "git+https://github.com/p-e-w/heretic@v2.0.0"
heretic --reproduce https://huggingface.co/kldzj/gemma-4-E4B-it-heretic/resolve/main/reproduce/reproduce.json

License

Apache-2.0, as the base model. The base model is © Google; see the original model card below.


Heretic's generated summary

This is a decensored version of google/gemma-4-E4B-it, made using Heretic v2.0.0

[!TIP] This model is reproducible!

See the README in the reproduce directory for more information.

Arbitrary-Rank Ablation (ARA) parameters

ParameterValue
start_layer_index19
end_layer_index35
preserve_good_behavior_weight0.3390
steer_bad_behavior_weight0.0025
overcorrect_relative_weight0.9437
neighbor_count14

Performance

MetricThis modelOriginal model (google/gemma-4-E4B-it)
Refusals2/100100/100
KL divergence0.07790 (by definition)

Original model card (google/gemma-4-E4B-it)

Gemma is a family of open models built by Google DeepMind. Gemma 4 models are multimodal, handling text and image input (with audio supported on E2B, E4B, and 12B) and generating text output. This release includes open-weights models in both pre-trained and instruction-tuned variants. Gemma 4 features a context window of up to 256K tokens and maintains multilingual support in over 140 languages.

Featuring both Dense and Mixture-of-Experts (MoE) architectures, Gemma 4 is well-suited for tasks like text generation, coding, and reasoning. The models are available in five distinct sizes: E2B, E4B, 12B, 26B A4B, and 31B. Their diverse sizes make them deployable in environments ranging from high-end phones to laptops and servers, democratizing access to state-of-the-art AI.

Gemma 4 introduces key capability and architectural advancements:

  • Reasoning – All models in the family are designed as highly capable reasoners, with configurable thinking modes.

  • Extended Multimodalities – Processes Text, Image with variable aspect ratio and resolution support (all models), Video, and Audio (featured natively on the E2B, E4B, and 12B models).

  • Diverse & Efficient Architectures – Offers Dense and Mixture-of-Experts (MoE) variants of different sizes for scalable deployment.

  • Optimized for On-Device – Smaller models are specifically designed for efficient local execution on laptops and mobile devices.

  • Increased Context Window – The small models feature a 128K context window, while the medium models support 256K.

  • Enhanced Coding & Agentic Capabilities – Achieves notable improvements in coding benchmarks alongside native function-calling support, powering highly capable autonomous agents.

  • Native System Prompt Support – Gemma 4 introduces native support for the system role, enabling more structured and controllable conversations.

Models Overview

Gemma 4 models are designed to deliver frontier-level performance at each size, targeting deployment scenarios from mobile and edge devices (E2B, E4B) to consumer GPUs and workstations (12B, 26B A4B, 31B). They are well-suited for reasoning, agentic workflows, coding, and multimodal understanding.

The models employ a hybrid attention mechanism that interleaves local sliding window attention with full global attention, ensuring the final layer is always global. This hybrid design delivers the processing speed and low memory footprint of a lightweight model without sacrificing the deep awareness required for complex, long-context tasks. To optimize memory for long contexts, global layers feature unified Keys and Values, and apply Proportional RoPE (p-RoPE).

Dense Models

PropertyE2BE4B12B Unified31B Dense
Total Parameters2.3B effective (5.1B with embeddings)4.5B effective (8B with embeddings)11.95B30.7B
Layers35424860
Sliding Window512 tokens512 tokens1024 tokens1024 tokens
Context Length128K tokens128K tokens256K tokens256K tokens
Vocabulary Size262K262K262K262K
Supported ModalitiesText, Image, AudioText, Image, AudioText, Image, AudioText, Image
Vision Encoder Parameters~150M~150M-~550M
Audio Encoder Parameters~300M~300M-No Audio

The "E" in E2B and E4B stands for "effective" parameters. The smaller models incorporate Per-Layer Embeddings (PLE) to maximize parameter efficiency in on-device deployments. Rather than adding more layers or parameters to the model, PLE gives each decoder layer its own small embedding for every token. These embedding tables are large but are only used for quick lookups, which is why the effective parameter count is much smaller than the total.

The "Unified" in Gemma 4 12B Unified refers to its encoder-free architecture. Other Gemma 4 models use dedicated encoders to process multimodal data before passing it to the LLM. Gemma 4 12B eliminates these encoders entirely, projecting raw image patches and audio waveforms directly into the LLM's embedding space through lightweight linear layers. This unified approach means all modalities flow straight into a single decoder-only transformer, reducing multimodal latency and allowing the entire model to be fine-tuned in one pass.

Mixture-of-Experts (MoE) Model

Property26B A4B MoE
Total Parameters25.2B
Active Parameters3.8B
Layers30
Sliding Window1024 tokens
Context Length256K tokens
Vocabulary Size262K
Expert Count8 active / 128 total and 1 shared
Supported ModalitiesText, Image
Vision Encoder Parameters~550M

The "A" in 26B A4B stands for "active parameters" in contrast to the total number of parameters the model contains. By only activating a 4B subset of parameters during inference, the Mixture-of-Experts model runs much faster than its 26B total might suggest. This makes it an excellent choice for fast inference compared to the dense 31B model since it runs almost as fast as a 4B-parameter model.

Benchmark Results

These models were evaluated against a large collection of different datasets and metrics to cover different aspects of text generation. Evaluation results marked in the table are for instruction-tuned models.

Gemma 4 31BGemma 4 26B A4BGemma 4 12B UnifiedGemma 4 E4BGemma 4 E2BGemma 3 27B (no think)
MMLU Pro85.2%82.6%77.2%69.4%60.0%67.6%
AIME 2026 no tools89.2%88.3%77.5%42.5%37.5%20.8%
LiveCodeBench v680.0%77.1%72.0%52.0%44.0%29.1%
Codeforces ELO215017181659940633110
GPQA Diamond84.3%82.3%78.8%58.6%43.4%42.4%
Tau2 (average over 3)76.9%68.2%69.0%42.2%24.5%16.2%
HLE no tools19.5%8.7%5.2%---
HLE with search26.5%17.2%----
BigBench Extra Hard74.4%64.8%53.0%33.1%21.9%19.3%
MMMLU88.4%86.3%83.4%76.6%67.4%70.7%
Vision
MMMU Pro76.9%73.8%69.1%52.6%44.2%49.7%
OmniDocBench 1.5 (average edit distance, lower is better)0.1310.1490.1640.1810.2900.365
MATH-Vision85.6%82.4%79.7%59.5%52.4%46.0%
MedXPertQA MM61.3%58.1%48.7%28.7%23.5%-
Audio
CoVoST--38.5*35.5433.47-
FLEURS (lower is better)--0.069*0.080.09-
Long Context
MRCR v2 8 needle 128k (average)66.4%44.1%43.4%25.4%19.1%13.5%

*Excluding Chinese language.

Core Capabilities

Gemma 4 models handle a broad range of tasks across text, vision, and audio. Key capabilities include:

  • Thinking – Built-in reasoning mode that lets the model think step-by-step before answering.
  • Long Context – Context windows of up to 128K tokens (E2B/E4B) and 256K tokens (12B, 26B A4B/31B).
  • Image Understanding – Object detection, Document/PDF parsing, screen and UI understanding, chart comprehension, OCR (including multilingual), handwriting recognition, and pointing. Images can be processed at variable aspect ratios and resolutions.
  • Video Understanding – Analyze video by processing sequences of frames.
  • Interleaved Multimodal Input – Freely mix text and images in any order within a single prompt.
  • Function Calling – Native support for structured tool use, enabling agentic workflows.
  • Coding – Code generation, completion, and correction.
  • Multilingual – Out-of-the-box support for 35+ languages, pre-trained on 140+ languages.
  • Audio (E2B, E4B, and 12B only) – Automatic speech recognition (ASR) and speech-to-translated-text translation across multiple languages.

Getting Started

You can use all Gemma 4 models with the latest version of Transformers. To get started, install the necessary dependencies in your environment:

pip install -U transformers torch accelerate

Once you have everything installed, you can proceed to load the model with the code below:

from transformers import AutoProcessor, AutoModelForMultimodalLM

MODEL_ID = "google/gemma-4-E4B-it"

# Load model
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
    MODEL_ID,
    dtype="auto",
    device_map="auto"
)

Once the model is loaded, you can start generating output:

# Prompt
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Write a short joke about saving RAM."},
]

# Process input
inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
    add_generation_prompt=True,
    enable_thinking=False
).to(model.device)
input_len = inputs["input_ids"].shape[-1]

# Generate output
outputs = model.generate(**inputs, max_new_tokens=1024)
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)

# Parse output
processor.parse_response(response, prefix=inputs["input_ids"])

To enable reasoning, set enable_thinking=True and the parse_response function will take care of parsing the thinking output.

Below, you will also find snippets for processing audio (E2B, E4B, 12B only), images, and video alongside text:

Make sure to install the following packages:

pip install -U transformers torch torchvision librosa accelerate

You can then load the model with the code below:

from transformers import AutoProcessor, AutoModelForMultimodalLM

MODEL_ID = "google/gemma-4-E4B-it"

# Load model
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
    MODEL_ID, 
    dtype="auto", 
    device_map="auto"
)

Once the model is loaded, you can start generating output by directly referencing the audio URL in the prompt:

# Prompt - add audio after text
messages = [
    {
        "role": "user",
        "content": [
            {"type": "text", "text": "Transcribe the following speech segment in its original language. Follow these specific instructions for formatting the answer:\n* Only output the transcription, with no newlines.\n* When transcribing numbers, write the digits, i.e. write 1.7 and not one point seven, and write 3 instead of three."},
            {"type": "audio", "audio": "https://raw.githubusercontent.com/google-gemma/cookbook/refs/heads/main/apps/sample-data/journal1.wav"},
        ]
    }
]

# Process input
inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
    add_generation_prompt=True,
).to(model.device)
input_len = inputs["input_ids"].shape[-1]

# Generate output
outputs = model.generate(**inputs, max_new_tokens=512)
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)

# Parse output
processor.parse_response(response, prefix=inputs["input_ids"])

Make sure to install the following packages:

pip install -U transformers torch torchvision accelerate

You can then load the model with the code below:

from transformers import AutoProcessor, AutoModelForMultimodalLM

MODEL_ID = "google/gemma-4-E4B-it"

# Load model
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
    MODEL_ID, 
    dtype="auto", 
    device_map="auto"
)

Once the model is loaded, you can start generating output by directly referencing the image URL in the prompt:

# Prompt - add image before text
messages = [
    {
        "role": "user", "content": [
            {"type": "image", "url": "https://raw.githubusercontent.com/google-gemma/cookbook/refs/heads/main/apps/sample-data/GoldenGate.png"},
            {"type": "text", "text": "What is shown in this image?"}
        ]
    }
]

# Process input
inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
    add_generation_prompt=True,
).to(model.device)
input_len = inputs["input_ids"].shape[-1]

# Generate output
outputs = model.generate(**inputs, max_new_tokens=512)
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)

# Parse output
processor.parse_response(response, prefix=inputs["input_ids"])

Make sure to install the following packages:

pip install -U transformers torch torchvision librosa accelerate

You can then load the model with the code below:

from transformers import AutoProcessor, AutoModelForMultimodalLM

MODEL_ID = "google/gemma-4-E4B-it"

# Load model
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
    MODEL_ID, 
    dtype="auto", 
    device_map="auto"
)

Once the model is loaded, you can start generating output by directly referencing the video URL in the prompt:

# Prompt - add video before text
messages = [
    {
        'role': 'user',
        'content': [
            {"type": "video", "video": "https://github.com/bebechien/gemma/raw/refs/heads/main/videos/ForBiggerBlazes.mp4"},
            {'type': 'text', 'text': 'Describe this video.'}
        ]
    }
]

# Process input
inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
    add_generation_prompt=True,
).to(model.device)
input_len = inputs["input_ids"].shape[-1]

# Generate output
outputs = model.generate(**inputs, max_new_tokens=512)
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)

# Parse output
processor.parse_response(response, prefix=inputs["input_ids"])

Best Practices

For the best performance, use these configurations and best practices:

1. Sampling Parameters

Use the following standardized sampling configuration across all use cases:

  • temperature=1.0
  • top_p=0.95
  • top_k=64

2. Thinking Mode Configuration

Compared to Gemma 3, the models use standard system, assistant, and user roles. To properly manage the thinking process, use the following control tokens:

  • Trigger Thinking: Thinking is enabled by including the <|think|> token at the start of the system prompt. To disable thinking, remove the token.
  • Standard Generation: When thinking is enabled, the model will output its internal reasoning followed by the final answer using this structure:
    <|channel>thought\n[Internal reasoning]<channel|>
  • Disabled Thinking Behavior: For all models except for the E2B and E4B variants, if thinking is disabled, the model will still generate the tags but with an empty thought block:
    <|channel>thought\n<channel|>[Final answer]

[!Note] Note that many libraries like Transformers and llama.cpp handle the complexities of the chat template for you.

3. Multi-Turn Conversations

  • No Thinking Content in History: In multi-turn conversations, the historical model output should only include the final response. Thoughts from previous model turns must not be added before the next user turn begins, with the exception of tool call turns where thinking content should be preserved.

4. Modality order

For optimal performance with multimodal inputs, place:

  • Image content before the text in your prompt.
  • Audio content after the text in your prompt.

5. Variable Image Resolution

Aside from variable aspect ratios, Gemma 4 supports variable image resolution through a configurable visual token budget, which controls how many tokens are used to represent an image. A higher token budget preserves more visual detail at the cost of additional compute, while a lower budget enables faster inference for tasks that don't require fine-grained understanding.

  • The supported token budgets are: 70, 140, 280, 560, and 1120.
    • Use lower budgets for classification, captioning, or video understanding, where faster inference and processing many frames outweigh fine-grained detail.
    • Use higher budgets for tasks like OCR, document parsing, or reading small text.

6. Audio

Use the following prompt structures for audio processing:

  • Audio Speech Recognition (ASR)
Transcribe the following speech segment in {LANGUAGE} into {LANGUAGE} text.

Follow these specific instructions for formatting the answer:
* Only output the transcription, with no newlines.
* When transcribing numbers, write the digits, i.e. write 1.7 and not one point seven, and write 3 instead of three.
  • Automatic Speech Translation (AST)
Transcribe the following speech segment in {SOURCE_LANGUAGE}, then translate it into {TARGET_LANGUAGE}.
When formatting the answer, first output the transcription in {SOURCE_LANGUAGE}, then one newline, then output the string '{TARGET_LANGUAGE}: ', then the translation in {TARGET_LANGUAGE}.

7. Audio and Video Length

All models support image inputs and can process videos as frames whereas the E2B, E4B, and 12B models also support audio inputs. Audio supports a maximum length of 30 seconds. Video supports a maximum of 60 seconds assuming the images are processed at one frame per second.

Model Data

Data used for model training and how the data was processed.

Training Dataset

Our pre-training dataset is a large-scale, diverse collection of data encompassing a wide range of domains and modalities, which includes web documents, code, images, audio, with a cutoff date of January 2025. Here are the key components:

  • Web Documents: A diverse collection of web text ensures the model is exposed to a broad range of linguistic styles, topics, and vocabulary. The training dataset includes content in over 140 languages.
  • Code: Exposing the model to code helps it to learn the syntax and patterns of programming languages, which improves its ability to generate code and understand code-related questions.
  • Mathematics: Training on mathematical text helps the model learn logical reasoning, symbolic representation, and to address mathematical queries.
  • Images: A wide range of images enables the model to perform image analysis and visual data extraction tasks.

The combination of these diverse data sources is crucial for training a powerful multimodal model that can handle a wide variety of different tasks and data formats.

Data Preprocessing

Here are the key data cleaning and filtering methods applied to the training data:

  • CSAM Filtering: Rigorous CSAM (Child Sexual Abuse Material) filtering was applied at multiple stages in the data preparation process to ensure the exclusion of harmful and illegal content.
  • Sensitive Data Filtering: As part of making Gemma pre-trained models safe and reliable, automated techniques were used to filter out certain personal information and other sensitive data from training sets.
  • Additional methods: Filtering based on content quality and safety in line with our policies.

Ethics and Safety

As open models become central to enterprise infrastructure, provenance and security are paramount. Developed by Google DeepMind, Gemma 4 undergoes the same rigorous safety evaluations as our proprietary Gemini models.

Evaluation Approach

Gemma 4 models were developed in partnership with internal safety and responsible AI teams. A range of automated as well as human evaluations were conducted to help improve model safety. These evaluations align with Google’s AI principles, as well as safety policies, which aim to prevent our generative AI models from generating harmful content, including:

  • Content related to child sexual abuse material and exploitation
  • Dangerous content (e.g., promoting suicide, or instructing in activities that could cause real-world harm)
  • Sexually explicit content
  • Hate speech (e.g., dehumanizing members of protected groups)
  • Harassment (e.g., encouraging violence against people)

Evaluation Results

For all areas of safety testing, we saw major improvements in all categories of content safety relative to previous Gemma models. Overall, Gemma 4 models significantly outperform Gemma 3 and 3n models in improving safety, while keeping unjustified refusals low. All testing was conducted without safety filters to evaluate the model capabilities and behaviors. For both text-to-text and image-to-text, and across all model sizes, the model produced minimal policy violations, and showed significant improvements over previous Gemma models' performance.

Usage and Limitations

These models have certain limitations that users should be aware of.

Intended Usage

Multimodal models (capable of processing vision, language, and/or audio) have a wide range of applications across various industries and domains. The following list of potential uses is not comprehensive. The purpose of this list is to provide contextual information about the possible use-cases that the model creators considered as part of model training and development.

  • Content Creation and Communication
    • Text Generation: These models can be used to generate creative text formats such as poems, scripts, code, marketing copy, and email drafts.
    • Chatbots and Conversational AI: Power conversational interfaces for customer service, virtual assistants, or interactive applications.
    • Text Summarization: Generate concise summaries of a text corpus, research papers, or reports.
    • Image Data Extraction: These models can be used to extract, interpret, and summarize visual data for text communications.
    • Audio Processing and Interaction: The E2B, E4B, and 12B models can analyze and interpret audio inputs, enabling voice-driven interactions and transcriptions.
  • Research and Education
    • Natural Language Processing (NLP) and VLM Research: These models can serve as a foundation for researchers to experiment with VLM and NLP techniques, develop algorithms, and contribute to the advancement of the field.
    • Language Learning Tools: Support interactive language learning experiences, aiding in grammar correction or providing writing practice.
    • Knowledge Exploration: Assist researchers in exploring large bodies of text by generating summaries or answering questions about specific topics.

Limitations

  • Training Data
    • The quality and diversity of the training data significantly influence the model's capabilities. Biases or gaps in the training data can lead to limitations in the model's responses.
    • The scope of the training dataset determines the subject areas the model can handle effectively.
  • Context and Task Complexity
    • Models perform well on tasks that can be framed with clear prompts and instructions. Open-ended or highly complex tasks might be challenging.
    • A model's performance can be influenced by the amount of context provided (longer context generally leads to better outputs, up to a certain point).
  • Language Ambiguity and Nuance
    • Natural language is inherently complex. Models might struggle to grasp subtle nuances, sarcasm, or figurative language.
  • Factual Accuracy
    • Models generate responses based on information they learned from their training datasets, but they are not knowledge bases. They may generate incorrect or outdated factual statements.
  • Common Sense
    • Models rely on statistical patterns in language. They might lack the ability to apply common sense reasoning in certain situations.

Ethical Considerations and Risks

The development of vision-language models (VLMs) raises several ethical concerns. In creating an open model, we have carefully considered the following:

  • Bias and Fairness
    • VLMs trained on large-scale, real-world text and image data can reflect socio-cultural biases embedded in the training material. Gemma 4 models underwent careful scrutiny, input data pre-processing, and post-training evaluations as reported in this card to help mitigate the risk of these biases.
  • Misinformation and Misuse
    • VLMs can be misused to generate text that is false, misleading, or harmful.
    • Guidelines are provided for responsible use with the model, see the Responsible Generative AI Toolkit.
  • Transparency and Accountability
    • This model card summarizes details on the models' architecture, capabilities, limitations, and evaluation processes.
    • A responsibly developed open model offers the opportunity to share innovation by making VLM technology accessible to developers and researchers across the AI ecosystem.

Risks identified and mitigations:

  • Generation of harmful content: Mechanisms and guidelines for content safety are essential. Developers are encouraged to exercise caution and implement appropriate content safety safeguards based on their specific product policies and application use cases.
  • Misuse for malicious purposes: Technical limitations and developer and end-user education can help mitigate against malicious applications of VLMs. Educational resources and reporting mechanisms for users to flag misuse are provided.
  • Privacy violations: Models were trained on data filtered for removal of certain personal information and other sensitive data. Developers are encouraged to adhere to privacy regulations with privacy-preserving techniques.
  • Perpetuation of biases: It's encouraged to perform continuous monitoring (using evaluation metrics, human review) and the exploration of de-biasing techniques during model training, fine-tuning, and other use cases.

Benefits

At the time of release, this family of models provides high-performance open vision-language model implementations designed from the ground up for responsible AI development compared to similarly sized models.

Citation

If you find our work helpful, please consider citing it:

@misc{gemmateam2026gemma4,
      title={Gemma 4 Technical Report}, 
      author={Gemma Team},
      year={2026},
      eprint={2607.02770},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2607.02770}, 
}

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

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

GPU в ailist

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

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

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

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

0 моделей