Headline result
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.
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.
Experiment 1 · isolate the representation
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 R² 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?
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.
Experiment 2 · separate memory from trajectory
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.
| Cache path | Mean evidence | Complete evidence |
|---|---|---|
| Native Thinking prefill | 99.4% | 39/40 |
| Ridge-mapped Instruct cache | 91.9% | 36/40 |
| Direct Instruct cache | 91.9% | 36/40 |
| Uncached-context control | 5.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.
Experiments 3–5 · optimize the measured divergence
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.
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.
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.
Experiment 6 · test capacity after alignment
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:
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.
| Variant | Mean KL32 | Standard error |
|---|---|---|
| Direct reuse | 0.068887 | 0.002743 |
| Static ridge | 0.039577 | 0.002739 |
| Ridge + rank-2 quadratic | 0.035304 | 0.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%.
Experiments 7–8 · broaden the scoreboards
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.
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.
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.
Experiment 9 · measure the serving boundary
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.
| Path | 1,024 tokens | 8,192 tokens |
|---|---|---|
| Ridge + residual transfer | 117.311 ms | 256.692 ms |
| Fresh target prefill | 28.404 ms | 237.002 ms |
| Transfer / prefill | 4.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.
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.
What we learned
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.
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.