/ Модель

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

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

gemma-4-E2B-it-enja-aggr

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

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

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

Агрессивно сокращённая по словарю мультимодальная Gemma 4 E2B IT для диалогов и задач на английском и японском языках с уменьшенным размером текстовой модели.

Это агрессивно сокращённая по словарю версия мультимодальной Gemma 4 E2B IT от Google DeepMind, подготовленная brishen. Размер словаря уменьшен с 262 144 до 131 648 токенов без переобучения весов: число параметров текстовой части сократилось с 4,65 до 3,28 млрд, а размер чекпойнта — с 10,25 до 7,51 ГБ. Архитектура Gemma4ForConditionalGeneration; сохранены компоненты для обработки текста, изображений и аудио.

Модель предназначена прежде всего для диалогов и других задач базовой Gemma 4 на английском и японском языках при меньших требованиях к хранению. На этих языках в приведённых zero-shot тестах её результаты близки к исходной модели. Токены чата, инструментов, изображений и аудио сохранены, однако обработка изображений и аудио в этой версии не проверялась.

Для языков с удалёнными токенами, включая русский, качество заметно снижается: текст обрабатывается через byte fallback. Другие латинские языки также могут работать хуже, а редкие английские слова и идентификаторы могут разбиваться на более мелкие токены. Репозиторий распространяется по лицензии Apache-2.0.

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

  • англоязычные диалоги с локально размещённой моделью
  • ответы на вопросы и рассуждения на английском языке
  • диалоги и ответы на вопросы на японском языке
  • снижение объёма хранения чекпойнта Gemma 4 E2B IT

Ограничения

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

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

gemma-4-E2B-it-enja-aggr

google/gemma-4-E2B-it with its vocabulary pruned to English and Japanese (aggressive variant): 262,144 → 131,648 tokens (−50%). The model weights are otherwise unchanged; no retraining was done.

Gemma 4 E2B has a 262,144 × 8,960 per-layer embedding table in addition to its 262,144 × 1,536 input/output embedding, so every dropped token saves 10,496 parameters. That makes the vocabulary roughly half of the text model.

originalthis model
vocab262,144131,648
text-model params4.65B3.28B (−30%)
checkpoint (incl. vision/audio towers)10.25 GB7.51 GB
full fine-tune AdamW state (16 B/param)74.4 GB52.4 GB
fp32 logits per 16k-token batch17.2 GB8.6 GB

See also brishen/gemma-4-E2B-it-enja, the conservative variant (164,224 tokens), which keeps every ASCII token and is the safer default.

What was removed

  • Tokens containing scripts other than Latin, kana and Japanese kanji (Cyrillic, Hangul, Arabic, Thai, Devanagari, simplified-only Han, ...), plus the <unusedN> placeholders.
  • Multi-character Han words and accented Latin words that do not occur in English/Japanese corpora (Japanese Wikipedia, KFTT, ParallelFiction, wikitext-103, FineWeb-Edu).
  • In this variant, multi-letter ASCII tokens are also kept only if seen in English, Japanese or code corpora (The Stack smol-xl, 24 languages). That removes diacritic-free words of other Latin-script languages (Indonesian, Dutch, ...), but rare English words and identifiers now split into smaller pieces.

Always kept: special and control tokens (chat, tool, image, audio), all 256 <0xNN> byte-fallback tokens, kana, single kanji in the cp932 repertoire, punctuation, symbols and emoji.

The keep set is closed under BPE merges. As a result, text whose original tokenization used only kept tokens tokenizes identically, with ids remapped, and on kept tokens the logits are bit-identical to the original model's. Text in removed scripts still round-trips through byte fallback, but the model becomes much worse at it.

prune_manifest.json lists keep_ids: entry i is the original token id of new token i.

Evaluation

Zero-shot, greedy decoding. In parentheses: the share of examples where this model's prediction or output is identical to the original's.

taskoriginalthis model
MMLU (EN, 2,000 sampled)56.95%56.85% (99.0% identical predictions)
JCommonsenseQA (JA, 1,119)87.94%87.94% (100%)
MGSM-en (250)87.2%88.0% (83.6% identical outputs)
MGSM-ja (250)63.6%63.2% (99.6%)
WMT24++ en→ja chrF (500)35.2935.27 (86.4%)
WMT24++ ja→en chrF (500)50.4250.39 (95.0%)
bits/byte, EN (wikitext-103 test) / JA (BSD test)1.7645 / 1.28901.7675 / 1.2882
documents tokenized identically, EN / JA—70.8% / 100%

None of the differences is statistically significant (95% paired-bootstrap CIs include 0). Out of scope, as intended: zh/ko/ru bits-per-byte ×2–4 (byte fallback); de/fr/es +35–39%.

Usage

Use it exactly like the base model; the chat template and processor config are unchanged.

from transformers import AutoModelForCausalLM, AutoTokenizer

tok = AutoTokenizer.from_pretrained("brishen/gemma-4-E2B-it-enja-aggr")
model = AutoModelForCausalLM.from_pretrained("brishen/gemma-4-E2B-it-enja-aggr", dtype="bfloat16", device_map="auto")
msgs = [{"role": "user", "content": "日本の首都はどこですか?"}]
prompt = tok.apply_chat_template(msgs, add_generation_prompt=True, tokenize=False)
inputs = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Limitations

  • Only text was evaluated. The vision and audio towers are included unchanged, and their placeholder token ids were remapped in config.json, but image and audio inputs have not been tested.
  • Languages other than English and Japanese degrade sharply.
  • The original's <unusedN> tokens are gone. To add new special tokens, prune with --keep-unused or resize the embeddings.

Reproduce

Made with the pruning/eval code in gemma-4-pruned: uv run gemma-prune --ascii-policy evidence --out models/gemma-4-E2B-it-enja-aggr.

License

Apache 2.0, inherited from Gemma 4. See the Gemma 4 license. Original model by Google DeepMind.

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

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

GPU в ailist

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

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

Any-to-any модели пока не поддерживаются.

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

0 моделей