Inkling 2 Next

Release Status β€” Architecture Preview (Weights Pending Head-to-Head Benchmarking): No model weights have been uploaded to this repository yet. This page documents the architectural decisions behind Inkling 2 Next β€” a conditional N-gram memory (196.6B Engram), dynamic-routing MoE, and verifiable-RL evolution of thinkingmachines/Inkling-2-Small. Head-to-head evaluations against the base Inkling-2-Small checkpoint on identical benchmark harnesses are next in queue and will be published here ahead of weight release.


1. Architectural Thesis

thinkingmachines/Inkling-2-Small is a 594B-parameter (~17B active) hybrid local/global Mixture-of-Experts model (48 layers, 384 routed experts per layer in native NVFP4 for L0–39 and MXFP8 for L40–47, top-8 sigmoid routing, 6-layer Block Attention Residuals, and a 5-layer Multi-Token Prediction speculative drafter).

While sparse MoE scales parameter capacity efficiently, empirical layer-ablation scans on Inkling-2-Small exposed three structural bottlenecks:

  1. Static Lexical Reconstruction Inside Early MoE Layers: Early-to-mid MoE layers expend substantial routed-expert compute and memory bandwidth reconstructing static local N-gram collocations, multi-token code/ABI identifiers, LaTeX idioms, and named entities that do not require deep non-linear expert routing.
  2. Uniform top-8 Tail Noise & Missing Shared Expert: Under energy-conserving sigmoid routing (route_scale = 8.0), the 7th and 8th lowest-scoring experts on high-certainty tokens contribute marginal residual signal while paying full NVFP4/MXFP8 expert memory-read cost β€” yet Inkling-2-Small natively sets n_shared_experts = 0, making naive top-k pruning brittle without a dense fallback pathway.
  3. Quantized Expert Fragility Under Post-Training: Directly updating NVFP4/MXFP8 routed experts during SFT or RL introduces 4-bit/8-bit dequantize-requantize drift and degrades speculative drafter acceptance.

Inkling 2 Next resolves all three bottlenecks through four co-designed architectural layers:

Component Base Inkling-2-Small Inkling 2 Next Primary Architectural Role
Total Parameters 594B 790.6B (594B backbone + 196.6B Engram) $O(1)$ offloaded lexical & structural N-gram capacity
Conditional N-Gram Memory None 196.61B Engram at L1 & L13 (n = 2, 3, 4, 24 prime-hash heads/layer) Offloads static N-gram/entity recall from early MoE experts
Tokenizer N-Gram Addressing Raw 201,024 BPE IDs Canonical LUT Compression (201,024 -> 128,650, -36.0%) Collapses casing, spacing, and Unicode surface variants onto shared N-gram slots
MoE Routing Policy Static top-8 everywhere (100% active MoE) Dynamic top-p = 0.85 (k in [3, 6], mean k = 4.83) Cuts routed-expert memory reads by -39.6% by dropping low-weight tail experts
Shared Expert Pathway n_shared_experts = 0 dim = 512 BF16 Mini Shared Expert (L0–47, Muon-trained) Always-on dense residual anchor stabilizing aggressive top-p expert shedding
Speculative Decoding 5-layer MTP drafter Hybrid Prefix-Seeded Suffix Automaton (SAM) + Static N-Gram + 5-Layer MTP Zero-overhead N-gram continuation drafting with strict 0-ULP target verification
Domain RL Adaptation Base policy NVFP4-Safe BF16 Attention Adaptation (Dr.GRPO + ExPPO + Clip-Higher + TIS) Zero expert requantization; 0.0% runtime serving overhead after static BF16 merge

2. Deep Dive: Conditional N-Gram Architecture (196.6B Engram + Hybrid N-Gram Speculation)

2.1 Canonical Tokenizer Compression (36.0% Vocabulary Collapse)

Addressing N-gram tables with raw BPE token IDs fragments statistical support across trivial surface variations (e.g., " Theorem", "theorem", "THEOREM", and Unicode compatibility forms all hash to unrelated rows).

Before computing any N-gram hash, Inkling 2 Next maps every token through a static lookup table:

LUT(t):NFKCβ†’NFDβ†’strip combining accentsβ†’lowercaseβ†’whitespace collapse\text{LUT}(t): \text{NFKC} \rightarrow \text{NFD} \rightarrow \text{strip combining accents} \rightarrow \text{lowercase} \rightarrow \text{whitespace collapse}

  • Collapses Inkling-2-Small's 201,024 padded vocabulary (200,058 active BPE + control tokens) down to 128,650 canonical equivalence classes (36.0% reduction) β€” nearly 2x higher canonical compression density than comparable byte-heavy tokenizers.
  • Special wire/control tokens (chat turn delimiters, <think> reasoning spans, and structured tool-invocation tags) map to dedicated isolated sentinels so structural control boundaries never alias with natural-language N-grams.

2.2 Multi-Order Prime-Modulus N-Gram Hash Tables (196.61B Parameters)

At each Engram injection layer, Inkling 2 Next extracts causal suffix N-grams of orders $n \in {2, 3, 4}$ over the canonically compressed token stream:

  • Multi-Head Prime Hashing: Each of the 3 N-gram orders is hashed across 8 independent heads (3 x 8 = 24 hash heads per layer, head_dim = 256, concatenated engram_dim = 6,144). Each head $h \in {0, \dots, 23}$ indexes a table of distinct prime modulus $P_h \approx 16\text{M}$ rows (~384M rows per layer), eliminating systematic modular collision patterns across orders and heads: $$(384,006,168 + 384,016,682) \times 256 = 196,613,849,600 \text{ parameters } (\mathbf{196.61\text{B}})$$
  • Tail-Noise Filtering (min_count = 3): Rare 4-grams appearing fewer than 3 times in the training corpus are masked from table updates, preventing single-occurrence sequence memorization and hash-collision pollution while concentrating capacity on reusable mathematical, code, and domain N-grams.

2.3 Why Inject at L1 and L13? Exploiting 6-Layer Block Attention Residuals

A naive N-gram lookup design either attaches tables to every transformer layer (multiplying metadata and projection overhead by 48x) or injects only at the input embedding (where early residual updates overwrite lexical detail).

Inkling-2-Small organizes its 48 layers into eight 6-layer Block Attention Residual groups (n_layers_per_attn_res_block = 6), where layers attend directly over normalized block-level residual states via learned inter-block queries:

Input -> [L0 -> L1(Engram #1) -> L2..L5] ==> Block 0 Residual
                |
                +--> [L6..L11]           ==> Block 1 Residual
                        |
                        +--> [L12 -> L13(Engram #2) -> L14..L17] ==> Block 2 Residual
                                        |
                                        +--> [L18..L47] (Global + Local Reasoning Layers)
  1. L1 (Early Lexical Offload): Placed immediately after L0 contextualizes raw token embeddings, supplying $O(1)$ surface/phrase N-grams right at the start of Block 0.
  2. L13 (Mid-Depth Structural & Compositional N-Grams): Placed near the entry of Block 2, after two full local/global attention cycles (L5, L11), capturing higher-order syntactic, API, and symbolic patterns while remaining directly reachable by deeper layers (L18–L47) via Block Attention Residuals.
  3. Empirical Verification (engram_cushion_bpb): In single-layer expert-shedding sweeps across L0–L17 (top-8 -> top-6 / top-4 with vs. without Engram), 31 of 32 candidates across L0–L15 exhibited positive Engram cushion β€” proving that L1 + L13 N-gram memory directly absorbs the representational load lost when pruning early-to-mid MoE experts, before naturally tapering off at L16–L17 where abstract reasoning dominates.

2.4 Zero-Init Context-Gated Injection & Tiered NVMe/RAM Architecture

Raw N-gram embeddings are static with respect to broader context (e.g., "bank" in finance vs. systems memory banking). Inkling 2 Next gates every retrieved $6,144$-d N-gram vector against the live hidden state $h_\ell \in \mathbb{R}^{4608}$:

  1. Project the concatenated 24-head N-gram vector via a TP-sharded linear map wkv into key $k_e$ and value $v_e$.
  2. Modulate $v_e$ by normalized query-key agreement $\sigma(\text{RMSNorm}(h_\ell) \odot \text{RMSNorm}(k_e))$ and scale by a zero-initialized scalar residual gate ($\alpha_\ell = 0$ at Step 0).
    • Because $\alpha_\ell = 0$ at initialization, attaching 196.6B parameters introduces exact 0.000 $\Delta\text{bpb}$ perturbation at Step 0 and smoothly opens ($\alpha_1 \approx 0.36$, $\alpha_{13} \approx 0.65$) only where N-gram lookups genuinely reduce cross-entropy and self-teacher KL.
  3. Zero-Penalty Serving & SparseRowAdagrad Training: Because N-gram indices depend only on input token IDs (known before L0 executes!), L1 and L13 lookups are prefetched asynchronously from sharded NVMe backing stores through a power-of-2 direct-mapped Zipfian RAM/GPU hot cache (~80–90% hit rate in 2–4 GiB/shard), hiding off-chip latency completely behind L0 and L2–L12 compute. During retrofit training, SparseRowAdagrad maintains a single FP32 scalar per row (0.38 GiB/shard) and updates only active rows touched in each micro-batch.

2.5 Inference-Time N-Gram Synergy: Hybrid SAM + Static N-Gram + 5-Layer MTP

In addition to representation-level Engram tables at L1/L13, Inkling 2 Next exploits N-gram structure during decoding by coupling Inkling-2-Small's neural 5-layer MTP drafter (32,768 frequency-ranked hot vocabulary shortlist) with an online Suffix Automaton (SAM) + static corpus N-gram table:

  • Multi-Turn Prefix Seeding: In agentic code, proof, and security workflows, variable names, file paths, JSON tool schemas, and Lean/Solidity/C identifiers repeat heavily across turns. Seeding the Suffix Automaton from cached prompt prefixes allows $O(1)$ exact multi-token span proposals whenever high-confidence N-gram matches exist, seamlessly handing off to the 5-layer neural MTP drafter on novel reasoning steps.
  • Multimodal & 0-ULP Target Safety: Contiguous vision-pad token runs are collapsed to bounded sentinels so image inputs never pollute text N-gram transitions, and every drafted token β€” whether proposed by SAM, static N-grams, or neural MTP β€” is verified by the full target model with zero-ULP greedy invariance (and exact residual rejection recovery norm(max(0, p - q)) for temperature > 0).

3. MoE Compute Reallocation: Dynamic top-p Routing & Mini Shared Expert

Once 196.6B Engram offloads static lexical memory from L0–L15, Inkling 2 Next reallocates active MoE compute onto a sharper Pareto frontier:

  1. Dynamic top-p = 0.85 Routing (k_min = 3, k_max = 6):
    • Replaces static top-8 expert selection across all 48 layers with cumulative router-probability thresholding: each token activates only as many top-ranked experts (between 3 and 6) as needed to cover 85% of normalized routing probability mass.
    • Reduces mean active experts from 8.00 -> 4.83 (60.38% active MoE, -39.62% routed expert reads) β€” concentrating bandwidth on high-leverage reasoning tokens (k -> 6) while fast-pathing predictable syntax/boilerplate tokens (k -> 3).
  2. Muon-Trained dim = 512 BF16 Mini Shared Expert (L0–L47):
    • Attaches a compact always-on BF16 shared expert (hidden = 4,608 -> d_shared = 512 -> 4,608) using Inkling-2-Small's exact interleaved softcapped SiTU activation (gate_cap = 4.0, up_cap = 25.0).
    • Jointly trained via 5-iteration quintic Newton-Schulz Muon orthogonalized updates alongside 48 router scale calibrations, 96 Block Attention Residual queries, and 8 global-attention (L5, 11, 17, 23, 29, 35, 41, 47) BF16 adapters under forward Self-Teacher KL regularization so probability calibration and MTP speculative acceptance remain tightly anchored.

4. Lossless NVFP4-Safe Post-Training & Verifiable Multi-Turn RL

To specialize Inkling 2 Next across Mathematics, Cybersecurity, and Applied Cryptography without degrading quantized expert precision or general capabilities:

  • 100% Frozen Quantized Experts (0 Requantization Error): All 384 NVFP4 (L0–39) and MXFP8 (L40–47) routed experts remain bit-for-bit untouched. Trainable rank-16/32 adapters attach strictly to BF16 attention projections (wq_du, wk_dv, wv_dv, wo_ud across L1–47) and fold losslessly into BF16 weights at load time prior to kernel prepacking (0.0% runtime serving latency penalty).
  • Stacked-Champion Reference Anchoring: Sequential RL iterations pre-merge the promoted prior champion into the frozen reference policy (KL = 0 at Step 0), preventing KL gravity from pulling newly acquired multi-turn skills back toward the pre-RL base policy.
  • Verifiable Execution Harnesses & RL Mechanics: Trained strictly against real executable verifiers β€” clang/AddressSanitizer/MemorySanitizer/UndefinedBehaviorSanitizer crash reproduction & minimal patching, standalone Lean 4 kernel proof checking (0 sorry/axiom escapes), multi-file Foundry (forge test) differential Solidity exploit & patch verification, finite-field R1CS / Fiat-Shamir / Merkle verifier soundness forging, and Olympiad mathematics β€” using:
    • Length-Unbiased Dr.GRPO sequence loss normalization (preventing long 16K trajectories from diluting gradient signal or rewarding brevity/stall hacks),
    • ExPPO prompt-relative surprisal advantage shaping within equal-reward classes,
    • Asymmetric DAPO Clip-Higher ([0.20, 0.28]) to preserve exploration on low-prior reasoning tokens,
    • Truncated Importance Sampling (TIS) against rollout behavior log-probabilities, and
    • Post-RL Weight-Space Trajectory Blending (50/50 Raw + Step-EMA) to combine peak late-stage long-context discovery with smooth early-stage calibration.

5. Benchmarks (Inkling 2 Next vs. thinkingmachines/Inkling-2-Small)

Coming next: Standardized, apples-to-apples evaluations comparing Inkling 2 Next directly against base thinkingmachines/Inkling-2-Small under identical prompts, tool harnesses, context caps, and 0-ULP decoding settings will be added to this section prior to weight upload.


License & Lineage

Derived from thinkingmachines/Inkling-2-Small under the Apache-2.0 License.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for jeweled/Inkling-2-Next

Finetuned
(12)
this model