Skip to content
Other

1⃣ clm-system1-medmcqa-granite-4.2-3b

быстрый выбор ответа в медицинских тестах без генерации текста

2 min readupdated

Исследовательский прототип от автора pavanmantha для решения медицинских тестов с выбором одного из четырёх вариантов. Вместо долгой пошаговой генерации текста («System 2») модель работает в один проход: замороженная языковая модель ibm-granite/granite-4.2-3b (на 3 млрд параметров) превращает вопрос и каждый вариант ответа в векторы, а две обученные «головы» (небольшие нейросетевые проекторы) переводят их в общее 512-мерное пространство и выбирают самый близкий по косинусному сходству вариант. Такой подход сильно экономит вычисления по сравнению с обычными LLM (большими языковыми моделями), но пока точность составляет 42,5% — модель создана для экспериментов с архитектурой, а не для реальной медицины.

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

  • Работа в один проход: модель не генерирует рассуждения токен за токеном, а сразу сравнивает эмбеддинги (векторные представления) вопроса и вариантов ответа.
  • Две обученные головы: веса базовой ibm-granite/granite-4.2-3b в формате bfloat16 полностью заморожены; обучались только две MLP-головы (для вопроса и для ответов) и один параметр масштаба.
  • Признаки с 8 слоёв: для каждого текста извлекаются скрытые состояния последнего токена с 8 разных глубин сети (от 25% до 100%), нормализуются и склеиваются в вектор размерностью 20 480.
  • Контрастивное обучение: головы обучались с функцией потерь InfoNCE на 134 416 вопросах из датасета MedMCQA (вступительные медицинские экзамены в Индии).

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

  • Изучить подход «System 1» для тестов: использовать код и архитектуру как референс для быстрой классификации и выбора вариантов без авторегрессионной генерации.
  • Проверить на других доменах: взять пайплайн с извлечением скрытых состояний из разных слоёв Granite 4.2 3B и обучить лёгкие головы под свои задачи multiple-choice на английском языке.
  • Сравнить с полным файнтюном: использовать модель как базовый ориентир (baseline) при исследовании того, насколько проекторы поверх замороженной LLM уступают полноценному обучению или Chain-of-Thought.

Пример

import sys
from pathlib import Path
from huggingface_hub import hf_hub_download

sys.path.insert(0, str(Path(hf_hub_download("pavanmantha/clm-system1-medmcqa-granite-4.2-3b", "clm_inference.py")).parent))
from clm_inference import SystemOneModel

model = SystemOneModel.from_pretrained("pavanmantha/clm-system1-medmcqa-granite-4.2-3b")
options = ["Vitamin A", "Vitamin B12", "Vitamin C", "Vitamin D"]
print(options[model.choose("Scurvy is caused by deficiency of which vitamin?", options)])
Подробнее Точность на тестовой выборке MedMCQA (3842 вопроса): 42,5% ± 0,5% (для опубликованного seed 42 — 42,6%) против 25,0% при случайном угадывании и 30,8% без обученных голов.
На вопросах с отрицаниями (EXCEPT / NOT) точность падает до 35,8%, на остальных составляет 44,1%.
Ограничения: только английский язык, максимум 4 варианта ответа, вопрос и варианты кодируются раздельно без взаимного контекста.
Непригодна для клинической практики и реальных медицинских решений; при первом запуске скачивает базовую модель ibm-granite/granite-4.2-3b.
Discuss Telegram 0 15

Will it run?

Runs in BF16

Fits without quantisation.

  • BF16weights 0.4 GB · ready files0.9 GB
  • FP8 / INT8recommendedweights 0.2 GB0.7 GB
  • 4-bitweights 0.1 GB0.6 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 2060 · BF16 — from RTX 2060

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.

    # pavanmantha/clm-system1-medmcqa-granite-4.2-3b
    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 pavanmantha/clm-system1-medmcqa-granite-4.2-3b --local-dir ~/models/clm-system1-medmcqa-granite-4.2-3b
    # 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.0b40from November 18, 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, 2026new release

    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

  1. granite-4.1-3b-basefamily root
  2. granite-4.2-3b
  3. clm-system1-medmcqa-granite-4.2-3b

New posts about versions of granite-4.1-3b-base (quants, finetunes, LoRAs) will show up under the bell.

Quantised versions 3All on Hugging Face
Fine-tunes 9All on Hugging Face
LoRAs and adapters 3All on Hugging Face

About the model

pavanmantha/clm-system1-medmcqa-granite-4.2-3b
Author
pavanmantha
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

150

Ask AI about this model

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

Comments