Ohara-D28-A1B-SFT
Ohara-D28-A1B is a hybrid sparse-attention mixture-of-experts language model: 23.85B total parameters, ~1B active
per token. This repo holds the post-trained (SFT) release (step 6484, branch step-006484, tag final). It
was trained from the 128k-context base ohara-d28-a1b-s5 with
13.6B tokens of supervised fine-tuning. No RL, DPO or on-policy distillation was used.
- Chat format: the native Qwen3 chat template and tokenizer, plus a
reasoning: off|low|medium|highline at the top of the system prompt (thinking goes in<think>…</think>). - Context: trained up to 128k tokens (see Long context for what retrieval actually looks like).
- Requires the ohara code (
library_name: ohara, nottransformers), see Usage.
Overview
| Parameters | 23.85B total = 17.70B transformer matrices + 5.60B n-gram memory + 0.27B embedding + 0.27B LM head |
| Active per token | 0.98B backbone matrices (1.25B including the LM head; table lookups excluded) |
| Layers | 28 (14 encoder + 14 decoder), hidden 1792, 14 heads x 128, 1 KV head (MQA) |
| Layout | SSSSSFSSSSSSSFGPPPPPGPPPPPGP |
| MoE | 256 experts, top-8 (+ shared expert), expert dim 448, quantile-balanced router bias |
| Other | mHC residual (4 branches), n-gram memory at layers 2 and 16, gated norm |
| Tokenizer | Qwen3 (vocab 151,936) |
| RoPE | rotary dim 32; theta 10k on S layers, long_rope_theta 1e6 (ABF) on F/G/P layers |
| Precision | bf16 |
Layer kinds:
- S: sliding-window attention (window 128) with its own K/V.
- F: full causal attention with its own K/V (encoder layers 6 and 14).
- G: global decoder attention over the final encoder output's K/V; computes a top-256 token selection.
- P: token-sparse attention reusing the latest G layer's K/V and selection, plus a forced 128-token local window (no extra KV cache).
Usage
# git clone https://github.com/joey00072/ohara ; pip install -e ohara
from huggingface_hub import snapshot_download
from ohara.serve import Engine
path = snapshot_download("joey00072/ohara-d28-a1b-sft", revision="main")
engine = Engine.from_checkpoint(path, device="cuda:0")
reply = engine.chat([[{"role": "user", "content": "Explain MoE routing in two sentences."}]],
reasoning="off", max_new_tokens=512, temperature=0.7, top_p=0.8, presence_penalty=1.0)[0]
print(reply["content"])
An OpenAI-compatible server: OHARA_SERVE_PRESENCE_PENALTY=1.0 python -m ohara.serve --ckpt <path> --port 8000.
To load the weights only: ohara.pretrain.export.load_hf(path, device="cuda").
Use an ohara revision that knows
long_rope_theta.config_from_dict(ohara/pretrain/export.py) keeps only the fields the modelConfigdefines. Older code has nolong_rope_thetafield, so it silently drops it and loads the F/G/P layers with theta 10k. The model then runs, but long-context quality degrades.
Training
| Stage | Init | Seq len | Tokens | Steps | Notes |
|---|---|---|---|---|---|
| Stage 1 (pretraining) | scratch | 4k | 210B (stable phase) | 29,669 | The full stage 1 was 300B (210B stable + 90B decay, ohara-d28-a1b-stage1); this release branches from the pre-decay checkpoint at 210B |
| S2 | stage 1 pre-decay | 8k | 100.0B | 15,894 | constant LR; pretraining + mid-training mix |
| S3a | S2 | 8k | 60.0B | 9,536 | LR decay |
| S3b | S3a | 32k | 30.0B | 2,384 | ABF: long_rope_theta 1e6 on F/G/P from here |
| S4a | S3b | 32k | 20.0B | 1,589 | |
| S5a | S4a | 64k | 3.0B | 238 | router bias frozen |
| S5b | S5a | 128k | 3.0B | 238 | router bias frozen; released as ohara-d28-a1b-s5 |
| SFT | S5b | 32k | 13.6B | 6,484 | this repo |
The base lineage totals ~426B tokens. Batch sizes: 7.1M tokens (stage 1), 6.3M (S2, S3a), 12.6M (S3b onward), 2.1M (SFT, 64 x 32k).
SFT. Packed 32k rows. Loss is computed on assistant turns only, with per-conversation attention masking. The mix
is reasoning traces with hindsight effort tags (off/low/medium/high) and no-think variants: agentic and
tool use ~30%, math ~26%, code ~19%, general chat and instruction following ~18%, long context ~5%, budget-truncated
thinking ~2%. Filtering covers length/quality, cross-source dedup, and 13-gram decontamination against the evaluated
benchmarks. Router-bias balancing was on during SFT. There was no RL and no preference tuning.
Base model benchmarks
Full base suite on S4a (step 1589, the 32k base just before S5a/S5b), compared with stage 1, Qwen3 and Trinity-Nano. Scores are %. Settings differ across columns (shots, CoT vs log-likelihood, harness), so compare loosely.
| Task (our setting) | S4a | Stage 1 final (300B) | Stage 1 pre-decay (210B) | Qwen3-1.7B-Base | Qwen3-4B-Base | Trinity-Nano-Base |
|---|---|---|---|---|---|---|
| MMLU (5-shot) | 59.5 | 55.8 | 39.0 | 62.6 | 73.0 | 67.7 |
| MMLU-Pro (5-shot, log-lik.) | 31.1 | 23.0 | 13.1 | 36.8 (CoT) | 50.6 (CoT) | 35.8 |
| BBH (3-shot CoT) | 51.2 | 44.3 | 30.7 | 54.5 | 72.6 | 50.4 |
| GSM8K (8-shot CoT) | 70.2 | 60.0 | 19.0 | 75.4 (4-shot) | 87.8 (4-shot) | 58.4 |
| MATH-500 (4-shot) | 47.8 | 33.4 | 8.0 | 43.5 (MATH) | 54.1 (MATH) | 36.0 |
| HumanEval+ (0-shot) | 45.7 | 29.9 | 15.9 | — | — | 31.7 |
| MBPP+ (0-shot) | 52.6 | 45.5 | 33.5 | — | — | 44.7 |
| EvalPlus avg | 51.9 | 40.9 | 25.8 | 52.7 | 63.5 | — |
| CRUXEval-O (2-shot) | 34.1 | 30.4 | 21.2 | 36.4 (1-shot) | 55.0 (1-shot) | — |
| ARC-C (10-shot) | 60.1 | 57.7 | 50.9 | 54.1 | 64.1 | 84.0 (5-shot) |
| ARC-E (10-shot) | 86.2 | 83.8 | 76.9 | 82.1 | 86.3 | 94.8 (5-shot) |
| HellaSwag (0-shot) | 74.6 | 77.9 | 68.8 | 66.5 | 73.8 | 77.4 (5-shot) |
| PIQA (10-shot) | 80.1 | 80.7 | 77.7 | 76.4 | 79.8 | 82.2 (5-shot) |
| WinoGrande (0-shot) | 65.6 | 66.9 | 61.0 | 64.4 | 71.1 | 68.0 |
| BoolQ (10-shot) | 78.3 | 71.8 | 68.6 | 82.5 | 86.4 | 84.3 (5-shot) |
| AGIEval-en (0-shot) | 31.4 | 28.1 | 22.5 | — | — | 51.8 (5-shot) |
| DROP (3-shot F1) | 59.7 | 45.7 | 26.3 | — | — | 63.6 (5-shot) |
| TriviaQA (5-shot EM) | 59.1 | 59.6 | 47.4 | — | — | — |
| NQ-open (5-shot EM) | 21.7 | 21.3 | 13.4 | — | — | — |
Notes:
- Our columns come from the same suite (
ohara.serveengine). S4a used the full tier, e.g. MMLU n=14,042, MMLU-Pro n=12,032, GSM8K n=1,319. The stage-1 columns used the lite tier (subsets, e.g. MMLU n=3,000, GSM8K n=500). - Qwen3 MMLU / MMLU-Pro / BBH / GSM8K / MATH / EvalPlus / CRUX-O come from the Qwen3 technical report (arXiv 2505.09388, Tables 7-8). Qwen3 ARC / HellaSwag / PIQA / WinoGrande / BoolQ come from our own lm-eval runs.
- Trinity-Nano-Base numbers are from its model card (6B total / 1B active, 10T tokens). The card does not state its harness; its BBH shot setting is ambiguous.
- S5b (the SFT init): 7-task bench (lite, n=7,000) macro 70.9 vs S4a 70.2: HellaSwag 77.0, ARC-E 84.5, ARC-C 61.8, PIQA 81.9, WinoGrande 66.8, BoolQ 76.7, MMLU-cloze 47.6. The full suite was not rerun on S5b.
Post-trained benchmarks
This model (step 6484), with the recommended decoding (sampled, presence penalty 1.0, one
sample per item unless noted). off uses reasoning: off; medium uses reasoning: medium. Max new tokens: 4,096
for off; 8,192 for medium on IFEval / BFCL / MMLU / MMLU-Pro / GPQA; 16,384 for medium on math and code.
| Task | Metric | n | off | medium |
|---|---|---|---|---|
| IFEval | prompt-level strict | 541 | 69.3 | 61.2 |
| BFCL (7 categories x 100) | accuracy, macro | 700 | 15.0 | 52.4 |
| GSM8K | accuracy | 500 | 77.6 | 84.4 |
| MATH-500 | accuracy | 500 | 58.6 | 69.6 |
| AIME 2025 | avg@4 | 30 | 5.0 | 11.7 |
| AIME 2026 | avg@4 | 30 | 2.5 | 9.2 |
| HumanEval+ | pass@1 | 164 | 65.9 | 73.2 |
| MBPP+ | pass@1 | 200 | 63.0 | 67.5 |
| LiveCodeBench (newest 100 problems in the suite window) | pass@1 | 100 | 9.0 | 15.0 |
| MMLU-Pro (CoT, chat) | accuracy | 1,000 | 40.7 | 53.2 |
| MMLU (CoT, chat) | accuracy | 1,000 | 61.5 | 69.6 |
| GPQA-Diamond (CoT, chat) | accuracy | 198 | 31.3 | 20.7 |
| MMLU (5-shot log-likelihood) | accuracy | 3,000 | 56.7 |
- Truncation at the token limit is high for some thinking runs: AIME 53-58%, LiveCodeBench 50%, GPQA 62%,
MMLU-Pro 18%, MATH-500 14% (
medium). Those scores are limited by rambling, not only by ability. - BFCL breakdown:
mediumscores simple 64, multiple 73, parallel 20, parallel-multiple 32, irrelevance 77, live-simple 59, live-multiple 42.offscores irrelevance 100 and every calling category 0-2 (see limitations). - IFEval over 3 seeds: off 71.1, medium 61.4 (truncated 1.7% / 3.0%). Greedy gives 69.9 / 55.6 with 15.7% / 20.1% truncated.
Long context
Needle-in-a-haystack (RULER-style, teacher-forced exact match). These are the S5b base gate numbers, measured on the base checkpoints, not on the SFT model:
| Base checkpoint | Task | 4k | 32k | 64k | 128k |
|---|---|---|---|---|---|
| S5b (SFT init) | NIAH single (n=33) | 45.5 | 6.1 | 9.1 | 9.1 |
| S5b | NIAH multikey (n=32) | 9.4 | 0.0 | 0.0 | 3.1 |
| S4a | NIAH single (n=33) | 60.6 | 9.1 | 3.0 | 6.1 |
| S4a | NIAH multikey (n=32) | 21.9 | 3.1 | 0.0 | 0.0 |
Needle token accuracy for S5b is 0.90 / 0.56 / 0.51 at 4k / 64k / 128k (S4a: 0.92 / 0.42 / 0.37). A paired rerun at larger n (single needle) gave S5b 55.6 at 4k (n=198) and 7.1 at 32k (n=99). For reference, published RULER scores for Qwen3-1.7B-Base are 70.6 / 57.2 / 43.0 at 32k / 64k / 128k. The model accepts 128k inputs, but exact retrieval beyond a few thousand tokens is weak.
Recommended decoding
Greedy decoding falls into repetition loops on this SFT-only model. Sample, and use a presence penalty:
| Mode | System line | temperature | top_p | presence_penalty |
|---|---|---|---|---|
| Thinking | reasoning: low / medium / high (default medium) | 0.6 | 0.95 | 1.0 |
| Non-thinking | reasoning: off | 0.7 | 0.8 | 1.0 |
- Stop on
<|im_end|>(151645) or<|endoftext|>(151643).generation_config.jsoncarries the thinking defaults. presence_penaltyuses OpenAI semantics: the logit is lowered by 1.0 for every token already generated (the prompt is excluded). Inohara.serve, passpresence_penalty=1.0per request or setOHARA_SERVE_PRESENCE_PENALTY=1.0.
Tool calling: use a thinking mode (reasoning: low or higher), not off. With tools offered and
reasoning: off, the model almost always answers in prose ("I'll calculate …") instead of emitting <tool_call>
(BFCL off 15.0 vs medium 52.4). There is no inference-side fix:
- A first-token probe on 60 BFCL prompts found
<tool_call>top-1 on 0/60. - Dropping the empty
<think>prefill raises p(<tool_call>) from ~0.2% to ~1.2%, but it stays 0/60 at top-1.
The cause is in the training data rendering. Under the Qwen3 template, a no-think tool call followed by a tool response gets no think block, so in training the empty think block only ever preceded a final prose answer.
Limitations
- No-think tool calling is weak (BFCL off 15.0): use
reasoning: low/mediumfor tools (see above). - Repetition loops under greedy decoding. Use the recommended sampling with presence penalty 1.0.
- Knowledge is below Qwen3-1.7B-class models (base MMLU 59.5 vs 62.6; MMLU-Pro and BBH also lower).
- Thinking mode can ramble. Long traces hit the token limit often (see truncation above), and on GPQA thinking scores below non-thinking (20.7 vs 31.3).
- Long-context retrieval is weak beyond a few thousand tokens despite the 128k training length.
- SFT only: there is no preference or safety tuning beyond what the SFT data contains. Outputs may be wrong or unsafe.
- Requires the ohara code at a revision with
long_rope_theta(see Usage).
Revisions and related repos
- This repo:
main= step 6484 (final), branchesstep-006484,step-006250,step-006000.sft2-step-000834is an experimental 1.75B-token continued SFT. It scored better on math and on BFCL medium (55.9), but no better on BFCL off and worse on code, so it was not promoted. - Base checkpoints:
-s5(S5b, 128k, SFT init),-s5a,-s4a,-s3b,-s3a,-s2,-mid1(a side branch, not in this lineage),-stage1(tagspre_decay,final). - Code: https://github.com/joey00072/ohara
License
No license has been chosen for these weights yet. Until one is published here, no license is granted. The SFT data draws on many public datasets with their own terms (including some with unset licenses on their cards). Check them before any downstream use.