Skip to content
Computer vision

medgemma-2-E4B-it-UNCENSORED-heretic

медицинская MedGemma 2 без жёсткой цензуры

2 min readupdated

Это децензурированная версия мультимодальной медицинской модели google/medgemma-2-E4B-it от автора xtools-at, полученная с помощью инструмента Heretic. Исходная модель на базе архитектуры Gemma 4 (около 7.94B общих параметров и 4.5B эффективных) умеет работать с текстом, медицинскими изображениями, видео и аудио, но в оригинале отказывается отвечать почти на любые чувствительные запросы (98 отказов из 100). После абляции с помощью метода ARA (Arbitrary-Rank Ablation — точечное удаление направлений отказа в весах слоёв) доля отказов снизилась до 4 из 100 при минимальном отклонении от исходного поведения. Подойдёт разработчикам локальных медицинских ассистентов и исследователям, которым мешают ложные срабатывания фильтров безопасности при работе с клиническими случаями.

Ключевые особенности

  • Резкое снижение отказов: показатель Refusals упал с 98/100 у оригинальной MedGemma 2 4B до 4/100.
  • Сохранение исходных знаний: низкое значение KL divergence (0.0641 — мера расхождения распределений ответов с базовой моделью) указывает на то, что медицинская база и логика рассуждений почти не затронуты.
  • Мультимодальный вход (any-to-any): модель принимает текст, 2D/3D-снимки, видео, PDF-документы и медицинское аудио, выдавая текстовый ответ.
  • Длинный контекст: поддерживает контекстное окно до 128K токенов для анализа историй болезни и EHR (электронных медицинских карт).

Что можно сделать

  • Локальный ассистент для разбора клинических кейсов: запускать через transformers для анализа симптомов, снимков и выписок без постоянных блокировок со стороны встроенной цензуры.
  • Парсинг медицинских документов и рецептов: извлекать структурированные данные из лабораторных отчётов и PDF-файлов в формат JSON.
  • Расшифровка и анализ врачебной диктовки: использовать встроенный аудиоэнкодер для транскрибации и суммаризации медицинских записей.

Пример

Сценарий из карточки: передача неструктурированного PDF-отчёта лаборатории или клинической выписки с запросом на извлечение показателей и диагнозов в структурированный JSON — модель отвечает по существу, не прерывая генерацию из-за упоминания заболеваний, препаратов или чувствительных симптомов.

ПодробнееОтказы (Refusals): 4/100 против 98/100 у оригинала; KL divergence: 0.0641.
Модификация выполнена через Heretic v2.2.0.dev0 (ARA по слоям 21–28, neighbor_count = 13).
База: google/medgemma-2-E4B-it (Gemma 4 E4B, 42 слоя, 7.94B параметров, контекст 128K).
Библиотека запуска: transformers; исходная лицензия базы — HAI-DEF Terms of Use.
Discuss Telegram 2 19

Will it run?

Runs in BF16

Fits without quantisation.

  • BF16weights 15 GB · ready files17 GB
  • FP8 / INT8recommendedweights 7.4 GB8.6 GB
  • 4-bitweights 4.2 GB5.1 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

What to get for this model

Massed ComputeOpen Massed Compute

Your own GPU: FP8 / INT8 — from RTX 3080 · BF16 — from RTX 4090

Massed Compute hourly prices, November 2026. The discounted price applies with the coupon at checkout.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # xtools-at/medgemma-2-E4B-it-UNCENSORED-heretic
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download xtools-at/medgemma-2-E4B-it-UNCENSORED-heretic --local-dir ~/models/medgemma-2-E4B-it-UNCENSORED-heretic
    # The model is in ~/models. How to run it is in the model card (link above).
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b42from December 2, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of medgemma-2-E4B-it (quants, finetunes, LoRAs) will show up under the bell.

Quantised versions 11All on Hugging Face
Fine-tunes 2All on Hugging Face

About the model

xtools-at/medgemma-2-E4B-it-UNCENSORED-heretic
Author
xtools-at
Category
Computer vision
Released
Posted

On NeyroLearn

Hugging Face

192

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments