File size: 9,006 Bytes
6db1fff
 
 
 
 
 
 
 
 
3f79a7e
6db1fff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3f79a7e
6db1fff
 
 
 
 
3f79a7e
6db1fff
 
 
 
 
 
 
 
 
 
 
 
3f79a7e
6db1fff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3f79a7e
 
 
 
 
6db1fff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
license: apache-2.0
base_model: thinkingmachines/Inkling-2-Mini
base_model_relation: quantized
pipeline_tag: image-text-to-text
tags:
- tensorfold
- tfq
- tfp6
- tfq-2.00
- quantized
- moe
- inkling2
- looped-transformer
- coding
- conversational
- apple-silicon
- cuda
- rocm
inference: false
---

<p align="center">
  <a href="https://huggingface.co/thinkingmachines"><img src="assets/thinkingmachines-logo.png" alt="Thinking Machines" width="96" height="96" /></a>
</p>

<h1 align="center">Inkling-2-Mini (26.4B Looped MoE) — TFQ 2.00</h1>

<p align="center">
  <a href="https://huggingface.co/thinkingmachines/Inkling-2-Mini">Base Checkpoint</a> |
  <a href="https://github.com/ashhart/TensorFold">TensorFold</a> |
  <a href="https://github.com/ashhart/TFQ">TFQ</a> |
  <a href="https://huggingface.co/TensorFold/Inkling-2-Small-TFQ-2.32">Inkling-2-Small (587B)</a>
</p>

<p align="center">
  <img src="https://img.shields.io/badge/Memory_Fit-9.37_GiB_Core_%2F_9.96_GiB_w%2F_MTP_(Fits_12GB_GPU_%2F_16GB_Mac)-0f766e" alt="Memory Fit" />
  <img src="https://img.shields.io/badge/Format-TFQ_(TFP6_Zero--LUT_A8)-2563eb" alt="TFQ TFP6" />
  <img src="https://img.shields.io/badge/Precision-2.00_bpw_3--Pass_Loop_MCKP-4f46e5" alt="2.00 bpw" />
  <img src="https://img.shields.io/badge/Model--Text_KL-0.070282_(A8)-7c3aed" alt="Model-Text KL" />
  <img src="https://img.shields.io/badge/Model--Text_Top--1-92.62%25_(Top--5_99.60%25)-16a34a" alt="Top-1" />
  <img src="https://img.shields.io/badge/Premature_Stops-0%2F46%2C262_(0.000%25)-15803d" alt="Premature Stops" />
  <img src="https://img.shields.io/badge/Shards-24%2F24_XXH64_Verified-15803d" alt="24/24 Verified" />
</p>

**`Inkling-2-Mini-TFQ-2.00`** is a TensorFold Quantization (**TFQ**, `TFP6` zero-LUT pure-ALU native signed-`int8` format) checkpoint of [**thinkingmachines/Inkling-2-Mini**](https://huggingface.co/thinkingmachines/Inkling-2-Mini) — a **26.4B 3-pass looped-core Mixture-of-Experts** model (`24` physical layers executing `48` transformer visits with `L06..L17` looped 3×, `128` routed experts per layer, `H = 2304`, `I = 1152`, `200,058`-token active vocabulary with `final_logit_softcapping = 30.0`, vision tower, and native MTP speculative decoding head).

> **GPU VRAM & Hardware Fit (Fits 12 GB GPU / 16 GB Mac)**
> - **Core Model Footprint (without MTP):** **`9.37 GiB`** (`5.75 GiB` `TFP6` MoE across 24 physical layers + `3.59 GiB` untouched non-MoE).
> - **Full Checkpoint (including optional `0.59 GiB` `mtp.safetensors`):** **`9.96 GiB`** (`10.69 GB`) total on disk.

| Hardware Target | Memory Footprint | Notes |
|---|---:|---|
| **12 GB GPU (RTX 4070 / 3060 12 GB)** | `9.37 GiB` core (`9.96 GiB` w/ MTP) | Fits single 12 GB GPU with ~2–2.6 GiB KV headroom |
| **16 GB GPU (RTX 5060 Ti / 4060 Ti / 4080)** | `9.37 GiB` core (`9.96 GiB` w/ MTP) | Fits with ~6 GiB KV headroom for long context |
| **16 GB / 24 GB Apple Silicon Mac** | `9.37 GiB` core (`9.96 GiB` w/ MTP) | 100% resident in unified memory |

## Inkling-2-Mini TFQ Lineup (All 5 Tiers — Normative `tfp6_a8` vs Official Stock Gold)

| Tier | Core / Total (w/ MTP) | Model-Text KL | Top-1 | Top-5 | ΔPPL | Conf. Premature Stops | Hardware Fit |
|---|---:|---:|---:|---:|---:|---:|---|
| **TFQ 2.00** *(this model)* | `9.37 GiB` / `9.96 GiB` | `0.070282` | `92.62%` | `99.600%` | `+4.686%` | `0` | Fits 12 GB GPU / 16 GB Mac |
| [**TFQ 2.50**](https://huggingface.co/TensorFold/Inkling-2-Mini-TFQ-2.50) | `10.79 GiB` / `11.38 GiB` | `0.024393` | `95.44%` | `99.922%` | `+1.205%` | `0` | Fits 12–16 GB GPU / 16 GB Mac |
| [**TFQ 3.00**](https://huggingface.co/TensorFold/Inkling-2-Mini-TFQ-3.00) | `12.21 GiB` / `12.80 GiB` | `0.014582` | `96.49%` | `99.963%` | `+0.497%` | `0` | Fits 16 GB GPU / 24 GB Mac |
| [**TFQ 4.00**](https://huggingface.co/TensorFold/Inkling-2-Mini-TFQ-4.00) | `15.06 GiB` / `15.65 GiB` | `0.004024` | `98.18%` | `99.998%` | `-0.079%` | `0` | Fits 24 GB GPU / 24 GB Mac |
| [**TFQ 4.50**](https://huggingface.co/TensorFold/Inkling-2-Mini-TFQ-4.50) | `16.48 GiB` / `17.08 GiB` | `0.002631` | `98.56%` | `99.998%` | `+0.009%` | `0` | Fits 24 GB GPU / 24–32 GB Mac |

## Method & Highlights

- **3-Pass Loop-Aware Calibration:** `Inkling-2-Mini` runs physical layers `L06..L17` three times per token (48 logical visits). Our pipeline executes the exact 48-visit looped forward pass (`0.00000000` max abs diff vs official `Inkling2LoopForCausalLM`), accumulating additive `w²`-weighted Hessians (`H_up` and post-quantization `H_down`) and Softcapped-SwiGLU Jacobian sensitivities across all 3 passes of `L06..L17` so the looped core automatically receives higher bit allocation (`+0.10–0.24 bpw` above preamble/tail).
- **Exact Global Tempered MCKP (`2.00 bpw`, `1.5–4.0 bpw`):** All `9,216` routed MoE matrices (`24` layers × `128` experts × `{gate, up, down}`) are quantized directly from the official checkpoint (`L00..L19` native NVFP4 + `L20..L23` native MXFP8) using 2-stage Hessian-LDLQ-H + 2-pass coordinate polish (`--polish --polish-su --polish-sv --share-su-groups --a8`).
- **Untouched Non-MoE & MTP:** All attention, gated DeltaNet, `attn_res`, vision tower, embeddings, `lm_head` (`3.59 GiB`), and optional `mtp.safetensors` (`0.59 GiB`) remain verbatim from upstream.
- **Zero-LUT Pure-ALU Native `int8` (`TFP6` + `FLAG_A8_HADAMARD`):** Decodes directly to signed `int8` with zero LUTs, supporting both normative `128×128` Hadamard `int8` activation execution (`tfp6_a8`) and BF16 activation execution (`tfp6_a16`).
- **Integrity:** All 24 MoE shards verified **`24/24 OK [A8] [XXH64 verified]`** via `tfq3-inspect`.

## Evaluation (Exact 200,058-Vocab FP64 Held-Out KL & Stop Stability)

Evaluated over **50 × 2,048 (`102,350` total next-token predictions, including `46,262` assistant `model_text` tokens)** across five strictly held-out domains (chat, code, math, prose, and tool calls), comparing exact full **200,058-vocabulary FP64 log-probabilities** (`final_logit_softcapping = 30.0`) directly against official **`thinkingmachines/Inkling-2-Mini` Gold**:

### Overall Model-Text (`46,262` Assistant Tokens) & All Tokens (`102,350` Tokens)

| Execution Path | Slice | KL (`gold \|\| cand`) | Rev-KL | Top-1 Agree | Top-5 Agree | Gold PPL → Cand PPL (`Δ%`) |
|---|---|---:|---:|---:|---:|---:|
| **`tfp6_a8` (Normative)** | **Model Text (`46,262` tok)** | **`0.070282`** | **`0.094150`** | **`92.62%`** | **`99.600%`** | **`2.0886 → 2.1865 (+4.686%)`** |
| **`tfp6_a16` (BF16 act)** | **Model Text (`46,262` tok)** | `0.070159` | `0.093964` | `92.55%` | `99.598%` | `2.0886 → 2.1869 (+4.706%)` |
| **`tfp6_a8` (Normative)** | All Tokens (`102,350` tok) | `0.157456` | `0.180463` | `88.89%` | `98.624%` | `4.1184 → 4.4014 (+6.872%)` |
| **`tfp6_a16` (BF16 act)** | All Tokens (`102,350` tok) | `0.155833` | `0.177174` | `88.87%` | `98.654%` | `4.1184 → 4.3930 (+6.668%)` |

### Per-Category Breakdown (`tfp6_a8` & `tfp6_a16` vs Official Gold)

| Category | Model-Text `tfp6_a8` KL / Top-1 / ΔPPL | Model-Text `tfp6_a16` KL / Top-1 / ΔPPL | All-Token `tfp6_a8` KL / ΔPPL |
|---|---:|---:|---:|
| **Tool Calls** (`4,237` mt / `20,470` all) | `0.018761` / `97.73%` / `-0.385%` | `0.019854` / `97.66%` / `-0.461%` | `0.184655` / `-1.117%` |
| **Code** (`10,357` mt / `20,470` all) | `0.011328` / `97.50%` / `-0.360%` | `0.011245` / `97.41%` / `-0.332%` | `0.067263` / `-2.445%` |
| **Math** (`15,292` mt / `20,470` all) | `0.043476` / `94.56%` / `+2.051%` | `0.042920` / `94.47%` / `+2.032%` | `0.098769` / `+4.404%` |
| **Chat** (`16,376` mt / `20,470` all) | `0.145929` / `86.39%` / `+12.042%` | `0.145871` / `86.35%` / `+12.122%` | `0.235797` / `+15.888%` |
| **Prose** (`0` mt / `20,470` all) | `0.000000` / `0.00%` / `+0.000%` | `0.000000` / `0.00%` / `+0.000%` | `0.200796` / `+19.453%` |

### Teacher-Forced EOS Stop Stability (`eos_token_id = 200006`)

| Execution Path | EOS Positions (`n = 157`) Flips (Confident) | Mean KL @ EOS | Premature Stops (`46,262` tok) | Confident Premature Stops |
|---|---:|---:|---:|---:|
| **`tfp6_a8` (Normative)** | `4 / 157` (`4` conf) | `0.09146` | `0 / 46262` | **`0`** |
| **`tfp6_a16` (BF16 act)** | `3 / 157` (`3` conf) | `0.05572` | `1 / 46262` | **`0`** |

## Checkpoint Files

- `moe_L00.tffp6` .. `moe_L23.tffp6`: `24` self-contained `TFP6 v6` (`FLAG_A8_HADAMARD`, `XXH64` verified) MoE shards (`5.75 GiB`).
- `nonmoe-00001-of-00001.safetensors`: Untouched non-MoE decoder, attention, vision tower, embeddings, and `lm_head` (`3.59 GiB`, `1,068` tensors).
- `mtp.safetensors`: Untouched native MTP speculative decoding head (`0.59 GiB`, `54` tensors).
- `tiktoken/tokenizer.model`, `tokenizer.json`, `tokenizer_config.json`, `chat_template.jinja`, `config.json`, `generation_config.json`, `processor_config.json`, `special_tokens_map.json`, `model.safetensors.index.json`.

## License

Derived from [`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/thinkingmachines/Inkling-2-Mini) under the **Apache 2.0** license.