First align the state, then optimize the behavior.

We asked whether a Qwen3-4B Thinking model could continue from a KV cache created by its Instruct sibling. The strongest 4B path used two compact stages: a frozen k=8 ridge map to move the cache into the target representation, followed by a rank-8 residual trained through the target model's 32-step rollout objective.

On the paired 28-sample evaluation window, mean KL32 moved from 0.04287 with ridge to 0.03813 with ridge plus residual. The residual improved 24 samples, three samples favored ridge, and one tied. The paired 95% interval for the KL change was entirely below zero, from −0.00696 to −0.00251.

The design result

Coordinate alignment and behavioral correction are distinct jobs. Giving each job its own stage used the small residual's capacity more effectively than asking it to learn both transformations at once.

Exact-architecture siblings gave us a clean starting point.

Earlier transfers changed model width and depth together. This campaign paired Qwen3-4B-Instruct-2507 with Qwen3-4B-Thinking-2507. They share 36 layers, model width, attention geometry, tokenizer artifacts, vocabulary, and RoPE configuration, so the experiment could focus on learned representation differences.

Every target layer selected the matching source layer in both directions. Mean exact-layer K/V reconstruction reached about 0.91, with nearly identical key and value predictability. That architectural match let us replace depth search with a more precise question: how should the remaining representation residual be optimized for target behavior?

Three charts for Qwen3-4B Instruct to Thinking transfer showing matching-layer alignment, strong key and value reconstruction, and rollout metrics for direct and mapped caches.
The sibling baseline isolated a highly linear representation relationship while preserving a measurable 32-step trajectory gap for the adapter experiments.

The boundary metrics were already strong. Instruct to Thinking reached 88% next-token agreement with direct reuse and 91% with ridge mapping. The multistep metric supplied additional resolution: KL32 moved from 0.0670 to 0.0438, recovering 34.7% of the direct-to-oracle gap. That became the baseline for every following intervention.

The transferred cache preserved about 92% of native prompt evidence.

Before changing the adapter, we checked whether trajectory divergence meant the prompt itself had been lost. A 40-case benchmark tested eight context-dependent capabilities. Only the context prefix was cached, then the Thinking model consumed a probe and generated from native prefill, mapped cache, direct cache, or an uncached-context control.

Answer evidence across 40 context-dependent cases
Cache pathMean evidenceComplete evidence
Native Thinking prefill99.4%39/40
Ridge-mapped Instruct cache91.9%36/40
Direct Instruct cache91.9%36/40
Uncached-context control5.6%2/40

After accounting for the measured control floor, both transfer paths retained about 92% of native answer evidence. This clarified the next step: prompt memory and exact target trajectory are separate axes, so the adapter could preserve its strong memory signal while training directly against multistep behavioral divergence.

Prompt-memory comparison showing native Thinking prefill and ridge-mapped Instruct cache evidence across eight capabilities.
Native Thinking prefill and the ridge-mapped Instruct cache preserved answer evidence across the capability set.

Rollout-aware training became strongest on an aligned base.

Static ridge minimizes token-level cache reconstruction error. Our higher-resolution acceptance metric is behavioral KL over 32 oracle-forced target steps. We therefore froze the target model and trained a small per-layer, per-head residual by backpropagating through that rollout.

The first rank-8 residual started from direct cache reuse. It brought KL32 from 0.06683 to 0.04408, validating the end-to-end training path and approaching ridge at 0.04287. A direct-base rank-2 quadratic adapter reached 0.04341 on its held-out set, also aligning closely with ridge. Together, those runs identified the most valuable next change: begin behavioral training after the coordinate map.

Two-stage adapter z = W(x)  →  ẑ = z + BAz

With ridge frozen underneath it, the selected rank-8 linear residual reduced KL32 to 0.03813. Residual gain correlated with the error left by ridge at r = 0.72, and the hardest ridge-error quartile improved 4.1 times more than the easiest quartile. The residual was concentrating its capacity exactly where alignment left the most behavioral work.

Three charts showing lower mean KL32 for ridge plus residual, paired improvements on 24 of 28 samples, and larger gains on samples with higher ridge error.
Ridge plus a rollout-trained linear residual improved 24 of 28 paired samples. Larger baseline errors predicted larger residual gains.

Total direct-to-oracle gap recovery rose from 35.9% with ridge to 42.9% with the linear two-stage adapter. This created a precise next milestone toward the preregistered 80% recovery target.

A quadratic residual confirmed the two-stage pattern on fresh data.

We repeated the nonlinear idea on the ridge-aligned state, using a factorized quadratic correction:

Ridge plus quadratic correction z = W(x)  →  ẑ = z + ((zA) ⊙ (zB))C

Six preregistered pilots swept ranks 2, 8, and 32 across two learning rates. The frozen selector chose rank 2 at 1e-3. We reinitialized the final model exactly at ridge, trained for 200 steps on 64 FineWeb-Edu samples, and evaluated once on 28 fresh WikiText chunks.

Fresh 4B holdout, 28 WikiText chunks
VariantMean KL32Standard error
Direct reuse0.0688870.002743
Static ridge0.0395770.002739
Ridge + rank-2 quadratic0.0353040.002837

The quadratic adapter reduced KL32 by 10.8% relative to ridge, improving 21 chunks with six favoring ridge and one tie. Its paired 95% interval was entirely below zero, from −0.00652 to −0.00203, with p = 0.000569. Gap recovery reached 48.8%.

Three charts showing the quadratic residual's 10.8 percent KL32 reduction after ridge alignment on a fresh holdout.
The fresh holdout independently supported the same ordering: stable coordinate alignment first, compact rollout-aware correction second.

Functional and 30B checks showed where each adapter adds value.

We next returned the selected ridge plus linear residual to free generation. Mean answer evidence rose from 91.9% to 96.2%, complete evidence moved from 36/40 to 37/40, and floor-normalized retention reached 96.7%. Five paired cases changed, so a larger functional set is the natural next step for tightening uncertainty.

First-token agreement remained 25/40 and continuation agreement stayed near 6.3%. This separation is useful: oracle-forced KL measures the local target distribution along a shared path, while free generation compounds each model's token choices. We now carry both scoreboards forward instead of asking either one to stand in for the other.

Functional comparison showing higher prompt answer evidence with the ridge plus neural residual and similar free-generation trajectory metrics.
The residual raised prompt answer evidence while the free-generation trajectory measures remained stable, motivating a larger functional evaluation.

The four-way comparison then moved to exact-architecture Qwen3-30B-A3B Instruct and Thinking siblings. Static ridge produced the strongest point estimate at 0.017956 KL32. The direct-base residual improved direct reuse by 6.5%, with 20 paired wins and p = 0.0116. The ridge-based residual reached 0.018333, keeping the aligned solution in the same narrow range.

Qwen3-30B four-way comparison showing ridge with the lowest mean KL32 and a direct residual that improves the hardest direct-transfer samples.
At 30B, ridge captured most of the available low-dimensional correction, while rollout training added the clearest value to the direct base.

This scale check sharpened the allocation rule. At 4B, residual gain tracked the error remaining after ridge. At 30B, that correlation was only r = 0.13, while direct residual gains concentrated on the hardest direct-transfer samples. Adapter placement should therefore be selected for each ordered model pair and scale.

At 8K tokens, the research implementation came within 8.3% of fresh prefill.

The final experiment measured the selected 4B ridge plus rank-8 residual at the production integration boundary. Source prefill was treated as sunk. Transfer mapped the first N−1 cached tokens, applied the residual, and let the target process token N. The baseline freshly prefetched all N tokens with the target.

Corrected H100 p50 latency
Path1,024 tokens8,192 tokens
Ridge + residual transfer117.311 ms256.692 ms
Fresh target prefill28.404 ms237.002 ms
Transfer / prefill4.130×1.083×

The 8K result is the encouraging systems signal: the gap compressed from 4.13 times at 1K to 1.083 times at 8K. The residual contributed only about 17 to 21 ms, identifying the static mapper as the primary optimization target. Fused mapping, lower-precision execution, and overlapping transfer with the boundary-token path now have a concrete 19.69 ms gap to close on this hardware.

Measurement boundary

This run used an H100 rather than the product gate's L40S. It is a research systems measurement that defines the optimization brief for a synchronized production-hardware benchmark.

Nine experiments turned cache transfer into a staged engineering problem.

The overnight sequence produced a clear architecture for future work:

  • Align coordinates. Use a simple, stable map such as ridge to establish the target representation.
  • Correct behavior. Train a compact residual through the multistep target objective, choosing its base per model pair and scale.
  • Validate the product. Track forced trajectory fidelity, free response and prompt memory, and end-to-end latency as separate scoreboards.
  • Optimize the integration. Fuse the dominant mapping work and benchmark on the deployment hardware at the intended context lengths.

Exact siblings removed architectural confounders. Ridge captured most of the coordinate relationship. Linear and quadratic residuals each removed about another 11% of KL after alignment on their respective 4B evaluations. The functional, 30B, and latency branches then showed exactly where to specialize the next adapter and the next kernel.

First align the state. Then learn the remaining behavior. Finally, optimize the complete handoff.

Evidence boundary

These are mechanistic experiments on small held-out sets: 27 or 28 forced-rollout samples, 40 functional cases, and 28 samples at 30B. The paired intervals and controls support the reported comparisons, while larger multi-corpus evaluations will establish the operating range.