Skip to content
Blue Cloud CyberAI Research

Note 1

Latent-Space Communication for Multi-Agent AI

Our working design for AI agents that pass internal states to each other where they would normally send text. It covers the adapters that translate between models, the maths behind them, and the security questions the channel raises.

Published
2026-09-06
State
Working design
Sections
8

The channel problem

Agents that talk in text lose information and time on every hop. What that costs, and what the research says about skipping the text step.

In multi-agent systems today, models talk to each other through text, even though each one holds rich, high-dimensional internal states. On every hop, the sender compresses thousands of dimensions per token down to a sampled sequence of words and sends it. The receiver then runs a full forward pass to rebuild an internal state from scratch. Because of this, every hop costs twice: once in information (everything the sender represented but never put into words), and once in latency (token-by-token decoding is the slow part).

Recent research shows that the text step can be skipped. Interlat connects agents through their final hidden states and beats fine-tuned chain-of-thought exchange, even across different models [1]. Ramesh et al. go further and splice one model's activations into another's forward pass mid-computation [2]. Cache-to-Cache trains projectors that merge one LLM's KV-cache straight into another's, with better accuracy than text exchange at a fraction of the latency[3]. All three are lab systems set up for specific models. A protocol would need to work for any pair.

This note works through what a general latent-space protocol would need to specify so that arbitrary models could talk this way. One distinction shapes every design choice that follows, and it comes down to access. With open-weight models, you can tap and inject at any layer. With a proprietary model behind a chat API, hidden states are out of reach, so the most a protocol can do is define the latent port a vendor might one day expose. The maths is the same in both cases.

Two channelsdiagram a

Token channel

HIDDEN STATEmodel A, layer kDECODEsampling lossTOKENStext on the wireRE-ENCODEfull forward passHIDDEN STATEmodel B

Latent channel

HIDDEN STATEmodel A, layer kENCODERtrained adapterLATENT MESSAGEcontinuous vectorsDECODERtrained adapterHIDDEN STATEmodel B
The token channel pays for decoding and re-encoding on every hop. The latent channel replaces both with trained maps and keeps the representation continuous end to end.
Section 01 / claim ledger3 entries
  • Evidenced

    Agents can exchange continuous latent states instead of decoded text, including across heterogeneous models. [1],[2]

  • Evidenced

    Direct KV-cache communication between paired LLMs beats text exchange on accuracy and latency in the cited experiments. [3]

  • Proposed

    A general protocol for latent exchange between arbitrary models, going beyond per-pair research systems.

Translation adapters

How two frozen models could actually understand each other: a shared hub space, trained adapters, and soft-token injection.

Bridges between frozen models already exist

Translating between frozen models is already mainstream engineering, filed under the heading "multimodal". BLIP-2 trains a small Q-Former bridge that maps a frozen image encoder's latents into a frozen LLM's input space [4]. Flamingo grafts a whole vision stream into a frozen LLM through gated cross-attention, with tanh gates that start at zero so the host behaves normally until the bridge earns its influence [5]. Neither mechanism depends on the source model looking at pixels. So if you swap the image encoder for another language model, you have the core of a latent protocol.

Three places to plug in

Where the translated state enters the receiver matters more than the adapter's internal design. In order of how invasive they are, the options are:

  • Soft tokens. Map the incoming latents into the receiver's embedding space and prepend them as virtual context, prefix-tuning style [6]. The receiver itself is left untouched.
  • Gated cross-attention. Flamingo's approach, at a few mid layers. Higher fidelity, but it needs weight access.
  • KV-cache splicing. The tempting one. Section 03 explains why it only works for specific pairs of models, which makes it a poor fit for a protocol.

Soft tokens are the easiest to deploy. They're the weakest channel, but they're also the only one a proprietary vendor could plausibly expose as a stable interface. So they're the realistic starting point.

Using a hub instead of pairwise adapters

Pairwise adapters scale badly. If N models all need to interoperate, every ordered pair needs its own trained, calibrated and versioned adapter. A hub avoids this. The protocol defines one standard interlingua space (fixed dimension, fixed normalisation, versioned anchor set), and every model ships exactly two things: an encoder into it and a decoder out of it. Relative representations are what make this wire format workable. Each state is sent as its similarities to a shared set of anchor inputs in place of raw coordinates, which makes the message immune to rotations and rescalings of either model's private basis [7]. This means the parties only have to agree on the anchors. The reason to believe a small bridge can work at all is the Platonic Representation Hypothesis: as models get more capable, their internal geometries appear to drift toward the same shared structure [8].

Training the bridge

The training recipe is straightforward. Run a large shared corpus through both models, collect hidden states at the tap layers, and train the encoder-decoder pair with three objectives combined:

  • Behavioural distillation. The receiver's next-token distribution given the translated states should match what it does given the original text. This defines "meaning preserved" in terms of the receiver's behaviour.
  • Contrastive alignment, so the interlingua has a usable notion of distance.
  • Cycle consistency. Encode, decode back, and compare. This stops the encoder quietly discarding information that the training tasks don't happen to exercise.

The model-stitching literature is an encouraging precedent here: Bansal et al. find that even simple learned maps recover a surprising amount of compatibility between networks [9].

Adapter topologydiagram b
ABCDE

Pairwise: N(N-1) trained adapters

ABCDEHUB

Interlingua: 2N trained adapters

Five interoperating models. Pairwise wiring needs an adapter per ordered pair and re-training whenever any model updates; the hub needs one encoder and one decoder per model against a versioned interlingua spec.
Injection pathdiagram c
SOURCE MODELlayer k tapENCODERinto interlinguaINTERLINGUAversioned spaceSOFT TOKENSreceiver embedding spaceRECEIVERweights frozen
The deployable insertion point: translated states enter the frozen receiver as soft tokens at the embedding interface. The receiver's weights never change; the dashed boundary marks where vendor access would have to be negotiated.
Section 02 / claim ledger5 entries
  • Evidenced

    A small trained bridge can translate a frozen encoder's latents into a frozen language model's input space. [4],[5]

  • Evidenced

    Continuous vectors prepended at the embedding interface steer a frozen model the way virtual tokens would. [6]

  • Evidenced

    Anchor-relative encodings make representations comparable across models without learning a map between their bases. [7]

  • Evidenced

    Representation geometries of large models converge toward a shared semantic structure as capability grows. [8]

  • Proposed

    A hub interlingua with one encoder and one decoder per model, replacing O(N²) pairwise adapters.

The geometry of alignment

The maths that makes alignment hard: mismatched coordinate systems, unusual activation geometry, and noise that builds up across hops.

Mismatched coordinate systems

Each model's hidden space has its own basis, set independently during training. Representations are only defined up to symmetries: neuron permutations, rotations, and scales that the normalisation layers absorb. With a paired corpus, aligning two spaces is roughly a Procrustes problem (closed-form if you stick to rotations, a learned map otherwise). Without pairings it becomes Gromov-Wasserstein optimal transport, which is much harder. There's also a separate estimation problem in working out which layer of model A corresponds to which layer of model B, because semantic depth doesn't scale linearly with layer index. The standard tool for choosing tap points is CKA over the layer-by-layer similarity grid [10].

Unusual activation geometry

Hidden states occupy only a small part of their ambient space. They cluster in narrow cones [11], and a handful of dimensions carry massive activations that act as internal bias machinery for the host model [12]. Naive cosine alignment breaks on both. So the adapter has to whiten against per-layer statistics, and it has to learn to leave the outlier dimensions alone, because those coordinates do real work inside the host model and carry no meaning for any other model.

Staying on the activation manifold

Mapping 4,096 dimensions to 8,192 is one linear layer, so the change in size is the easy part. The harder part is that valid activations live on a thin manifold inside the ambient space, and a translated vector that misses it produces undefined behaviour. At best that means garbage output, and at worst an accidental jailbreak. Because of this, the adapter needs manifold regularisation during training (a density model or discriminator penalising off-distribution output), and the receiver needs a runtime out-of-distribution gate. Section 05 reuses the same gate as a security control.

Where KV-cache exchange fits

A KV-cache is the most model-specific object in the whole stack. Keys and values are rotated by absolute position under rotary embeddings and shaped by head count, head dimension and grouped-query layout, so a cache is unreadable across architectures without per-layer, position-aware re-basing. Cache-to-Cache makes that work by training projectors for specific model pairs [3], and so far the published work covers only those specific pairs. So the protocol default is layer-output hidden states or pooled representations, and KV exchange stays a fast path inside fleets of identical models.

Continuous channels drift

Discrete tokens come with error correction built in: decoding snaps to the nearest vocabulary item, so small noise disappears at every hop. Continuous vectors have no lattice to snap to, so noise builds up along a multi-hop chain. Our proposed compromise is borrowed from VQ-VAE: quantise messages against a shared, versioned codebook [13]. This gives up a little fidelity in exchange for resynchronisation, compression and, as section 05 covers, a channel you can enumerate and audit.

Section 03 / claim ledger4 entries
  • Evidenced

    Hidden states are comparable across networks only up to symmetries; learned stitching layers can bridge them. [9],[10]

  • Evidenced

    LLM representation spaces are anisotropic, with a few massive outlier activations that the host model depends on. [11],[12]

  • Proposed

    Manifold regularisation on the adapter, plus a discrete codebook bottleneck for resynchronisation on multi-hop chains. [13]

  • Open problem

    Cross-architecture KV-cache translation beyond specific trained pairs of models. [3]

The protocol stack

The proposed four-layer stack, plus what a message on the wire would actually look like.

In the per-pair research systems, transport, representation, meaning and policy all live inside one training run. A protocol needs to separate them, so that each layer can be versioned, evolved and audited on its own. We propose four layers:

The stacklayers L0 to L3
  • L0

    Transport

    Mutually authenticated channels, attestation of the sending stack, replay protection, and per-pair session binding. Assembled from standard security primitives.

    Evidenced
  • L1

    Representation

    The versioned interlingua spec: dimensions, anchor set, normalisation, quantisation codebook, and message framing with signed model and adapter hashes.

    Proposed
  • L2

    Semantics

    Per-model encoder and decoder adapters bound to exact model hashes, capability negotiation at handshake, and drift detection against the calibration corpus.

    Proposed
  • L3

    Governance

    Out-of-distribution gating, injection norm bounds, shadow decoding of every message, audit logs, and rate limits. Reliable oversight of the channel is unsolved.

    Open problem

On the wire, a message is a signed frame. The header pins the payload to the exact model and adapter that produced it, and to the position basis it was computed under. Without that header, the geometry problems in section 03 would make the vector uninterpretable, and the threat model in section 05 would make it dangerous.

Message frameL1
schema
interlingua spec version, codebook version
source
model hash, adapter version
tap
layer index, position basis
payload
interlingua vectors or codebook indices
gloss
optional shadow-decode text, for audit
sig
signature over header and payload

A session opens much like a TLS handshake, with a few extra steps. The two sides negotiate the interlingua version, anchor-set version, codebook version, allowed insertion points and rate limits. Every message is then bound to the session, so a latent crafted for one receiver can't be replayed at another. Attestation is what makes the proprietary case possible at all. The vendor runs the encoder inside its own trust boundary (ideally in attested confidential compute), and only bottlenecked interlingua vectors leave it.

The order of deployment follows access. Open-weight fleets could try the full stack as a research exercise today. Same-vendor fleets could add KV fast paths behind the same framing. The cross-vendor case depends on a provider exposing an attested latent port, and so far no provider offers one. The stack is arranged so that this wait costs little: the lower layers are useful for the homogeneous cases while the governance layer matures.

Section 04 / claim ledger3 entries
  • Proposed

    A four-layer stack separating transport, representation, semantics and governance, so each can evolve and be audited independently.

  • Proposed

    Versioned interlingua and codebook specifications bound to exact model hashes, with drift detection against a calibration corpus.

  • Open problem

    Cross-vendor deployment: no provider currently exposes an attested latent port, so the proprietary case stays hypothetical.

The threat model

Latents leak more than text does, and injected latents reach deeper into a model than prompts do. The threat model, and the defence each attack needs.

The starting point for the threat model is that a transmitted hidden state is more sensitive than the text it encodes. Embedding inversion reconstructs text from embeddings with unsettling fidelity [14], and a full hidden state carries more than a pooled embedding. So latent traffic should be treated as plaintext-equivalent for confidentiality, at the very least. It also leaks model-internal structure, which turns an unmetered latent port into a free distillation oracle for whoever is listening. Encrypting the transport is the baseline, and the controls that matter most sit above it.

Inbound traffic is the more dangerous direction. Mechanically, a received latent is an activation-steering vector [15], and it passes every text-level safety filter because there is no text to filter. The defences reuse the correctness checks from section 03 as security controls:

  • An out-of-distribution gate that rejects vectors outside the expected interlingua distribution.
  • A norm clamp, so a single message can't overpower the host's own activations.
  • Zero-initialised injection gates: injected latents start with zero influence and gain it only through training.
  • Privilege separation: inbound latents are handled as data only. It's the same rule you'd apply to text, enforced at the injection site.

Outbound traffic is a leakage-control problem. The encoder is trained as an information bottleneck [16]: it sends the statistics sufficient for the declared task and destroys the rest, with an adversarial reconstruction attacker kept in the training loop as a check. Quantisation on the wire and rate limits on the port add to that.

The hardest problem is oversight. A latent channel removes the human-readable transcript, and a high-capacity continuous channel makes steganography easy, including agents colluding without their monitor noticing. The design offers four partial measures: shadow-decode every message into a logged text gloss, use the discrete codebook so the channel carries an enumerable vocabulary, run anomaly detection on the traffic, and require high-stakes actions to go through the auditable text channel. A capable enough sender can still evade all four, which is why oversight appears in the open problems in section 06.

Attack surfacesdiagram d
Red marks where the adversary acts; green marks the defence at each station. The monitor's shadow decode is an audit aid, and a colluding sender can encode past it.
Section 05 / claim ledger4 entries
  • Evidenced

    Text embeddings can be inverted back to near-verbatim text, so transmitted latents must be treated as plaintext-equivalent. [14]

  • Evidenced

    Injected vectors act as activation steering, a documented mechanism for redirecting model behaviour. [15]

  • Proposed

    A sender-side information bottleneck, receiver-side gating with norm bounds, and a shadow decode of every message into an auditable text gloss. [16]

  • Open problem

    Reliable oversight of a high-capacity continuous channel: steganographic collusion can evade any monitor named here.

Open problems

The problems this design leaves unsolved, collected in one list.

Each section above ends in a claim ledger, and this section collects the open problems from across the design into one list. These four mark the limits of the design as it stands, and progress on any of them would change the assessment in the sections above. If you know of work on any of them that we've missed, we'd be glad to hear about it through the consultancy site.

Section 06 / claim ledger4 entries
  • Open problem

    Access: proprietary models expose no hidden states, so the cross-vendor case depends on providers standing up attested latent ports.

  • Open problem

    Non-stationarity: every fine-tune shifts a model's activation distribution and silently invalidates its adapters.

  • Open problem

    Oversight: a continuous channel deletes the human-readable transcript, and shadow decoding cannot certify faithfulness.

  • Open problem

    Guarantees: leakage reduction here is attack-resistance engineering, and provable privacy for latent traffic remains unsolved.

The testbed

The plan to make all of this falsifiable: two open-weight models, residual-stream hooks, and a one-command local handoff rig.

The sections above are a design argument. The next step is to connect two real models and see where the design breaks, so that's what we're working on next: a small, simple testbed that turns the sections above into things you can run.

  • Pick a pairing. Two open-weight models from different families, a Qwen and a Llama class model, small enough to sit side by side on a single workstation GPU.
  • Hook the residual streams. Standard interpretability tooling already exposes activations at every layer. The testbed taps both models at matched depths, with section 03's CKA grid choosing the layers.
  • Train the first bridge. A soft-token adapter on a paired activation corpus, with section 02's behavioural-distillation objective as the pass/fail signal.
  • Make it one command. The whole rig packaged as docker-compose or a single CLI, so spinning up a local latent-space handoff between two real models takes minutes to start.

The whole thing will be open source, and we'll publish the evaluation criteria before any results. Four questions decide whether the idea holds up. Firstly, whether the latent handoff beats plain text on real tasks. Secondly, how much data each message costs. Thirdly, whether meaning survives a chain of hops. And finally, whether the security gates from section 05 stop a malicious vector. We'll link the repo here once it exists.

Section 07 / claim ledger3 entries
  • Proposed

    A local handoff testbed pairing open-weight models from different families, with residual-stream taps and a trained soft-token bridge.

  • Proposed

    One-command packaging, docker-compose or a single CLI, so the rig runs on a workstation without setup ceremony.

  • Proposed

    Open source from the first commit, with the evaluation criteria published before any numbers.

References

Numbered in the order they are first cited. Each green EVIDENCED marker above links to at least one of these.