Octopus: One Brain, Many Branches for Latent-KV Multi-Agent Reinforcement Learning

Tianming Sha
11/3/2026
cs.LGcs.CL
rlrlhf-rlvr-dpo

No official code found. Best implementation: shatianming5/octopus (3 stars, Python, Apache-2.0, last commit 2026-11-04).

Abstract

Multi-agent LLM systems explore in parallel by spawning sub-agents with isolated context windows, whereas single-agent systems append every search and verification step into one growing trajectory. However, existing multi-agent frameworks duplicate prefix KV caches across branches, exchange findings by re-prefilling text summaries, and flatten or drop cross-branch dependencies during reinforcement learning (RL).

Show full abstract

We introduce Octopus, a single-model multi-agent RL framework in which all threads share one backbone and coordinate over a GPU-resident directed acyclic graph (DAG) of KV states through five primitives (fork, read_thread, wait_threads, rewind, commit). Octopus combines three co-designed mechanisms: (1) Zero-Copy Radix Forking, which spawns branches as $\mathcal{O}(1)$ cursor views over shared physical KV pages; (2) Attention-Only KV Mounting, which mounts a sibling thread's terminal KV blocks directly into full-attention layers while bypassing linear-recurrent states (Gated DeltaNet / Mamba-2), cutting off-task hijacking by $21\times$ ($57.9\% \to 2.7\%$) while retaining $92.2\%$ of full-text mutual information at zero extra KV allocation; and (3) a Packed DAG-GRPO Trainer, which packs all episode branches into one block-sparse attention pass and assigns counterfactual branch credit via leave-one-branch-out marginal rewards. Trained end-to-end with GRPO on Qwen3.5-4B over a sparse BM25 corpus, Octopus reaches $49.6\%$ accuracy on BrowseComp-Plus ($+17.5$ points over single-agent GRPO at 143K context and $+12.5$ points over text-summary multi-agent RL) and $51.2\%$ on OpenResearcher, outperforming dense-retrieval agents up to $250\times$ larger while increasing training throughput $3.3\times$ and cutting peak KV memory $2.8\times$.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Octopus: One Brain, Many Branches for Latent-KV Multi-Agent Reinforcement Learning

30Python, ShellNov 2, 20263 weeks agoApache-2.0
agentic-rldeep-researchflash-linear-attentionhybrid-architecturekv-cache+6 more

Similar Papers

Cite this paper

@article{sha2026octopus,
  title  = {Octopus: One Brain, Many Branches for Latent-KV Multi-Agent Reinforcement Learning},
  author = {Tianming Sha},
  year   = {2026},
  eprint = {2611.06956},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.06956v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.06956.svg)](https://codeofpaper.com/paper/2611.06956)

Discussion