/ Модель

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

Контекст
262 144 токена
Параметры
7,2 млрд
Размер весов
18 ГБ
Лицензия
Apache 2.0
Архитектура
mallard · dense
Базовая модель
Qwen3.5-9B
Библиотека
transformers
Опубликована
30 ноя 2026

Obit-Mallard-1.0-9B

Генерация текстаТекст → текст
7 866скачиваний за 30 дней5лайковвеса обновлены1 дек 2026

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

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

Текстовая модель Obit Research на базе Qwen3.5-9B, оптимизированная для экономной генерации с длинным контекстом до 262 144 токенов.

Obit Mallard 1.0-9B — текстовая генеративная модель Obit Research на архитектуре Mallard, созданная преобразованием Qwen/Qwen3.5-9B с дистилляцией изменённых слоёв. Модель сохраняет большинство весов исходной модели, а в слоях полного внимания использует сжатое латентное представление KV-кэша и разреженное чтение наиболее релевантных токенов. Это уменьшает расход памяти и позволяет работать с контекстом до 262 144 токенов; число параметров в метаданных указано как 7,2 млрд.

Модель предназначена для диалоговой генерации текста, длинных рассуждений, ответов по длинным контекстам и задач с кодом. В README приведены результаты тестирования на извлечении информации, коде, длинных QA, математике и научных задачах; качество в целом близко к Qwen3.5-9B, но для сложных рассуждений Mallard обычно генерирует больше токенов и требует большего бюджета. Модель текстовая: башня для изображений исходной модели не включена. Лицензия — Apache-2.0.

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

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

Ограничения

Для сложной математики и научных задач модели может требоваться бюджет рассуждений от 80 тысяч токенов; качество на контексте 262 144 токена отдельно не оценивалось. Мультимодальная обработка изображений не поддерживается, а реализация Transformers ограничена одной последовательностью при разреженном чтении и может работать медленно.

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

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

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

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

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

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

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

Открыть на Hugging Face

Obit Mallard 1.0-9B Quickstart

Obit Mallard is a model based on the Qwen3 architecture that focuses on improving speed and decreasing KV cache size. Some highlights of this model:

Qwen3.5-9B with a 5.2x smaller KV cache. At the full 262,144-token context Mallard's cache is 1.65 GB, where the original model's f16 cache is 8.59 GB. Long-context retrieval, chat, instruction following, knowledge and code are close to the original; on hard math and science it thinks somewhat longer (details below).

Full 262k context on a 12 GB GPU at 8-bit weights (Q8_0), where the original model at the same weights needs a 16 GB card even with an 8-bit KV cache, and a 24 GB card with the default f16 cache.

This is an Obit Research model. We make open-weight models that lower the bar for consumer inference. You can follow our other models and architectures here.

Technical Details

Mallard is a conversion of Qwen/Qwen3.5-9B, not a new pre-train. Qwen3.5-9B has 32 layers: 24 Gated-DeltaNet layers (a recurrent state of fixed size, about 50 MB per sequence, no KV cache) and 8 full-attention layers (indices 3, 7, ..., 31), which hold the whole KV cache. Mallard keeps everything bit-identical except those 8 attention layers, where:

  • the key/value cache is a low-rank latent (multi-head latent attention, as introduced by DeepSeek-V2): per token and layer, one vector of rank 512-1,024 instead of 4 key and 4 value heads of 256 dims. The latent is stored at 4 bits (q4_1, group 32), together with 4-bit rotary keys and 4 fp32 key-norm scales;
  • each query reads only the 4,096 most relevant past tokens (DeepSeek Sparse Attention, as in DeepSeek-V3.2). A small "lightning indexer" scores every past token from an 8-bit (FP8 E4M3) indexer key and picks the top 4,096; before position 4,096 every token is read;
  • on-policy distillation trained the converted layers to match the original model's outputs on the converted model's own generations.

The byte-exact specification (tensors, forward math, cache formats) is in FORMAT.md; the executable reference is modeling_mallard.py.

Files

FileWhat it is
model-0000N-of-00005.safetensors, model.safetensors.index.jsonbf16 weights (17.97 GB, text decoder only)
config.json, configuration_mallard.pyconfig (model_type: "mallard", Qwen3.5 keys + the mla_* / index_* keys)
modeling_mallard.pythe reference PyTorch implementation, loaded with trust_remote_code=True
tokenizer files, chat_template.jinja, generation_config.jsonunchanged from Qwen3.5-9B
FORMAT.mdthe full specification, written so the model can be ported to another engine
export_manifest.json, SHA256SUMSprovenance (input hashes) and file checksums
Obit-Mallard-1.0-9B-*.gguf, GGUF.mdGGUF files for llama.cpp, from UD-Q2_K_XL (3.4 GB) to BF16 (18.0 GB); which one to pick is in GGUF.md
mtp-Qwen3.5-9B-Q8_0.ggufQwen3.5-9B's own multi-token-prediction head (unchanged, Q8_0, 2.4 GB), a speculative-decoding draft for the GGUFs: 1.3-1.7x faster generation; see GGUF.md
imatrix_*.gguf, kld.tsv, quant_summary.jsonthe importance matrices used for the quants, and each quant's measured KL divergence from BF16

Why it matters: full context on smaller GPUs

Cache at 262,144 tokensBytes per tokenSize
Qwen3.5-9B, f16 cache (default)32,7688.59 GB
Qwen3.5-9B, 8-bit cache (q8_0 K and V)17,4084.56 GB
Qwen3.5-9B, 4-bit cache (q4_0 K and V)9,2162.42 GB
Mallard 1.0-9B6,2881.65 GB

Weights plus cache at the full 262k context (approximate, before runtime buffers):

WeightsQwen3.5-9B, f16 cacheQwen3.5-9B, 8-bit cacheMallard 1.0-9B
Q4 (~5.9 GB)~14.5 GB~10.5 GB~7.6 GB
Q8_0 (~9.5 GB)~18.1 GB~14.1 GB~11.2 GB: fits a 12 GB card
BF16 (~18.0 GB)~26.6 GB~22.6 GB~19.6 GB

The cache also stays small under concurrency: 16 requests at 82,944 tokens each need 7.8 GiB of KV cache with Mallard, versus 40.5 GiB for the original with an f16 cache and 21.5 GiB with an 8-bit cache. (Every sequence also carries the unchanged Gated-DeltaNet recurrent state, about 50 MB, in both models.)

Quality vs Qwen3.5-9B

Every comparison is paired: the same prompts, sampling settings and random draws for both models. Thinking is on, with the Qwen team's recommended sampling.

AreaBenchmarkQwen3.5-9BMallard 1.0-9B
Long-context retrievalRULER, 1,440 rows, at 8k / 32k / 128kreference−0.15 / +0.18 / −0.74
Long-context codeRepoQA (pooled @0.8)71.2574.17
Long-context QALongBench v2 (pooled)28.028.0
KnowledgeMMLU-Pro (500)78.877.6
Instruction followingIFEval (200), strict / loose91.0 / 96.190.5 / 94.8
ChatIFEval (chat) / judged head-to-head82.0 / 10 of 3083.0 / 11 of 30
CodeHumanEval+ (164), pass@189.6387.80
Science reasoningGPQA Diamond (198), ~80k thinking budget83.3381.31
Math reasoningAIME 2025 + 2026 (120), 130k thinking budget89.1785.83

Long reasoning: give it room to think

Mallard reasons about 1.1–1.25x longer than Qwen3.5-9B: 1.11x on MMLU-Pro, 1.23x on GPQA and on AIME, 1.07x on HumanEval+.

  • GPQA Diamond: at a 32,768-token cap, 18 of 198 Mallard answers are still thinking when the cap hits (Qwen: 3), and it scores 76.26 vs 82.83. With an ~80k budget every one of them finishes (median 37k tokens, longest 68k), 10 turn right and none turns wrong: 81.31 vs 83.33.
  • AIME 2025 + 2026: with a 130k budget Mallard scores 85.83 vs 89.17, at 1.24x the generated tokens per problem. At an 81,920-token cap the gap is about twice as large.

Recommendation: for hard math and science, set the thinking budget to at least 80k tokens, and 128k for competition math. Mallard's small cache is what makes long budgets cheap to hold.

Usage

Transformers (reference implementation)

Tested with transformers 5.22.2, torch 2.7.1 (CUDA 12.6) and accelerate 1.15 (for device_map), on one GPU. Needs about 19 GB of GPU memory for the weights plus the (small) cache.

pip install "transformers>=5.22" accelerate
# optional, faster Gated-DeltaNet layers: pip install flash-linear-attention causal-conv1d
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "obitresearch/Obit-Mallard-1.0-9B"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16, device_map="auto")

messages = [{"role": "user", "content": "Prove that there are infinitely many primes."}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_dict=True,
                                 return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=4096, do_sample=True, temperature=1.0, top_p=0.95, top_k=20)
print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
  • trust_remote_code=True is required: it loads modeling_mallard.py from this repo.
  • Thinking is on by default (Qwen3.5's chat template). The reply starts with a reasoning trace that ends in </think>. Pass enable_thinking=False to apply_chat_template to turn it off (in an OpenAI-compatible server, send "chat_template_kwargs": {"enable_thinking": false} with the request).
  • Sampling: the thinking-on benchmarks above used generation_config.json's settings (temperature 1.0, top_p 0.95, top_k 20, presence penalty 1.5); the example sets the first three, and llama.cpp / vLLM-style servers also take the presence penalty.
  • Speed: this is the reference implementation in plain PyTorch, not a serving engine. It stores the real compressed cache (model.cache_bytes_per_token() returns 6,288) and each decode step dequantises only the (at most 4,096) cached tokens it reads. Measured on one A40 with flash-linear-attention installed: 15 tokens/s at short context and 12 tokens/s at 16k-64k context (the original Qwen3.5-9B in the same transformers setup: 21 tokens/s at short context and 20 tokens/s at 16k-64k). Prefill runs at ~2,000-3,700 tokens/s at 16k-64k. The llama.cpp build below is ~5x faster at short context and ~6x faster at 32k.
  • Without flash-linear-attention and causal-conv1d, transformers falls back to slow PyTorch kernels for the Gated-DeltaNet layers (it prints a warning); the output is the same.

GGUF / llama.cpp

GGUF files (UD-Q2_K_XL to UD-Q8_K_XL, Q8_0 and BF16) are in this repository, next to the safetensors weights; the quant table, prefill speeds, memory figures and the status of the port are in GGUF.md. They need a llama.cpp build with Mallard support, obit_llama.cpp (default branch mallard); stock llama.cpp, Ollama and LM Studio do not load them yet. Upstream support is planned.

The whole repository is about 86 GB (the safetensors weights plus every GGUF), so download only the file you need:

git clone https://github.com/ObitDevelopment/obit_llama.cpp && cd obit_llama.cpp
cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=86 -DGGML_NATIVE=OFF  # 86 = RTX 30xx / A40
cmake --build build -j 16 --target llama-server llama-completion llama-bench
hf download obitresearch/Obit-Mallard-1.0-9B Obit-Mallard-1.0-9B-UD-Q4_K_XL.gguf --local-dir .
build/bin/llama-server -m Obit-Mallard-1.0-9B-UD-Q4_K_XL.gguf --port 8080   # full 262k context, 4 slots; OpenAI API + web UI

from_pretrained (above) fetches only the safetensors weights and their config files, not the GGUFs.

On one A40, UD-Q4_K_XL generates 84 tokens/s at short context, 82 at 8k, 80 at 32k and 74 at 131k (stock llama.cpp on Qwen3.5-9B: 88 / 84 / 75 / 52), and prefills a 32k-token prompt in about 12 s. With Qwen3.5-9B's MTP head as a speculative-decoding draft (mtp-Qwen3.5-9B-Q8_0.gguf, in this repo) it is 1.3-1.8x faster. GGUF.md has the full numbers.

The quantized GGUFs follow the Unsloth Dynamic 3.1 method, so credit for the quantization recipe goes to Unsloth. Each tensor gets its own precision, using the per-tensor layouts from Unsloth's Dynamic 3.1 quants of the Qwen3.5 / 3.8 family and Unsloth's published imatrix calibration for the tensors Mallard shares with Qwen3.5-9B. The new attention tensors are calibrated by us and kept at 8 bits in every quant. Mixed-precision GGUFs need an engine that supports per-tensor quant types (llama.cpp does).

Limitations

  • Reasoning traces run ~1.1–1.25x longer, so hard math and science need a larger thinking budget (see above).
  • Quality was measured up to 128k context. 262k uses the same mechanism but was not separately benchmarked.
  • Not measured: agentic tool use, multilingual quality, safety behaviour, multi-turn reasoning.
  • Most benchmarks were run with one sampling seed; GPQA's 198 and AIME's 120 rows carry ±1.5–2.5 points of draw noise.
  • Text only: the original model's vision tower is not included. Its multi-token-prediction head is not part of the safetensors model; it ships as a separate GGUF draft for llama.cpp (see GGUF.md).
  • The transformers implementation runs one sequence at a time for the sparse read (batches are looped) and is slow; see Usage.

Attribution and license

Mallard is built on Qwen3.5-9B by the Qwen team, Alibaba Cloud, released under Apache-2.0, and is distributed under the same license. All credit for the base model's pre-training and post-training belongs to the Qwen team; Mallard is an independent conversion and is not an official Qwen release. The attention design follows DeepSeek's multi-head latent attention (DeepSeek-V2) and DeepSeek Sparse Attention (DeepSeek-V3.2).

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

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

GPU в ailist

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

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

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Класс архитектуры
MallardForCausalLM
Ревизия весов
17d5d10

0 моделей