A sovereign dense engine reproduces HF logits across 16 transformer families
Ran Tao (Octoryn Research)
摘要
A single dense inference engine with no vendor BLAS and no third-party ML framework reproduces HuggingFace next-token logits at cosine >= 0.999979 (f16) across 15 transformer families spanning three positional paradigms and both attention and non-attention (SSM/RWKV) sequence mixers. Per-mechanism ablations confirm each reimplemented component is load-bearing, with no cross-family logit regression. This is a correctness-reproduction result at smoke-test scale (1-2 prompts per family), bounded by an f16 ceiling - not a generation-quality, throughput, or benchmark claim.
本 Research Object 以其原始语言(英文)发表。
1. Contribution (and what is explicitly NOT claimed)
Claimed. A single dense inference engine, containing no vendor BLAS (vendor GEMM/DNN libraries absent from the linked-library list) and no third-party ML framework, reproduces the next-token logits of a HuggingFace reference to cosine >= 0.999979 (f16) across 15 transformer families spanning three positional paradigms and both attention and non-attention sequence mixers. Per-mechanism ablations (negative controls) confirm that each reimplemented component is load-bearing, and adding the SSM/RWKV/MoE/ALiBi/parallel-block families causes no logit regression in previously-passing families.
NOT claimed. This is a correctness-reproduction result, i.e. the reimplemented forward matches the reference math. It is not a generation-quality, long-context, downstream-task, or throughput result, and the evaluation is smoke-test scale (see Section 5). "Sovereign reimplementation across many architectures" is an engineering-breadth contribution plus a small number of mechanism-ablation findings; it is not a claim of a new model or a new algorithm.
2. Methods
| Item | Value |
|---|---|
| Hardware | AMD RDNA2-class discrete GPU (16 GB) |
| Stack | Recent ROCm toolchain; a single sovereign engine build with no vendor BLAS |
| Oracle | A recent transformers release for dense families; an older transformers plus a compatible compressed-tensors release for compressed-tensors/AWQ checkpoints (newer stacks silently random-init experts) |
| Procedure | The engine emits per-position logit vectors; an offline harness runs the same token ids through the oracle and compares row-by-row |
| Precision | f16 (the engine's highest precision; there is no f32 path) |
| Metric | per-row cosine of full logit vectors; argmax agreement; gate = cosine >= 0.999 |
| Stimulus | a short fixed prompt (12 next-token rows); several ports additionally validated on a second prompt |
The comparison is on identical ids with identical weights, so a high cosine is evidence of forward-math equivalence, not merely plausible output.
3. Results - per-family parity
| Family | Paradigm exercised | min cosine | argmax |
|---|---|---|---|
| Qwen2.5 | GQA, QK-norm per head, RoPE high theta | 0.999979 | 12/12 |
| SmolLM2 | GQA, sliding-window attention | 0.999998 | 12/12 |
| Llama-3.2 | GQA | 0.999998 | 12/12 |
| Mistral | GQA, sliding-window attention | 0.999992 | 12/12 |
| Phi-3 | fused qkv / gate-up | 1.000000 | 12/12 |
| Qwen3 | QK-norm per head | 0.999989 | 12/12 |
| OLMo-2 | reordered/post-norm, full-dim QK-norm | 0.999998 | 12/12 |
| StableLM-2 | partial RoPE, LayerNorm bias | 0.999997 | 12/12 |
| GPT-2 | learned-absolute position, Conv1D | 1.000000 | 12/12 |
| OLMoE | sparse MoE (top-8/64) | 0.999999 | 12/12 |
| Bloom | ALiBi, embedding LayerNorm | 1.000000 | 11/12 (dagger) |
| Falcon | parallel block, MQA | 1.000000 | 12/12 |
| Granite | 4 scalar multipliers | 0.999997 | 11/12 (dagger) |
| Mamba | selective-scan SSM | 0.999997 | 8/8 |
| RWKV | WKV linear-attention | 1.000000 | 12/12 |
15/15 pass the cosine gate; 13/15 are full-argmax. (dagger) The two misses are sub-f16-ULP ties: at the contested position the engine's two top logits are exactly equal (gap on the order of one ULP at that magnitude) and the oracle breaks the tie at a lower index. With no f32 path these are irreducible, not defects (cosine ~ 1.0). A 16th family is excluded from results - the available checkpoint held a config-only weight stub, reported rather than faked.
4. Ablations (negative controls)
Each reimplemented mechanism is disabled while holding everything else fixed; a faithful port must break:
| Family | Mechanism disabled | cosine | argmax | Verdict |
|---|---|---|---|---|
| Mamba | selectivity (constant delta) | -0.73 | 0/8 | load-bearing |
| StableLM-2 | partial RoPE -> full RoPE | -0.62 | 3/12 | load-bearing |
| Falcon | parallel block -> sequential | 0.977 | 0/12 | load-bearing |
| RWKV | WKV recurrence disabled | 0.96 | 3/12 | load-bearing |
These are the result's strongest evidence: parity could in principle be coincidental, but a mechanism whose removal collapses the forward is demonstrably the one being computed.
5. Threats to validity / limitations
- Sample size is small. The per-family sweep is 1 prompt x 12 next-token positions (a few ports add a second prompt). This is a correctness smoke test, not a benchmark-scale evaluation; it can catch a wrong forward but cannot estimate rare-token tail behaviour. A benchmark-grade follow-up (hundreds of prompts from a held-out corpus, reporting the cosine distribution and worst case) is not done here.
- No variance reported. Logit comparison is deterministic given fixed ids/weights, so repetition is not informative for cosine - but any timing claims (absent here) would need repeated trials. This report makes no throughput claim.
- f16 ceiling. No f32 path, so sub-ULP argmax ties are irreducible and any precision-sensitive claim is bounded by f16.
- Parity != quality. Forward-math equivalence does not establish generation quality, calibration, or downstream-task performance.
- Quantization beyond the tested q8 spot-checks is out of scope.
- Uncovered axes (named): MLA, 2D/m-rope, NoPE-attention, hybrid SSM+attention (Jamba), Mamba-2/SSD, Mixture-of-Depths.
6. Reproducibility
- The engine is a single sovereign build; per-family ports are versioned independently.
- Build verification: confirm the linked-library list shows only the platform GPU runtime plus system libraries (no vendor BLAS/DNN).
- Run: dump per-position logits at f16 for a short fixed prompt, then diff against an oracle pinned to the releases described in Section 2.
- Validate the oracle first (the compressed-tensors trap, Section 2): an unpinned
transformerssilently random-inits MoE experts and invalidates the comparison.
声明边界
作者对范围的明确界定——本工作证明了什么、未证明什么——沿用自 Octoryn Research 的发表模型。
证明
- A vendor-BLAS-free dense engine reproduces HF next-token logits at cosine >= 0.999979 (f16) across 15 transformer families spanning 3 positional paradigms and attention + SSM + RWKV mixers plus dense and MoE variants.
- Per-mechanism ablations (disabling selectivity, recurrence, partial RoPE, or the parallel block) collapse the forward, showing each reimplemented component is load-bearing.
- Adding SSM, RWKV, MoE, ALiBi, and parallel-block families causes no cross-family logit regression in previously-passing families.
未证明
- Generation quality, calibration, long-context, or downstream-task performance.
- Throughput or latency competitiveness.
- Behaviour at benchmark sample sizes - the evaluation is 1-2 prompts and a handful of token positions per family, a correctness smoke test.
- f32-level numerics; the f16 ceiling means sub-ULP argmax ties are irreducible.
- Correctness for families whose checkpoint weights were absent (one family excluded).
适用于
- f16 next-token-logit reproduction against a version-pinned, weight-validated transformers oracle on identical token ids, on a single RDNA2-class GPU.
不适用于
- Any generation-quality, throughput, or statistically-powered evaluation claim; quantized correctness beyond the tested q8 spot-checks; other hardware backends.
作者
- Ran Tao — 调查研究, 写作
引用本文
引用格式
Tao, R., Octoryn Research. (2026). A sovereign dense engine reproduces HF logits across 16 transformer families (TR-2026-0003). Octopus Research Institute.
BibTeX
@techreport{oritr20260003,
title = {A sovereign dense engine reproduces HF logits across 16 transformer families},
author = {Tao, Ran and {Octoryn Research}},
institution = {Octopus Research Institute},
year = {2026},
note = {Permanent ID TR-2026-0003. Not peer reviewed.}
}披露
- 资助
- 硬件与基础设施由 Octoryn / Octopus Core Pty Ltd 提供。
- 利益冲突
- Octoryn 提供商业推理与治理工具;相关发现独立报告。
