RecursiveMAS
A recursive latent-state framework for training and evaluating collaborating role-specific models.
What does this agent do, and when should you use it?
RecursiveMAS is a research implementation that treats multi-agent collaboration as one recursive computation, with lightweight RecursiveLink modules exchanging and refining latent states across heterogeneous roles. The repository contains an inference and downstream-evaluation pipeline in inference/ plus inner- and outer-loop training scripts in train/. It releases sequential, mixture, distillation, and deliberation collaboration styles, together with corresponding Hugging Face reference checkpoints and training datasets. Its primary entry points are inference/run.py, train/train_inner.py, and train/train_outer.py, producing evaluations across math, science, medicine, code generation, and search QA benchmarks. It fits teams investigating or reproducing recursive multi-model collaboration, rather than buyers seeking a documented hosted chat product or general-purpose agent service.
train/train_inner.py trains each role's inner RecursiveLink while keeping the base model frozen and training a small ln_res_adapter. train/train_outer.py then connects the role-specific models for a selected collaboration style and trains the cross-agent outer RecursiveLink through recursion. For inference, inference/run.py loads a released reference system or locally supplied checkpoints selected with --style, --dataset, and optional --ckpt_override arguments, then evaluates it. Documented benchmarks are math500, gpqa, medqa, mbppplus, aime25, aime26, livecodebench, bamboogle, and hotpotqa, with accuracy, test-pass rate, pass@k, EM, or LLM-as-Judge metrics as applicable. Deliberation runs on bamboogle and hotpotqa can have a Tool-Caller query a real search API, while open-ended grading can use an OpenAI-compatible judge API.
- A researcher reproduces sequential math collaboration by training role-specific inner modules, training an outer module, and evaluating on Math500.
- An ML team uses released sequential_light or sequential_scaled reference checkpoints to test recursive role collaboration on math, science, or code benchmarks.
- A developer trains separate math, code, science, and summarizer roles for the mixture style before training its outer links.
- A team evaluating expert–learner coordination trains a distillation-style setup with the documented Distillation-Math or Distillation-Code datasets.
- A retrieval-QA researcher runs deliberation on bamboogle or hotpotqa and supplies a search API key for the Tool-Caller.
What are this agent's strengths and limitations?
- It makes inter-role coordination a trainable RecursiveLink mechanism, with separate within-role inner and cross-role outer training stages.
- It releases four concrete collaboration patterns—sequential, mixture, distillation, and deliberation—rather than a single orchestration example.
- It documents an experimental path from training datasets and scripts through reference checkpoints to downstream evaluation.
- Its stated benchmark coverage spans math, graduate science, medical QA, code generation, and open-domain search QA.
- The documented examples use CUDA, while released model combinations depend on named Qwen, Llama, Gemma, DeepSeek, and BioMistral models and Hugging Face assets.
- The repository says full paper reproduction requires task-specific data and configurations matched to each collaboration style; reference checkpoints are not a universal replacement.
- Deliberation on bamboogle and hotpotqa needs a real search API and key, and open-ended grading requires a separately configured OpenAI-compatible judge endpoint.
- There is no documented native integration with ChatGPT, Codex, Claude, or MCP; the OpenAI-compatible API path is documented only for judging.
How do you install or deploy this agent?
Create and activate a Python 3.10 environment, then install the repository requirements from the project root:
conda create -n recursivemas python=3.10 -y
conda activate recursivemas
pip install -r requirements.txt
For deliberation runs on search datasets, place a search API key in a plain-text file and provide it with --tavily_keys_file. For LLM judging of open-ended answers, set API_KEY, API_BASE_URL, and API_MODEL.
How do you use this agent?
Run a released reference system, for example:
python inference/run.py \
--style sequential_scaled \
--dataset math500 \
--device cuda
For local training outputs, add --ckpt_override entries such as planner=train/ckpts/seq_light/planner_math and outer=train/ckpts/seq_light/outer_math. The documented workflow first uses train/train_inner.py for role-specific inner modules, then train/train_outer.py for outer links using the matching collaboration style and dataset. In Python, import load_mas_system from system_loader and call load_mas_system(style="sequential_light", device="cuda", trust_remote_code=True).
How does this agent compare with similar options?
The repository acknowledges vLLM, ARPO, and TextGrad as open-source foundations, but does not provide a feature comparison with those projects or other multi-agent frameworks.