NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

OOPMAS: Object-Oriented Multi-Agent Systems for Query-Level Workflow Generation

Qi Cheng, Shengyu Chen, Wei Cheng, Yiqun Xie, Xiaowei Jia, Haoyu Wang, Haifeng ChenarXiv 2026

TL;DR

OOPMAS is a training-free framework that dynamically generates custom multi-agent systems—both the agents themselves and their coordination workflows—for every individual query. By representing agents as object-oriented Python classes and using a dynamic "skill library" for iterative refinement, it achieves a massive 18.1 percentage point lead over state-of-the-art baselines on heterogeneous task benchmarks.

What Problem Does This Paper Address?

Building effective Multi-Agent Systems (MAS) for LLMs is currently a manual, labor-intensive process. While recent research has tried to automate this, most methods operate at the task level. They optimize a single, fixed workflow for an entire benchmark (e.g., one workflow for all math problems).

The authors argue this approach fails in the real world for two reasons:

  1. Query Heterogeneity: Real-world workloads are messy. A system might receive a Python coding challenge followed immediately by a complex graduate-level physics question. A fixed workflow optimized for code is useless for physics.
  2. Difficulty Variance: Even within one task, an "easy" query might only need a single LLM call, while a "hard" one requires a multi-step pipeline with planners and reviewers. Fixed topologies cannot adapt to this spectrum.
Figure 1: Task-level workflows fail on real-world query streams. Each fixed workflow catches only its native domain; queries from other domains and multi-domain queries (gray) are missed. No single workflow handles the full mixed distribution.

Methods

OOPMAS (Object-Oriented Programming Multi-Agent Systems) shifts the optimization target from the task to the individual query.

Key technical innovations include:

  • Object-Oriented Agent Representation: Agents are defined as Python classes. This naturally encapsulates their role prompts, specific tool bindings, and persistent internal state (like conversation history). Because LLMs are pre-trained on vast amounts of code, they are much more reliable at generating these standard OOP patterns than custom domain-specific languages.
  • Two-Phase Generation:
    1. Agent Generation: A "meta-agent" creates a pool of specialist agents tailored to the query. It performs a "coverage check" to ensure the agents have the necessary expertise.
  • Workflow Generation: The meta-agent writes an executable main() Python function that orchestrates these agents.
  • Dynamic Skill Library ($K$): The system doesn't just "guess" the best workflow. It runs the generated code, evaluates the output, and if it fails, a diagnosis agent distills the failure into a "skill" (a structured lesson). These skills are injected back into the meta-agent's prompt for the next optimization round, enabling in-context improvement without any gradient updates or fine-tuning.
Figure 2: The OOPMAS pipeline. (a) A meta-agent emits a tailored agent set Aq for each query. (b) A second meta-agent emits an executable workflow Wq over Aq, conditioned on the skill library K. (c) Wq is run and scored; failures are diagnosed. (d) Each diagnosis distills a reusable skill into K, which is injected into workflow generation in subsequent rounds. Training-free.

Datasets

The authors introduced two new benchmarks to test MAS under realistic, heterogeneous conditions:

  • Mixed Benchmark: 120 queries spanning code (HumanEval, MBPP), math (MATH, GSM8K), and QA (HotpotQA, DROP).
  • Hard Mixed Benchmark: 180 competition-level queries designed to stress-test adaptation. This includes AIME (math), LiveCodeBench/CodeContests (code), and GPQA Diamond (science QA). These tasks have diverse output formats (integers, full programs, multiple-choice), making fixed templates nearly impossible to use.

Key Insights and Ideas

  • The "Agent Pool" is a Bottleneck: Previous methods kept the agent pool fixed and only searched for workflows. OOPMAS shows that dynamically synthesizing the agents themselves—giving them the exact tools and personas needed for a specific niche—is a primary driver of accuracy.
  • Code as the Universal Coordinator: By treating MAS design as a code generation problem rather than a graph-search problem, the system leverages the LLM's inherent programming strengths.
  • Robustness to Difficulty: While baselines often "collapsed" on hard tasks (e.g., AFlow dropping to 0% on competitive coding because its fixed template didn't match the required I/O format), OOPMAS maintained high performance by simply writing a new, compatible workflow for those specific queries.

Key Results

OOPMAS demonstrates significant performance gains across the board, particularly as task difficulty increases.

  • Superior Accuracy: On the Mixed benchmark, OOPMAS achieved 89.6% accuracy, outperforming the strongest baseline (ADAS) by 18.1 points.
  • Generalization to Hard Tasks: On the Hard Mixed benchmark, it reached 90.8%, maintaining a similar 18.5-point lead over baselines.
  • Scaling with Backbones: A model-swap study showed that as the underlying LLM gets stronger (from GPT-4.1 to GPT-5.2), OOPMAS scales smoothly, reaching a peak of 92.4%.
Table 1: Accuracy (%) on the Mixed and Hard Mixed benchmarks. All methods use GPT-5 as the worker model and receive the same mixed batch of queries. Best results in bold.

Limitations and Future Work

  • Meta-Agent Strength: The system's success depends heavily on the meta-agent's ability to write bug-free Python. With weaker models (like GPT-5-nano), fixed scaffolds like AFlow can actually be more robust.
  • Inference Cost: Generating a custom MAS per query and running iterative repair rounds is significantly more expensive in terms of tokens and time than using a fixed workflow. The authors suggest "selective deployment"—routing easy queries to simple agents and saving the full OOPMAS pipeline for high-value, difficult queries.
  • Skill Persistence: Currently, the skill library is "run-local," meaning it helps within a single optimization session but doesn't yet persist across different deployments or long-term query streams. Expanding this into a global, persistent memory is a clear next step.

Summary updated

BibTeX
@misc{cheng2026oopmas,
  author = {Qi Cheng and Shengyu Chen and Wei Cheng and Yiqun Xie and Xiaowei Jia and Haoyu Wang and Haifeng Chen},
  title = {{OOPMAS: Object-Oriented Multi-Agent Systems for Query-Level Workflow Generation}},
  year = {2026},
  eprint = {2610.07787},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.07787},
}
Figure