/ Модель

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

Контекст
8 192 токена
Параметры
149 млн
Лицензия
CC BY-NC 4.0
Архитектура
modernbert · dense
Базовая модель
moBERTo
Библиотека
transformers
Опубликована
28 сен 2026

dinah-0

Классификация текстаТекст → label

Dinah-0 — компактный encoder на базе ModernBERT для классификации вариантов и принятия типизированных решений на английском и португальском языках.

149скачиваний за 30 дней5лайковвеса обновлены12 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

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

Dinah-0 — encoder-модель примерно на 149 млн параметров, созданная Lukita как личный учебный проект на базе Tropic-AI/moBERTo и дообученная для выдачи типизированных решений на английском и португальском языках. Модель использует архитектуру ModernBERT с контекстом до 8192 токенов и рассчитана на работу, в том числе на CPU; доступны веса safetensors и формат ONNX с квантованием int8 для CPU.

Модель принимает инструкцию, состояние и варианты ответа, затем выдаёт вероятности по вариантам и оценку уверенности. Она поддерживает классификацию вариантов, оценку истинности утверждения и оценивание по упорядоченной шкале. Её можно применять для маршрутизации запросов, выбора инструмента и проверки извлечённых данных. Текст не генерирует; знания о фактах, отсутствующих во входных данных, ограничены, а арифметические сравнения ненадёжны. Запросы длиннее 8192 токенов завершаются ошибкой; оценка уверенности в этой версии не откалибрована. Модель выпущена под лицензией CC BY-NC 4.0, допускающей использование на некоммерческих условиях.

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

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

Ограничения

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

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

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

Открыть на Hugging Face

Dinah-0

A 150M-parameter encoder that makes typed decisions, in English and Portuguese, on a CPU.

Answers the same typed-decision format as Jev (choice, noul, score, with probabilities and confidence). Not affiliated with TypeSafe.

Need commercial use? Dinah-0 Apache is the same Dinah-0 retrained without the non-commercial data and released under Apache-2.0. It scores about 0.2 points lower on the Decision Index 0.3 (25.86 against 26.06).

  • Best model under 1B parameters on the Decision Index 0.2.1 (27.63; the next one under 1B scores 19.22)
  • Best encoder on the board (Decision Index 0.2.1)
  • Ahead of models with 2B to 4.7B parameters (Decision Index 0.2.1), running on a CPU with ~150 MB on disk
  • On the current Decision Index 0.3 (live board, 2026-10-10): public index 26.06, full score 13.87. The three points above are for edition 0.2.1; the 0.3 board has more entrants, including a 0.9B model above Dinah-0 on the public index.

The full story (how it was trained, evaluated and what went wrong along the way): lukita.me/posts/dinah-0-en (in Portuguese: lukita.me/posts/dinah-0).

Dinah-0 reads a question (instructions, state and a set of options) and returns a probability distribution over the options. The same model answers three question types:

TypeOutput
choicethe chosen label, a confidence and the probability of every label
noulthe probability that a statement is true
scorethe expected value on an ordered rubric, plus confidence and probabilities

It does not generate text. It is built for classification, routing, tool selection, extraction checks and similar decisions where a small, fast and cheap model is enough.

Results

Decision Index 0.2.1

Measured with the official kit and scorer (commit 87d4650) and the engine in this repository (decision_index_engine.py at revision e6bfc33), on the full suite (38 benchmarks, 150,759 requests), in bfloat16 on one RTX PRO 4000 Blackwell. Nothing was truncated: the 324 requests longer than 8,192 tokens were refused and count as wrong. Self-reported; the submission to the official leaderboard is pending. Median latency in that run: 5.6 ms per request.

Score
Index (balanced skill)27.63
Raw index44.78
Knowledge & Reasoning0.191
Language Understanding0.227
Retrieval & Classification0.478
Tools & Automation0.379
Arts & Human Taste0.035

On the live leaderboard of 2026-09-28 this would rank 41st of 72, the best model under 1B parameters (the next one scores 19.22) and the best encoder, ahead of several models between 1.7B and 4.7B parameters.

Note on GSM8K: about 1.9 of these points come from a shortcut in the benchmark's multiple-choice GSM8K (the gold answer is always near the middle of the options), which Dinah-0 learned because its training used options in the same style. Without it the index would be 25.72 (43rd of 72), still the best under 1B and the best encoder. Reported to the maintainers in decision-index#32.

Other evaluations

Test setnAccuracy
typed-decisions test (English)2,00076.35%
typed-decisions test, Portuguese translation1,89578.15%
Lichess puzzles, best move among the candidates2,00062.00%

Dinah-0 was trained on the typed-decisions train split and on Lichess puzzles (with the test sets held out), so these are in-distribution numbers. The typed-decisions labels come from a teacher model, so accuracy there measures agreement with that teacher.

Speed

ContextCPU latency (Apple M5 laptop, int8 ONNX, 4 threads, batch 1)
512 tokens131 ms
2,048 tokens0.70 s
8,192 tokens6.5 s

Measured on an idle machine with an earlier checkpoint of the same architecture (latency depends only on the architecture). Peak memory is ~750 MB at 512 tokens and over 6 GB at 8,192.

Usage

dinah.py (in this repository) has the full input format and two backends with the same API.

pip install torch transformers safetensors huggingface_hub   # PyTorch backend
pip install onnxruntime transformers huggingface_hub         # ONNX int8 backend (CPU)
from huggingface_hub import hf_hub_download
import importlib.util, sys

path = hf_hub_download("Lukitaduarte/dinah-0", "dinah.py")
spec = importlib.util.spec_from_file_location("dinah", path)
dinah = importlib.util.module_from_spec(spec); sys.modules["dinah"] = dinah; spec.loader.exec_module(dinah)

model = dinah.DinahONNX.from_pretrained("Lukitaduarte/dinah-0")   # or dinah.Dinah for PyTorch

model.choice(
    state="The package arrived broken and I need it for tomorrow.",
    instructions="What does the customer want?",
    criteria={
        "refund": "The customer wants their money back",
        "replacement": "The customer wants a new unit sent",
        "complaint": "The customer only wants to complain",
    },
)
# {"type": "choice", "choice": ..., "confidence": ..., "probabilities": {...}}

model.noul(
    state="Hi, please cancel my subscription starting today.",
    instructions="Does the customer want to cancel?",
    true="The customer wants to cancel.",
    false="The customer does not want to cancel.",
)
# {"type": "noul", "noul": ...}
model.score(state="Great product, but shipping took three weeks.", instructions="Rate the review.",
            criteria=["very negative", "negative", "neutral", "positive", "very positive"])

state, instructions and each option can be a string or a JSON object/array. For noul, describe both poles (true and false): with only the statement, the model has a generic "the statement above is false" to compare against and is much less reliable. Several questions can be answered in one call with model.predict([...]).

Input format

Each question becomes one sequence, and each option is scored from the hidden state at its [OPT] marker:

[CLS] instructions [SEP] state [SEP] [OPT] option_1 [OPT] option_2 ... [OPT] option_n

Objects are serialized as compact JSON with sorted keys. For noul, the options are [false, true] and the answer is the probability of true.

Files

File
model.safetensorsfp32 weights (ModernBERT encoder + option scorer + confidence head)
config.jsonModernBERT config, plus the dinah block ([OPT] token id, question types, max length)
tokenizer.json, tokenizer_config.json, special_tokens_map.jsonmoBERTo tokenizer (original ModernBERT vocabulary) plus the [OPT] token
onnx/model_int8.onnxint8 dynamic quantization with block-local attention, for CPU; needs onnxruntime (uses the com.microsoft MultiHeadAttention op)
onnx/model_8bit.onnx8-bit weight-only quantization (MatMulNBits) with int8 embeddings, 165 MB: stays close to fp32 on older ONNX Runtime builds, such as the ones mobile apps ship (see below)
decision_ai.jsonmanifest for on-device runtimes: files, SHA-256, special tokens, input and output names
dinah.pyinference code
decision_index_engine.pyengine for the Decision Index kit (--engine decision_index_engine:DinahEngine)

The int8 model agrees with fp32 on the top option in 94.3% of 300 typed-decisions test items, with the same accuracy (73.7% vs 73.0% on that sample). Use the PyTorch weights when you need the exact fp32 probabilities.

The int8 model's accuracy depends on the ONNX Runtime version: on ORT 1.23 (the version mobile plugins ship) it agrees with fp32 on only 75.7% of the same kind of sample (69.0% accuracy). onnx/model_8bit.onnx agrees on 97.0% there (74.7% accuracy), at 149 ms per request on an Apple M5 CPU against 46 ms for int8. Prefer it on mobile.

Model details

  • Architecture: ModernBERT-base (22 layers, hidden size 768, 8,192-token context), ~150M parameters, with an [OPT] token added to the vocabulary, a question-type embedding, an option scorer (MLP over each [OPT] hidden state) and a small confidence head that reads the shape of the option distribution.
  • Base model: Tropic-AI/moBERTo (Apache-2.0), a ModernBERT further pre-trained on Portuguese, in the variant that keeps the original ModernBERT tokenizer.
  • Training: several fine-tuning stages on typed-decision data (English and Portuguese), long-context multitask data, Lichess puzzles and, in the last stage, 605,256 examples built from the training splits of the Decision Index source datasets (never from the suite's evaluation rows), with Portuguese replay. About 1.19 billion training tokens across all stages.
  • Objective: cross-entropy against the target distribution over options, plus a Brier term; the confidence head is trained to predict whether the top option is correct.

Limitations

  • Decisions only. No generation, no open-ended answers.
  • Little world knowledge. It is weak on questions that need facts it cannot read in the input (see the Knowledge and Arts scores above).
  • Weak at arithmetic over the input. Comparing numbers in the state (totals against limits, dates) is unreliable.
  • Two languages. Trained for English and Portuguese; other languages are untested.
  • 8,192 tokens, no truncation. Longer requests raise an error instead of being silently cut.
  • Confidence is not recalibrated in this release. The confidence value comes straight from the confidence head.
  • Research model. Evaluate it on your own data before relying on it.

License

CC BY-NC 4.0 (non-commercial). Part of the last training stage comes from the MMLU auxiliary training set, which includes RACE, released for non-commercial research only, and MCTest. Because of that, these weights are released for non-commercial use.

Training data and attributions

Datasets in the training path, with their licenses:

DatasetLicense
ZefanCai/Open-JevCC0-1.0
LocalLLaMA/typed-decisions and its Portuguese translation (made with Qwen3-4B)Apache-2.0
Lichess puzzlesCC0-1.0
ChessBench / searchless_chessCC BY 4.0
MASSIVECC BY 4.0
Bitext customer supportCDLA-Sharing-1.0 (data not redistributed)
ESCIApache-2.0
WANLICC BY 4.0
SNLICC BY-SA 4.0
HoVerCC BY-SA 4.0
CommonsenseQAMIT
HellaSwagMIT (per the original repository)
WinoGrandeApache-2.0
MMLU auxiliary train (ARC, OBQA, RACE, MCTest)MIT (repository); RACE non-commercial research only
GSM8KMIT
CLadderMIT
iSarcasmEvalMIT
When2CallCC BY 4.0
glaive-function-calling-v2Apache-2.0
ToolACEApache-2.0
HaluEvalMIT
IBM Claim StanceCC BY 3.0
CLINC150CC BY 3.0
BANKING77CC BY 4.0
ContractNLICC BY 4.0
CUADCC BY 4.0
PubMedQAMIT
MedMCQAApache-2.0
QASCCC BY 4.0
StrategyQAMIT
bAbI-NLIBSD
BIG-bench (tasks outside BBH)Apache-2.0
twitter-financial-news-sentimentMIT
financial-tweets-sentimentMIT
NOSIBLE financial-sentimentODC-By
FinQA hallucination detectionMIT
GoEmotionsApache-2.0
Civil CommentsCC0-1.0
B2W-Reviews01CC BY 4.0
multilingual-sentiments (pt)Apache-2.0
jurisprudencias_brCC BY 4.0
FaQuAD-NLICC BY 4.0
FAQ BACENApache-2.0
ExtraGLUE (RTE and COPA, pt-BR)MIT

Thanks to the authors of all of them, and to the ModernBERT and moBERTo teams for the base model.

Author

Built by Lukita (GitHub) as a personal study project.

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertModel
Ревизия весов
bdfb82d

0 моделей