Proposal / Feature Request]: Latent Space (Vector) Communication Protocol for Multi-Agent & Intra-Model Systems
Proposal: Latent Space (Vector) Communication Protocol for Multi-Agent & Intra-Model Systems
About the Author (Disclaimer)
Just to be transparent upfront: I am pro user not a hardcore C++/CUDA systems programmer. I am proudly a "smart copy-paste monkey software architect" – someone who looks at system logic, bottlenecks, and common-sense efficiencies, and asks: "Why are we doing it the hard way?" That it how Gemini describes me and proposal is build by it in behalf of our discussion. And following his recommendation to which repos to post it.
Abstract
Currently, multi-agent LLM systems and even internal model architectures rely on Natural Language (tokens) for communication. This creates a massive performance bottleneck: models must constantly tokenize, perform autoregressive generation, and detokenize data that is meant purely for machine consumption.
Analogously, we wouldn't design a computer system where Photoshop communicates with the OS via English sentences. This proposal suggests establishing a Latent Space Communication Protocol (LSCP), allowing homogenous LLM agents (and internal sub-models/heads) to communicate directly via raw embeddings/vectors, keeping human language strictly as the input/output gateway.
Scope: Where Can This Be Applied?
1. Multi-Agent Systems
- Runtime (Fast Path): Agent A passes its internal latent representation (tensors/embeddings) directly to Agent B. No text generation overhead.
- Auditing / Logging (Background): Raw vectors are asynchronously logged to a database.
- Tooling (Vector Inspector): Just like we don't read raw HTML or TCP/IP packets raw, developers would use an "Inspector" tool to decode latent logs into natural language only when debugging is required.
2. Intra-Model & Hybrid Architectures (MTP & Draft-Main)
- Speculative Decoding / Draft-Main Models: Instead of a small draft model generating actual text tokens for the main model to verify, the draft model could stream its latent hidden states directly to the main model.
- Multi-Token Prediction (MTP) Heads: Internal auxiliary heads could communicate in latent space rather than forcing discrete token selections at every intermediate step.
Anticipated Advantages
- Radical Speedup: Eliminates the slowest part of LLMs—autoregressive text generation and tokenization steps during intermediate agent loops or speculative decoding passes.
- Bandwidth & Compute Efficiency: Dense vector transmission requires significantly fewer compute cycles compared to parsing long strings of text.
- True Machine-to-Machine (M2M) Architecture: Moves AI engineering away from "chatbots talking to chatbots" toward true distributed latent computing.
Addressed Challenges & Mitigations
1. Error Propagation (The "Snowball" Effect)
- Concern: Small mathematical inaccuracies in vector representation could compound over multiple agent hops, leading to hallucinations.
- Mitigation: Just like floating-point arithmetic in traditional software, systems can implement periodic "checkpointing" or semantic validation sanity checks where agents briefly ground their state.
2. Observability & "Black Box" Debugging
- Concern: Developers cannot read raw vectors (
[0.12, -0.85, ...]). - Mitigation: Decouple runtime from debugging. The live system runs purely on vectors. The logs are stored and passed through an offline translator/decoder only when a failure occurs and an engineer needs to inspect the chain of thought.
Conclusion & Next Steps
As multi-agent systems and model architectures scale, natural language inter-component communication will become a severe performance limit. We would love to open a discussion on whether experimental support for latent-space tensor passing could be explored in this framework.
Source: QwenLM/Qwen-Agent