Latent Space Relay: Using Large Models to Read and Small Models to Answer
This article examines a latent-space relay architecture that pairs a large model for long-context understanding with a small local model for high-speed generation. It breaks down feasibility across four dimensions—VRAM capacity, IO bandwidth, prefill versus decode compute, and representation alignment—outlines a layered design with key engineering practices, and discusses whether AI Agents will move toward latent-space communication.
1. The Problem: Concentrated Capability Meets Distributed Compute
In the current open-source ecosystem, 700B-class models represent the ceiling for logical reasoning and knowledge capacity. Take a 753B-parameter model as an example: a rough estimate at 1 Byte per weight puts the main matrices at around 753GB of VRAM. Once the official FP8 checkpoint adds extra parameters for scales, norms, and multi-token prediction, the total file size reaches roughly 755.6GB. That is far beyond the capacity of a single consumer GPU, and beyond the multi-GPU interconnect capability of most workstations.
Meanwhile, 4B-class small models on local devices already sustain generation speeds above 100 token/s. This suggests a natural engineering idea: split “reading the question” from “writing the answer,” letting the large model handle long-context understanding and the small model handle high-speed output. For this idea to hold, three questions must be answered: how the intermediate representation is passed, how latency is allocated, and whether the quality loss is acceptable.
2. Feasibility Across Four Dimensions
2.1 VRAM Capacity: Layered Loading and On-Demand Residency
A 755.6GB checkpoint cannot stay fully resident. There are three viable paths: stream weights layer by layer from object storage or a local high-speed SSD; keep weights in a low-bit quantized form and dequantize only the currently active layers; or orchestrate multiple machines and GPUs through a container platform, sharding tensor parallelism across nodes. All three share one constraint: the number of parameters actually participating in computation at any moment must fit in VRAM.
2.2 IO Bottleneck: Bandwidth Sets Time to First Token
If weights reside in external storage, every generated token requires re-reading all active weights, and PCIe plus storage bandwidth translate directly into time to first token. The common engineering approach is to read the large model during the prefill stage and hand decoding to the small model, compressing the large model’s IO cost into a one-time long-context encoding and avoiding repeated per-token reads.
2.3 Compute Time: Prefill and Decode Have Asymmetric Costs
Long-context prefill is compute-intensive, and attention cost for a 128K context grows non-linearly with sequence length. Decoding is memory-access-intensive, with cost driven mainly by weight size. Assigning the compute-intensive part to the large model and the memory-access-intensive part to the small model therefore matches the differing characteristics of the two hardware profiles.
2.4 Latent Space Bridging: Representation Alignment Is the Core Difficulty
Two models of different scale and different training recipes do not have naturally aligned hidden representation spaces. Directly transplanting the hidden state from a given layer often causes semantic drift in the small model’s output. Practical mitigations include: choosing a more semantically abstract intermediate layer as the interface; using a small projection matrix to map dimensions and distributions; lightly fine-tuning the projection layer on paired corpora; and keeping the original question as a conditioning input on the inference side, forming a dual-channel prompt of “hidden state + text.”
Illustrative pseudocode:
# The large model performs a single long-context encodinghidden = large_model.encode(long_context, layer=k)# Project into the small model's representation spacebridge = align(hidden) # lightweight linear/MLP mapping# The small model decodes at high speed, with the original question as text conditioninganswer = small_model.generate(prompt=question,prefix_state=bridge,max_new_tokens=1024)
3. Recommended Layered Architecture and Engineering Practices
The overall pipeline can be summarized as follows: the long context enters the large model for structured understanding, producing an intermediate representation and a summary of key points; the intermediate representation is mapped by an alignment module and handed to the local small model together with the original question; the small model produces the final answer at speeds on the order of hundreds of tokens per second. Four points deserve attention in engineering: caching and reuse, persisting the encoding of long documents to avoid repeated prefill; batching and scheduling, using a message queue to smooth peaks and monitoring with alerts to track time to first token and throughput; a fallback strategy that reverts to a pure text pipeline of “summary text + small model” when alignment confidence is insufficient; and an evaluation loop that uses a unified test set to quantify the accuracy loss of the relay approach relative to a single model.
4. Will AI Agents Move Toward Latent Space Communication?
Latent space communication looks more like a transitional form within a layered inference stack. Its value lies in passing high-dimensional semantics at very low bandwidth cost, which naturally fits multi-role Agent collaboration and long chains of tool calls. Its stability, however, is constrained by representation alignment quality, model version drift, and the lack of interpretability. A more realistic direction is a hybrid protocol of “structured intermediate artifacts + optional hidden states”: readable structures such as key points, slots, and call parameters form the backbone, with hidden states serving as an enhancement channel. For teams that want to balance long-context understanding and generation speed on limited hardware, validating the layered pipeline first on the general container and storage capabilities of a platform such as Baidu AI Cloud, then gradually introducing representation alignment optimization, is the lowest-risk path to production.
