Ramp Labs and Base Labs trained one 2.35-billion-parameter network to translate context between seven language models. Across all 42 directed model pairs, the receiving model retained 96.9% of its native accuracy on documents up to 8,192 tokens without reading the original text again.

  • One translator covers seven models from four families and all 42 source-to-target directions.
  • At 32,000 tokens, translation cut time to first token by 4× while retaining more than 90% of native accuracy.
  • At 128,000 tokens, full-depth translation was 2.5× faster but retained about 83%.
  • Shallower 128,000-token settings reached 6.1× and 7.5× speedups while losing another one to two retention points.

The researchers call the method speculative encoding. It is not speculative decoding. Speculative decoding asks a small model to draft future output tokens for a larger model to verify. Speculative encoding moves already-read input context from one model into another model’s internal representation.

Two ways to hand off a long document
Text handoff
Source reads document
↓
Send original tokens
↓
Target repeats prefill
Translated-state handoff
Source reads document
↓
Shared translator maps hidden states
↓
Target builds its cache
The speed measurements begin after the source representation already exists. They measure target-side time to first token, not the complete end-to-end workflow.

Source: Base Labs and Ramp Labs, Speculative Encoding.

Why model handoffs repeat expensive work

Before a language model generates its first output token, it processes the input and builds an internal cache. This prefill step stores key and value representations used by later attention operations. When a router sends the same long document to a second model, the second model normally repeats prefill from the original tokens.

That duplication is common in multi-model systems. A cheap model may triage a document before escalating it to a stronger model. Several specialized agents may inspect the same repository or report. Each target has its own architecture, tokenizer, layer dimensions, and attention layout, so one model’s cache cannot simply be copied into another.

Previous cache-translation systems often learned one mapping per source-target pair. Seven models require 42 directed translators. Adding an eighth would require 14 more.

Speculative encoding instead wraps a shared mixture-of-experts core with small model-specific projections and biases. The source side turns hidden states into a common memory. The target side begins from its own token embeddings and predicts target hidden states. The target model then applies its frozen key and value projections to build a cache in its native format.

Translating hidden states rather than raw cache entries avoids several architecture mismatches. Models can use different numbers of attention heads, different positional encodings, or linear-attention layers that do not store an ordinary K/V cache. The target’s own frozen projections provide the final conversion into the representation it expects.

One translator replaces a quadratic set of pairwise maps

The evaluation covers Qwen3.5 9B, Qwen3 14B, Llama 3.1 8B, Gemma 3 12B, Gemma 4 12B, Ministral 3 8B, and Ministral 3 14B. The models span four families.

On 12 evaluation datasets, documents up to the 8,192-token training length, three seeds, and every source-target direction, the translated cache retained 96.9% of the target’s native accuracy on average. The weakest direction retained 93.1%.

Retention is a ratio, not a test score. If a target model is weak on a task, preserving 97% of its native result does not make the final answer strong. The paper also reports 100.3% retention when normalized against the weaker of the source and target, which supports a useful interpretation: the transferred state generally preserves what the weaker participant understood, but cannot reliably add information it never represented.

That makes source selection part of system design. Letting a small model read a document first may cap the evidence available to every stronger model downstream.

The 7.5× figure is a different operating point

The cleanest result is the 8,192-token evaluation, where accuracy retention is 96.9%. The largest latency result comes from a different setting.

For longer documents, the authors ran vLLM on one H200 and measured target-side time to first token after the source memory was ready. At 32,000 tokens, the target started answering 4× faster and retained more than 90% of native accuracy. With 128,000 tokens, full-depth translation was 2.5× faster and retention fell to about 83%.

Predicting fewer target-layer states raised the 128,000-token speedup to 6.1× or 7.5×. Those shallower modes cost another one to two retention points. The headline 96.9% retention and 7.5× speedup therefore cannot be combined into one claim. They describe different context lengths and translation depths.

A query-conditioned compressor offers another tradeoff. When the next question is known, it selects information relevant to that question and can shrink the requested cache by as much as 128×. At 128,000 tokens and 64× compression, the compressed result retained roughly four points more accuracy than the full translated cache. That does not mean compression creates information. It focuses limited capacity on one known query, which may discard evidence needed for a later question.

Why translation depth changes the tradeoff

The number of target-layer states the translator predicts is a tuning parameter. A shallower translator does less work per document token. Since the target still needs a cache in its own representation, saving that translation work can remove some of the information the deeper setting retained. Figure 6 of the paper compares the settings across document lengths. At 128,000 tokens, the useful comparison is the amount of accuracy given up for each latency gain, with both numbers measured at the same depth.

The figure reports a median speedup across directions and a mean for retention. An individual route can deviate from both aggregates. If a service repeatedly uses one model to prepare context for another, it can benchmark that direction directly. The reverse route is a separate experiment. Changing the receiver changes the native accuracy reference as well as the model whose cache the translator must build.

Consider a document system that prepares a report once and answers queries about several details. A full translated cache can support a later question about an unrelated section. A cache compressed around the first query may retain the evidence needed for that query while dropping evidence for the next one. If follow-up prompts are common, measure the hit rate for reused compressed state and include misses that trigger a fresh prefill. A latency result for a single query leaves out the cost of those misses.

The comparison also depends on what a cold request includes. For a source and target on separate hosts, extracting and transferring a large representation can consume time even before the receiving side starts to translate. With both stages on one host, transfer might cost less but deployment has to account for the memory consumed by both models. Benchmarking the handoff at the service boundary makes those costs visible in the same units as the time saved.

What builders should test next

The code, checkpoints, Hugging Face path, and vLLM connector make the work inspectable, but the reported evaluation is still author-run. There is no independent replication yet.

Before using translated context in a production agent system, measure four boundaries:

  1. End-to-end latency, including source-state extraction and network transfer.
  2. Accuracy on the actual handoff task, not only average retention across benchmarks.
  3. Whether a weak source model limits a stronger target on rare but important evidence.
  4. Whether a compressed cache remains valid when the next question changes.

Speculative encoding makes an important systems bet: in a multi-model workflow, the expensive artifact should be the understanding of the context, not the original tokens. The first results show that internal state can cross model-family boundaries. They also show that every shortcut has a measurable information cost.