[KongchangAI]
· 2 min read· 1,160 words

Hidden Risks in Cross-Model Latent Communication: How KV Cache Transfer Bypasses Safety Alignment

Hidden Risks in Cross-Model Latent Communication: How KV Cache Transfer Bypasses Safety Alignment

Cross-model latent communication boosts efficiency but introduces exploitable new attack surfaces and weakens safety alignment.

The article introduces a study on the security of cross-model latent communication in multi-agent systems. Latent communication transfers KV caches to avoid redundant prefill, reducing communication and compute overhead, but the target model thereby consumes context it did not encode itself. The study proposes the Chasm framework, splitting the attack surface into source model, mapper, and transfer mechanism. Experiments show a target model that natively follows only 0.4% of prompt injections reaches up to 44.2% after cache transfer through the mapper; jailbreak attacks rise up to 24.6 percentage points within the same family and up to 69.2 percentage points zero-shot, with white-box mapper optimization reaching 92.5% versus ordinary GCG's 37.5%. The study proposes a lightweight target-side cache guard for mitigation and stresses that KV caches should not be treated as trusted input by default.

Latent Communication: An Efficiency Shortcut for Multi-Agent Collaboration

As large language models begin working together in heterogeneous multi-agent systems, latent communication is gradually emerging as a more efficient alternative to natural language message exchange. By sharing internal representations, agents can avoid repeatedly processing the same context, thereby reducing communication overhead and prefill computation. One typical mechanism is cross-model KV cache transfer: a learned mapper translates the source model's KV cache into a form the target model can directly consume.

The appeal of this approach lies in cost. Natural language messages require the target model to re-encode and re-understand them, whereas KV cache transfer moves the "understanding" step directly over. But that is precisely where the problem lies—the target model consumes context that it did not itself encode. Does this mean its safety alignment still holds? A study titled "Latent-in-the-Middle: On the Security of Cross-Model Latent Communication in Multi-Agent Systems" revolves around exactly this question.

Cross-model latent communication security research

KV Cache and Prefill: In Transformer inference, when a model processes input, it caches the Key and Value vectors of each layer for reuse during subsequent token generation—this is the KV cache. Prefill refers to the forward pass in which the model first reads the full context, computes token by token, and fills the KV cache; it is one of the main sources of inference latency and compute cost. When multiple agents share the same context, if each agent re-prefills it, a large amount of redundant computation results. The idea behind cross-model KV cache transfer is precisely to move the KV cache already computed by the source model directly to the target model, skipping redundant prefill and thus saving that overhead. But this also means the target model skips the process of "reading the context itself."

The Chasm Framework: Three New Attack Surfaces

The research proposes the Chasm framework to characterize the attack surface in the cross-model transfer process. Unlike previous security analyses focused on a single model, Chasm breaks the attack surface into three layers: the source model, the mapper, and the transfer mechanism itself. The significance of this breakdown is that latent transfer introduces a link not covered by traditional security evaluation—malicious behavior need not occur on the target model, but can be injected upstream in the chain.

In other words, even if the target model itself is well aligned, as long as it trusts the cache passed in from outside, an attacker has the opportunity to tamper with the source model or the mapper. This is equivalent to opening a "man-in-the-middle" window between models—which is exactly what the title's Latent-in-the-Middle means.

Safety Alignment Is Significantly Weakened

Experimental results show that latent transfer substantially weakens safety alignment and prompt injection defenses. A target model that natively follows only 0.4% of prompt injections on benchmarks can reach a follow rate of up to 44.2% after the cache is transferred from the source model through the mapper. This order-of-magnitude jump shows that the target model's judgment of "whether this context is trustworthy" depends heavily on whether the context was encoded by itself.

Jailbreak Attack Success Rates Are Also Amplified

Regarding jailbreak attacks, transfer alone can raise the attack success rate within the same model family by up to 24.6 percentage points and zero-shot attacks by up to 69.2 percentage points. Moreover, if the attacker can perform white-box optimization through the mapper, the attack success rate can be pushed up to 92.5%—by contrast, the success rate of the ordinary GCG method on the same target model is 37.5%. This comparison reveals a key difference: the latent channel does not merely "bypass" text-level filtering; it also provides attackers with a differentiable optimization entry point, turning attacks from black-box probing into white-box construction.

Mapper: Because different models often differ in latent dimensions, layer counts, and attention head configurations, the source model's KV cache cannot be fed directly to the target model; a learned mapper is needed in between to translate it—typically a small network that projects the source model's cache into a form the target model can consume. The mapper is generally trained on paired data, with the goal of enabling the target model to still complete tasks properly when receiving the translated cache. Precisely because the mapper is a trainable, optimizable neural network component, it also becomes an attack surface: if an attacker can perform gradient optimization on the mapper (white-box setting), they can construct caches specifically designed to deceive the target model, rather than merely probing at the text level in a black-box manner.

GCG and White-Box/Black-Box Optimization: GCG (Greedy Coordinate Gradient) is a classic adversarial suffix attack method that greedily searches a suffix in discrete token space using gradient information, making the model tend to output content desired by the attacker. Ordinary GCG usually treats the target model as a black box or uses only limited gradient signals, so its success rate on well-aligned models is limited (the comparison in the article is 37.5%). The latent channel, by contrast, provides a continuous, differentiable optimization entry point: attackers can directly perform white-box gradient optimization on the mapper so that the transferred cache itself carries the attack intent, without token-by-token probing at the text level. This is exactly why the success rate on the same target model can jump from 37.5% to 92.5%—the attack changes from discrete search to continuous construction.

Defense Approach: A Lightweight Cache Guard on the Target Side

To address the above vulnerabilities, the research proposes a lightweight cache guard on the target side, which corrects the incoming cache to restore the target model's refusal behavior, thereby significantly mitigating these attacks. The cleverness of this defense lies in its choice of location: since the risk comes from "foreign" cache, verification and correction are performed before the cache enters the target model, without retraining the source model or the mapper.

From an engineering perspective, the target-side guard has low deployment cost and does not require changing the existing multi-agent collaboration architecture. However, the research's current conclusion is "significantly mitigates," which means it does not completely eliminate the risk—the security of latent communication may require joint protection at every link in the chain.

Rebalancing Efficiency and Security

The value of this work goes beyond disclosing specific attack data. It reminds the entire multi-agent systems community that as we pursue communication efficiency and compute savings, the security boundary is also quietly shifting. Although natural language messages are redundant, they at least go through the target model's own encoding and alignment judgment; latent transfer removes this step, effectively outsourcing trust upstream.

For teams building cross-model collaboration systems, a realistic conclusion is: KV cache transfer cannot be treated as trusted input by default. The trustworthiness of the source model, the robustness of the mapper, and entry-point verification on the target side all need to be incorporated into the threat model together. The efficiency advantage of latent communication is real, but its security cost must also be seriously priced in.

#cross-model latent communication#KV cache transfer#multi-agent systems#safety alignment#prompt injection#jailbreak attack#Chasm framework#cache guard
Share:

Related articles