Inkling 2 Mini - MLA Latent-KV Looping Patch, 3 Layers (HEAL PROBE, NOT TRAINED)

This checkpoint is not trained and is not ready for use as is. It is a structural retrofit of the official thinkingmachines/Inkling-2-Mini weights (the keys and values of three of the four full-attention layers are factorized through a rank-512 latent) plus a 16,384-token healing probe: 32 optimizer steps on an owned agentic corpus, nothing more. No full continued-pretraining, SFT or RL stage has been run. On the small held-out slice used to measure damage, the heal probe lands 0.0302 nats below the base checkpoint, but that slice is not a benchmark and the model is a research artifact, not a production model.

Mechanism in one line: this is an MLA-style retrofit combined with the model's own layer looping. Full-attention layers 5, 11 and 17 keep softmax attention but factorize their key and value projections through a rank-512 latent; the KV cache stores the latent plus the 64 short-convolution taps, and the expansion and convolution run after retrieval. Layer 23 is deliberately left alone because it is the expensive slot: it is visited once by the loop and costs 0.4306 nats of damage for the same 2.9 GiB of savings that layer 5 buys.

What changed

Base model thinkingmachines/Inkling-2-Mini, revision c9d028302cd0f035fdf8e7e91f089a4ce94d2195
Architecture inkling2_loop (24 physical layers, loop core 6..17, 3 loop passes)
Replaced layers 5, 11 and 17; layer 23 is untouched
Untouched layers layer 23, every sliding-window layer, the vision tower, the routed experts, the MTP head
New operator latent_kv: keys and values factorized through a rank-512 latent, no RoPE
New parameters 6,686,280 total (2,228,760 per patched layer)
Dropped parameters none (0 tensors)
Added by the heal probe 26,738,688 LoRA parameters, rank 64, alpha 64, on the attention projections
Precision BF16 (the base checkpoint is NVFP4/MXFP8 quantized; this artifact is dequantized and trainable)

The operator keeps the base q_proj, o_proj, the relative-position bias, the learned attention sinks, the short convolutions and the gated output of the replaced layers bit-for-bit. The base k_proj and v_proj are replaced by a latent projection kv_a_proj (hidden size to rank 512) with a per-channel kv_a_scale, followed by kv_b_k and kv_b_v (rank 512 back to the key and value head dimensions). The latent factors are initialized by truncated SVD of the concatenated base key and value projections, which is why this operator starts close to the base model, unlike the zero-gated recurrence sibling.

What the cache costs, and what concurrency it buys

A patched full-attention slot stores a 512-dimensional latent key and value plus 64 per-token dynamic short-convolution taps, so it costs 1152 bytes per token in BF16 instead of the base model's 4096. Layers 11 and 17 are visited three times each by the loop and layer 5 once, so the growing cache term drops from 32,768 to 12,160 bytes per token: at a 1M context that is 11.481 GiB of BF16 KV cache per session against 30.674 GiB for the base model, or about 3.48 concurrent sessions in a 40 GiB KV budget against 1.30 for the base model. The 20 sliding-window layers contribute a bounded 0.156 GiB per session at that context, 0.4 percent of the budget.

Those 1M numbers are exact extrapolations of the measured per-token cache layout (measured after a 16-token forward), not a 1M-token forward. The concurrency column is a KV-budget calculation that excludes weights, routed experts, activations and runtime overhead, so it is an upper bound on sessions, not a measured serving capacity.

Measured damage and measured repair

Cross-entropy in nats on the owned agentic holdout (eight disjoint 512-token windows, 4096 tokens from six records), computed with the model's own label shifting on the BF16 artifact:

variant owned-holdout CE against base
base thinkingmachines/Inkling-2-Mini 1.5088 0
this artifact, untrained 1.5458 +0.0370
this artifact, after the 16,384-token heal probe 1.4786 -0.0302

The heal probe lands below the base checkpoint on this slice, which means it improved on the in-domain distribution as well as repairing the patch. That is a real measurement and also the reason not to over-read it: the same eight windows are not an independent benchmark, and the run that produced this configuration was selected on them.

Confirmed on a larger slice. The eight-window reading could not separate this artifact from the base checkpoint (0.0302 below at p = 0.107), because that slice's minimum detectable paired difference was 0.0387 nats, larger than this artifact's entire initialization damage of 0.0370 nats. Scoring 64 windows of 512 tokens on the same corpus, the same tokenizer and the same label shifting gives this artifact 1.1224, the four-layer 1.1495 and the base checkpoint 1.1644. Paired, this artifact is 0.0421 nats better than the base checkpoint (p about 3e-8) and 0.0272 nats better than the four-layer (t(63) = -9.493, 58 of 64 windows, effect size 1.19). The earlier ambiguity was a power problem at n = 8, not a real one.

The same run also shows what the healing stage actually did. Both healed artifacts score below the base checkpoint, the four-layer by 0.0149 and this one by 0.0421, so the 16,384-token run is acting partly as in-domain adaptation and not only as patch repair. This artifact's own damage is 0.0370 nats, so at most 55 percent of its 0.0672-nat movement can be attributed to repairing the patch.

The heal recipe, exactly. 32 optimizer steps of 512 tokens each (16,384 tokens), seed 20261130, AdamW with two parameter groups (patch parameters at 1.444e-4, LoRA adapters at 5.174e-4), cosine decay from the first step, no warmup, gradient clipping at 1.0, on the shipped harness's packed corpus stream over 1270 owned agentic records with EOS separation and shuffling. The patch parameters and the LoRA adapters are both trainable; 33,424,968 parameters were trainable in total.

The fixed-window ladder never repairs this artifact. On the fixed-window stream (64 records, one repeated window per step), 4096 tokens scores 1.5615, 8192 tokens 1.5989, 16,384 tokens 1.5575 and 32,768 tokens 1.6457, every rung worse than the untrained 1.5458. Only the full-corpus packer repairs it, so 16,384 tokens is the measured minimum and multiple three-layer repairs are not cheaper than one: a second full-corpus run costs another 16,384 tokens and the ladder says smaller budgets do not work at all.

Patch parameters are not the healing mechanism here either, and training them at rank 8 is harmful. The six-style sweep at 4096 tokens puts lora_only first at 1.5399, then joint_r64 at 1.5629; joint (patch and adapter together at rank 8) is 1.6710, a 0.1311 nats gap. Freezing the patch at its initialization and training only the adapter is the best style on this artifact. The mechanism result matches the four-layer: the adapter configuration, not the patch parameters, recovers the loss.

The four-layer sibling, and the trade this artifact makes

A four-layer variant of the same retrofit also patches layer 23. It is published alongside this one as RESMP-DEV/Inkling-2-Mini-MLA-LatentKV-Looping-3Layer-HealProbe.

artifact untrained CE healed CE 1M BF16 cache sessions at 40 GiB
base 1.5088 - 30.674 GiB 1.30
three-layer [5,11,17] (this repo) 1.5458 1.4786 11.481 GiB 3.48
four-layer [5,11,17,23] 1.9731 1.5183 8.739 GiB 4.58

Paired on the same eight windows, this artifact beats the four-layer on every window, by a mean of 0.0398 nats with a standard error of 0.0095. The cost is 1.10 concurrent sessions at a 1M context, 32 percent. Both repairs cost the same 16,384 tokens on the same hardware, so the choice is quality against concurrency, not cost against cost. If 3.48 concurrent sessions is enough, this is the better artifact; if the target is multiple concurrent agent sessions, the four-layer buys 1.10 more for 0.0398 nats.

A larger latent rank does not rescue the extra layer: rank 768 on all four layers measures 1.9185 untrained, still far from the base model, for 44 percent more cache. Patching more layers is worse still: the full fourteen-layer loop core costs 3.1653 untrained, 3.6 times the four-layer damage, for 0.2 percent of the cache budget.

How to load

import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer

model = AutoModelForImageTextToText.from_pretrained(
    "RESMP-DEV/Inkling-2-Mini-MLA-LatentKV-Looping-3Layer-HealProbe",
    torch_dtype=torch.bfloat16,
    trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
    "RESMP-DEV/Inkling-2-Mini-MLA-LatentKV-Looping-3Layer-HealProbe"
)

The artifact ships one self-contained remote-code module, modeling_inkling2_loop_patched.py, which also defines the patched configuration classes, and carries patch_config inside config.json:

{
  "operator": "latent_kv",
  "patched_layer_ids": [5, 11, 17],
  "state_mode": "reset",
  "delta_chunk_size": 64,
  "delta_decay_init": -0.1053605,
  "delta_beta_init": 0.0,
  "out_gate_init": "zero",
  "latent_rank": 512,
  "kernel_backend": "recurrent",
  "init_seed": 20261124
}

out_gate_init is zero in that block, but that value only applies to the gated delta-rule operator. The latent-KV operator initializes its per-head output gate to one, and the shipped weights confirm it: out_scale is exactly 1.0 for every head of every patched layer. This artifact is switched on at initialization, which is why it starts close to the base model, while the gated-delta sibling starts switched off.

transformers 5.24.1 or newer is required: the inkling2_loop architecture does not exist in earlier releases.

What ships beside the weights

file what it is
merge_receipt.json the exact merge that produced this directory: source paths, config digest, checkpoint step, merged module count, per-file SHA-256
heal/config.json the heal config that produced the checkpoint, including the two learning-rate groups and the seed
heal/step_000032/adapters.pt the trained state: the LoRA adapters and the trained patch parameters
heal/step_000032/metadata.json checkpoint metadata, digests and run statistics
heal/receipt.json the training receipt for the 32-step probe
heal/EVAL.json the held-out window scores behind the 1.4786 number
heal/holdout-64window-ce.json the 64-window scores for this artifact, the four-layer and the base checkpoint
heal/holdout-64window-statistics.json the paired statistics over those 64 windows
LICENSE Apache 2.0

The weights in this repository are the merged form of heal/step_000032: the LoRA deltas are folded into the attention projections and the trained patch parameters are written into the patched layers. The merge is a numerical rewrite of the same checkpoint, not a training step.

Non-claims

  • This model is not trained. The heal probe is 16,384 tokens on one artifact; no full continued-pretraining, SFT or RL stage has run.
  • Eight 512-token windows on an owned agentic holdout are a damage measurement, not a benchmark, and the holdout selected the four-layer trial; this three-layer comparison is paired on data and budget, not on a fresh split.
  • The eight windows span 4096 tokens from six records. The standard error of the mean on that slice is about 0.08, so the 0.0302 gap below the base checkpoint is a point estimate inside the slice's noise.
  • The corpus split is session-key disjoint but not prompt-disjoint: 16 of 161 holdout records share a boilerplate suffix and 11 share a 256-character task-prompt prefix with train.
  • The heal ran on Apple MPS, whose index_put and scatter_reduce are nondeterministic, so 1.4786 is one run and not a bit-exact guarantee.
  • The cache figures are exact extrapolations of a measured 16-token layout, not a 1M-token forward, and the session counts exclude weights, experts, activations and runtime overhead.
  • No throughput measurement was taken on any accelerator for this operator.
  • The SVD initialization is a least-squares approximation of the base key and value maps, not a proof that the latent bottleneck preserves model behaviour.
  • The vision tower, the routed experts, the loop message gates, the MTP head configuration and every other part of the base checkpoint are untouched and were verified bit-identical at conversion time.
Downloads last month
35
Safetensors
Model size
26B params
Tensor type
F32
ยท
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for RESMP-DEV/Inkling-2-Mini-MLA-LatentKV-Looping-3Layer-HealProbe

Finetuned
(115)
this model