/ Модель

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

Размер весов
6,1 ГБ
Лицензия
Apache 2.0
Архитектура
gemma4 · dense
Базовая модель
gemma-4-E4B-it-qat-q4_0-unquantized
Опубликована
20 окт 2026

gemma-4-E4B-it-qat-mlx

Изображение и текст → текст6 профессий
142скачиваний за 30 дней0лайковвеса обновлены13 ноя 2026

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

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

Квантованная для MLX мультимодальная Gemma 4 E4B предназначена для диалогов, анализа изображений и распознавания речи.

Это конвертированная для MLX сборка Gemma 4 E4B от Google DeepMind, подготовленная автором репозитория bambocher на основе QAT-весов Google. Текстовый декодер использует 4-битную сетку q4_0, на которой модель обучалась с учётом квантования; 114 наиболее чувствительных линейных слоёв оставлены в 8 битах. Эмбеддинги хранятся в 6 битах, а башни обработки изображений и аудио — в 8 битах. Репозиторий содержит веса safetensors и рассчитан на запуск в MLX.

Модель предназначена для диалогов и генерации текста, а также для анализа изображений и распознавания речи. Автор сообщает о проверке ответов в чате, распознавании животного на фотографии и транскрибировании речи. Размер сборки — около 5,95 ГБ; в тесте автора на MacBook Air M5 скорость декодирования составила 34,9 токена в секунду. Лицензия — Apache-2.0.

Результаты и скорость приведены автором репозитория для конкретных тестов и оборудования и не гарантируют аналогичного качества или производительности в других условиях. Карточка не сообщает поддерживаемые естественные языки или длину контекста; для использования необходим совместимый стек MLX.

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

  • ответы в диалоге и генерация текста
  • определение объектов и животных на фотографиях
  • распознавание и транскрибирование речи
  • запуск мультимодальной Gemma 4 на устройствах Apple с MLX

Ограничения

В README не перечислены поддерживаемые языки и длина контекста. Приведённые показатели качества и скорости относятся к тестам автора на конкретном оборудовании; для запуска требуется совместимая среда MLX.

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

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

Gemma 4 E4B — Google's QAT on its exact q4_0 grid, MLX (text + vision + audio + MTP)

Google trained Gemma 4 E4B with quantization-aware training (QAT) for llama.cpp's q4_0. This is that model in MLX, on the very grid the QAT trained for. The text decoder's 4-bit codes are the very ones in Google's own q4_0 GGUF, block for block; only their scales are rounded from fp16 to bf16 (MLX's scale type). On top of that, the 114 Linears that lose the most at 4-bit are kept at 8-bit, which costs 100 MB. The vision and audio towers are included.

This replaces an earlier release

This repo held a GPTQ JANG-mixed quantization of the non-QAT google/gemma-4-E4B-it (it was roman220220/gemma-4-E4B-it-gptq-mlx-jang, and that name redirects here). This build is made from Google's QAT release instead. On the same raw-text test it scores PPL 41.9 against 82.3, at 5.95 GB against 6.8 GB, and it decodes a little faster. Part of that PPL gap is the checkpoint itself, since the QAT fine-tune scores raw text better, but that difference is exactly what moving to it gains. The old files were removed.

How it's made

  • The QAT grid, exactly. Google's GGUF is q4_0 of the -qat-q4_0-unquantized master weights: every block's scale and every code matches. MLX's affine 4-bit with group 32 stores scale·q + bias; with scale = d and bias = -8d that is q4_0's grid itself. 228 Linears are written this way, and each is checked against the GGUF at conversion. The one difference is that the fp16 scale is rounded to bf16, MLX's scale dtype: under 1/64 of a step per weight.

  • Why not the usual conversions:

    • mlx_lm.convert -q refits every group's min/max;
    • mlx-community's qat builds use group 64, which spans two q4_0 blocks, and keep every MLP at 8-bit.

    Both move the weights off the grid the QAT trained for.

  • A few Linears at 8-bit, chosen by measurement. Each of the text Linears was raised to 8-bit on its own and scored by the KL divergence it removes, against the bf16 QAT master weights, per MB it adds. The best 114 fit in +100 MB. Mostly the small per-layer input gates and projections (60) and attention projections (53); one MLP Linear.

  • Everything else follows Google's own split:

    • embeddings at 6-bit, as the GGUF's Q6_K;
    • vision and audio towers, which were never QAT-trained, at 8-bit;
    • norms as they are.

Measured

Raw-text perplexity on wikitext-2 (test), 128 windows of 512 tokens, BOS at the start of each. KL divergence and top-1 agreement are measured to the bf16 QAT master weights, the model this one reproduces.

modelsizePPLKL to QAT mastertop-1 agree
QAT master weights, bf16 (google/gemma-4-E4B-it-qat-q4_0-unquantized)—42.4——
this model5.95 GB41.90.02692.5%
mlx-community/gemma-4-E4B-it-qat-4bit6.80 GB45.40.05589.0%

How to read it:

  • KL and top-1 measure faithfulness; a lower KL is closer.
  • PPL a little below the master's is within the noise of a raw-text test.
  • It also reflects how QAT works: the network was trained through the 4-bit weights, so the q4_0 model is the one that was trained, and the bf16 master is its shadow copy.

Speed (MacBook Air M5, mlx-lm, decode)

buildtokens/s
this model34.9
mlx-community/gemma-4-E4B-it-qat-4bit26.0
our earlier GPTQ JANG build33.6

34% faster than mlx-community's QAT build, and a little faster than the GPTQ release this one replaces.

Checked

  • It answers in chat.
  • It names the animal in a photo.
  • It transcribes speech through the audio tower.
  • No large weight is left unquantized.

Method / code

rromenskyi/quant-ternary/gemma4-quant has the code and the full lab notes (docs/FINDINGS.md, "Gemma 4 QAT in MLX on the q4_0 grid"):

  • qat_mlx_pipeline.sh: one pipeline for every Gemma 4 size;
  • qat_aligned_convert.py;
  • qat_sensitivity.py;
  • qat_eval.py.

License

Licensed under the Apache License 2.0, the same license as the base model — see LICENSE.

Modified from google/gemma-4-E4B-it-qat-q4_0-unquantized (the QAT release of google/gemma-4-E4B-it): quantized to MLX. The text decoder's Linears are on Google's q4_0 grid; 114 of them, the embeddings and the vision/audio towers are at 6/8-bit. The weights and configuration files in this repo are therefore modified versions of the original, not the original files.

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

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

GPU в ailist

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

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

MLX-модели работают только на Apple Silicon, на GPU NVIDIA они не запускаются.

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

0 моделей