Back to articles
Inference & Serving

Nexus Lets Agents Route Tools Without Re-reading Every Schema

3 min read

Introduction

Tool-using agents built around MCP may have to process a large collection of tool schemas on every turn. As the registry grows, schema prefill consumes more compute and context space, making it a major contributor to time-to-first-token (TTFT). Nexus addresses this bottleneck by separating the question of which tool to use from the more expensive task of encoding every available schema.

How the design works

  • Retrieve before generating. Nexus stores tool representations in an INT8 semantic lookaside buffer (SLB). A calibrated cross-encoder margin gate then selects candidate tools, allowing the main context to avoid carrying the complete registry on every request.
  • Generate from a compact signature. Arguments are produced over a textual tool signature rather than a full schema KV block. The signature has a median length of about 19 tokens, reducing the amount of schema material placed in the active context.
  • Use KV splicing selectively. Nexus also experiments with copying a compiled schema KV block into the live context. This is only a secondary optimization. Rotary positional embeddings make the result sensitive to where the block is inserted: an anchored splice can be output-exact, while an off-anchor placement can distort attention.
  • Repair when depth increases. Beyond the threshold P=256, the system applies a depth-adaptive suffix redecode and can escalate to a complete re-prefill. Its “never-regress” property concerns output fidelity, not a guarantee that latency will always improve.

Results and limitations

On Qwen2.5-14B-Instruct Q4_K_M running on Apple-silicon unified memory, retrieval-based routing stays near 89% accuracy as the registry reaches 250 tools. The first argument token arrives 1.66 times sooner than with full-schema re-prefill, while main-context token use falls by roughly 80%. At that scale, a baseline that concatenates every schema overflows the context window.

KV splicing produces a 1.1–1.7x TTFT improvement at moderate context depth, but the benefit narrows toward parity as depth grows. The repair path preserves top-1 agreement with KL divergence close to zero, although latency can briefly fall to 0.98x of the baseline before converging. A reference-free drift gate also fails to predict positional drift reliably, with a reported Spearman correlation of 0.193.

Why it matters

The strongest lesson from Nexus is not that KV caches can be moved freely. It is that tool routing should be decoupled from full-schema prefill whenever possible, while cache splicing should be treated as a bounded optimization with explicit verification and fallback. This could reduce TTFT and context pressure for agents with large tool registries. However, the quantitative envelope is specific to one model, quantization setting, and hardware platform. Broader tests across models, RoPE implementations, context lengths, and realistic tool distributions are still needed.

arXiv

Comments

Checking sign-in status...

Loading comments...

Related articles

CCTest · Blog
Daedalus-150M Reverses the Usual Recipe for CPU-Friendly Inference
Inference & Serving
cctest.ai

Daedalus-150M Reverses the Usual Recipe for CPU-Friendly Inference

Daedalus-150M was designed from its deployment target backward: single-user, one-token-at-a-time decoding with 4-bit weights on a conventional CPU. By replacing two-thirds of its attention blocks with cache-bounded short convolutions, the model targets the memory costs that become dominant at longer contexts.

Read more
CCTest · Blog
Llama-Mobile Brings VLMs Closer to Mobile Devices with 2.7-Bit Quantization
Inference & Serving
cctest.ai

Llama-Mobile Brings VLMs Closer to Mobile Devices with 2.7-Bit Quantization

Llama-Mobile introduces a quantization pipeline for deploying vision-language models on resource-constrained devices. It uses model-generated data and an Arm-oriented 2.7-bit format to compress Llama 3.2 11B Vision Instruct to 3.7 GB while retaining strong results on standard visual question answering tasks.

Read more