Tommysha/octopus-train
Viewer • Updated • 1 • 133
How to use Tommysha/Octopus-Qwen3.5-4B with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-4B")
model = PeftModel.from_pretrained(base_model, "Tommysha/Octopus-Qwen3.5-4B")Octopus-Qwen3.5-4B is the trained Rank-64 LoRA policy (v45, 1-epoch recursive DAG-GRPO checkpoint) from Octopus: One Brain, Many Branches for Latent-KV Multi-Agent Reinforcement Learning.
OpenResearcher + BrowseComp-Plus BM25): Tommysha/octopus-trainQwen/Qwen3.5-4B (24 Gated DeltaNet recurrent layers + 8 Gated Full-Attention layers)Trained on Qwen/Qwen3.5-4B with pure binary 0/1 outcome rewards and sparse BM25 (zero process shaping), Octopus coordinates multi-agent episodes over a GPU-resident radix DAG via five execution primitives (fork, rewind, read_thread, wait, and done):
830 test queries, sparse BM25): Reaches 49.6% (+17.5 points over 143K Single-Agent GRPO at 32.1%, and +23.6 points over 32K Single-Agent ReAct at 26.0%). Disabling fork at test time on these exact weights drops paired accuracy by -21.7 points (50.8% -> 29.1%), confirming that gains come from live multi-agent execution.500 queries, sparse BM25): Reaches 51.2% (D_max=1) and 46.6% (D_max=inf, 57.2% on completed trees).read_thread): Splices sibling KV pages exclusively into the 8 full-attention layers under monotonic RoPE position offsets while all 24 Gated DeltaNet recurrent layers skip mounted spans—retaining 92.2% answer information and cutting cross-branch task hijacking 21x (57.9% -> 2.7%) with 0 extra KV pages.r=64, alpha=64): Covers all 10 linear projections across attention, SwiGLU MLP, and Gated DeltaNet layers (q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj, in_proj_qkv, in_proj_z, out_proj).830 Queries)
| Method / Agent System | Backbone | Retriever & Tools | Explored / Crit. Path | Gold Doc Open | BrowseComp-Plus Acc. |
|---|---|---|---|---|---|
Single-Agent ReAct (32K Window) |
Qwen3.5-4B |
BM25 (search+open) |
32.6K / 1,043 |
12.2% |
26.0% |
| Multi-Agent Fork (0-Shot Untrained) | Qwen3.5-4B |
BM25 (search+open+tree) |
38.1K / 1,590 |
12.5% |
26.3% |
Single-Agent GRPO (143K Flat Window) |
Qwen3.5-4B |
BM25 (search+open) |
40.8K / 4,075 |
21.1% |
32.1% |
| Context-Summary RL (Shao et al., 2026) | Qwen3.5-9B |
BM25 (search+open+sum) |
<= 32.0K |
— | 42.1% |
| CLM + SCR RL (Shao et al., 2026) | Qwen3.5-9B |
BM25 (search+open+ret) |
<= 32.0K |
— | 42.5% |
Octopus-Qwen3.5-4B (v45, Ours) |
Qwen3.5-4B |
BM25 (search+open+tree) |
329.2K (199.0K net) / 9,919 |
43.3% (58.9% >=1) |
49.6% (+17.5) |
patches/apply_sglang_*.py, which map HuggingFace PEFT in_proj_qkv + in_proj_z onto SGLang's fused in_proj_qkvz):git clone https://github.com/shatianming5/octopus.git
cd octopus
SGL=$(python3 -c "import pathlib, sglang; print(pathlib.Path(sglang.__file__).parent)")
for p in patches/apply_sglang_*.py; do python3 "$p" "$SGL"; done
Qwen/Qwen3.5-4B and Tommysha/Octopus-Qwen3.5-4B:python3 -m sglang.launch_server \
--model-path Qwen/Qwen3.5-4B \
--lora-paths octopus-v45=Tommysha/Octopus-Qwen3.5-4B \
--max-lora-rank 64 \
--lora-target-modules all \
--disable-radix-cache false
scripts/deploy.sh and README.md):bash scripts/deploy.sh /data/octopus check
@article{sha2026octopus,
title = {Octopus: One Brain, Many Branches for Latent-KV Multi-Agent Reinforcement Learning},
author = {Sha, Tianming and Li, Junnan and Zhao, Siqi},
year = {2026},
url = {https://shatianming5.github.io/octopus/}
}