Learning What to Retain: Gated-Memory Routing for Efficient Collaboration in Multi-Agent LLM Systems

AuthorsRakibul Hasan Rajib, Mengxing Zheng, Qian Lou

arXiv 20262026

TL;DR

Gated-Memory Routing uses learned Memory Write and Retrieval Gates plus Adaptive Halting to route multi-agent LLMs, reaching 77.73% average accuracy (+2.44 over Puppeteer-32B) while cutting HumanEval cost by 31.9%.

SharePost on XLinkedIn

Read our summary here, or open the publisher PDF on the next tab.

THE PROBLEM

Execution-history overload from full-history routing hurts accuracy and inflates cost

Routing from the complete execution history forces every decision to process all prior steps, including redundant or low-utility ones, creating execution-history overload.

This overload in multi-agent LLM orchestration raises context length and inference cost, while query-only routing misses evolving errors and gaps, degrading downstream reasoning accuracy.

HOW IT WORKS

Gated-Memory Routing framework

Gated-Memory Routing centers a gated execution memory controlled by a History-Aware Role Allocator, LLM Router, Retrieval Gate, Memory Write Gate, and Adaptive Halting Controller.

You can think of Gated-Memory Routing like a smart RAM plus cache: it only writes novel steps, selectively surfaces relevant records, and stops computation once enough evidence is stored.

This KEY_MECHANISM of routing over a compact, learned execution memory lets Gated-Memory Routing adapt depth, roles, and backbones in ways a plain context window or query-only router cannot.

DIAGRAM

Step-by-step multi-agent inference flow in Gated-Memory Routing

This diagram shows how Gated-Memory Routing iteratively selects roles and backbones, retrieves gated memory, writes new records, and decides to halt.

DIAGRAM

Training and evaluation pipeline for Gated-Memory Routing

This diagram shows how Gated-Memory Routing is trained with GRPO-style group-relative advantages and evaluated across five benchmarks.

PROCESS

How Gated-Memory Routing Handles a Query Execution

  1. 01

    History-Aware Role Allocator

    Gated-Memory Routing encodes the query and current execution memory St−1, then uses the History-Aware Role Allocator to sample a specialization rt whose latent description best matches the state.

  2. 02

    LLM Router

    Conditioned on st and rt, the LLM Router forms a role-conditioned context ut and samples a backbone mt from the heterogeneous LLM pool using learned capability embeddings.

  3. 03

    Retrieval Gate and Memory Write Gate

    The Retrieval Gate independently decides for each stored record whether to surface it into Ct, then the selected agent produces yt and the Memory Write Gate stochastically decides whether to commit et into the gated execution memory.

  4. 04

    Adaptive Halting Controller and Aggregator

    The Adaptive Halting Controller maintains a recurrent summary of St and samples a halt action; if halting, Gated-Memory Routing passes SL to an Aggregator LLM to generate the final answer y.

KEY CONTRIBUTIONS

Key Contributions

  • 01

    Routing over a learned gated execution memory

    Gated-Memory Routing replaces query-only and full-history routing by conditioning all orchestration decisions on a selective execution memory curated by the Memory Write Gate and Retrieval Gate, improving average accuracy to 77.73% (+2.44 over Puppeteer-32B).

  • 02

    Memory curation and budget-aware halting

    Gated-Memory Routing trains the Memory Write Gate, Retrieval Gate, and Adaptive Halting Controller jointly under a cost-aware objective, enabling compact high-signal memory and adaptive reasoning depth tied to a per-query budget.

  • 03

    Empirical effectiveness and efficiency across five benchmarks

    Gated-Memory Routing achieves the best average accuracy on MATH, GSM-Hard, MBPP, HumanEval, and MMLU-Pro while reducing HumanEval inference cost by 31.9% relative to Puppeteer (qwen-2.5-32B), and 43.86% relative to MASRouter.

RESULTS

By the Numbers

Avg. accuracy

77.73%

+2.44 over Puppeteer (qwen-2.5-32B)

HumanEval pass@1

89.84%

+4.68 over MASRouter (85.16%)

GSM-Hard accuracy

70.55%

+3.03 over MASRouter (66.00%)

MBPP pass@1

79.60%

+0.40 over MASRouter (79.20%)

On GSM-Hard, MATH, MBPP, HumanEval, and MMLU-Pro, Gated-Memory Routing reaches 77.73% average accuracy versus 75.29% for Puppeteer-32B. These results show that routing over gated execution memory improves both reasoning quality and cost efficiency in multi-agent LLM systems.

BENCHMARK

By the Numbers

On GSM-Hard, MATH, MBPP, HumanEval, and MMLU-Pro, Gated-Memory Routing reaches 77.73% average accuracy versus 75.29% for Puppeteer-32B. These results show that routing over gated execution memory improves both reasoning quality and cost efficiency in multi-agent LLM systems.

BENCHMARK

Average accuracy across five benchmarks

Average accuracy (%) over MATH, GSM-Hard, MBPP, HumanEval, and MMLU-Pro for Gated-Memory Routing and key baselines.

BENCHMARK

HumanEval pass@1 comparison

HumanEval pass@1 (%) for Gated-Memory Routing and selected baselines.

KEY INSIGHT

The Counterintuitive Finding

Gated-Memory Routing matches or beats full-history routing accuracy (70.55% vs 70.27% on GSM-Hard) while reducing cost by roughly 40% on GSM-Hard and over 50% on HumanEval.

This is surprising because you might expect feeding agents the entire execution history to help, but Gated-Memory Routing shows that selective memory can preserve accuracy while drastically cutting inference cost.

WHY IT MATTERS

What this unlocks for the field

Gated-Memory Routing unlocks multi-agent LLM systems that learn what to retain, what to surface, and when to stop, instead of blindly accumulating context.

Builders can now design orchestration policies that jointly route roles, backbones, memory writes, retrieval, and halting, making complex reasoning workflows both more accurate and cost-aware in production settings.

~14 min read← Back to papers

Related papers

BenchmarkAgent Memory

Active Context Compression: Autonomous Memory Management in LLM Agents

Nikhil Verma

· 2026

Focus Agent adds start_focus, complete_focus, a persistent Knowledge block, and an optimized Persistent Bash plus String-Replace Editor scaffold to actively compress context during long software-engineering tasks. On five hard SWE-bench Lite instances against a Baseline ReAct agent, Focus Agent achieves 22.7% token reduction (14.9M → 11.5M) while matching 3/5 = 60% task success.

Agent Memory

ActMem: Bridging the Gap Between Memory Retrieval and Reasoning in LLM Agents

Xiaohui Zhang, Zequn Sun et al.

· 2026

ActMem transforms dialogue history into atomic facts via Memory Fact Extraction, groups them with Fact Clustering, links them through a Memory KG Construction module, and uses Counterfactual-based Retrieval and Reasoning for action-aware answers. On ActMemEval, ActMem reaches 76.52% QA accuracy with DeepSeek-V3, beating LightMem’s 63.97% by 12.55 points and NaiveRAG’s 61.54%.

Questions about this paper?

Paper: Learning What to Retain: Gated-Memory Routing for Efficient Collaboration in Multi-Agent LLM Systems

Answers use this explainer on Memory Papers.

Checking…