AgentGroupChat-V2: Divide-and-Conquer Is What LLM-Based Multi-Agent System Need

July 29, 2025 ยท View on GitHub

arXiv Python License

Framework Overview

๐Ÿ“– Paper Introduction

AgentGroupChat-V2 is a general-purpose LLM-based multi-agent collaboration framework specifically designed for complex reasoning and task decomposition problems. This framework significantly improves the performance and efficiency of multi-agent systems through innovative divide-and-conquer strategies.

๐ŸŽฏ Core Innovations

  1. Fully Parallel Architecture - Adopts a divide-and-conquer architecture with three coordinated management modules, supporting distributed concurrent processing and significantly improving system throughput and resource utilization

  2. Task-level Divide-and-Conquer - Through dynamic task tree decomposition, complex queries are hierarchically broken down into manageable subtasks with optimized dependency management and parallel execution

  3. Execution-level Divide-and-Conquer - Through specialized agent role assignment, different LLMs assume distinct roles and focus on specific aspects of problem-solving, enabling adaptive collaboration

๐Ÿš€ Performance Highlights

Performance Results

Our experimental results demonstrate that AgentGroupChat-V2 achieves significant performance improvements across multiple benchmark tasks:

  • Mathematical Reasoning: Achieves 91.50% accuracy on GSM8K, exceeding the best baseline by 5.6 percentage points
  • Competition Mathematics: Reaches 30.4% accuracy on AIME, nearly doubling other methods' performance
  • Code Generation: Achieves 79.20% pass@1 performance on HumanEval
  • Complex Reasoning: Improvements exceed 11 percentage points on Level 5 MATH problems

Notably, performance advantages become increasingly pronounced with higher task difficulty, proving the effectiveness of our divide-and-conquer strategy in handling complex problems.

๐Ÿ—๏ธ System Architecture

System Architecture

AgentGroupChat-V2 employs a three-module architecture:

  • Query Manager: Responsible for frontend interaction and query decomposition
  • Task Manager: Handles task flow management and dependency processing
  • Group Manager: Manages multi-agent collaborative execution

๐Ÿš€ Code Running Guide

Environment Setup

git clone https://github.com/your-username/AgentGroupChat-V2.git
cd AgentGroupChat-V2
pip install -r requirements.txt

Running All Baseline Experiments + AgentGroupChat-V2 Experiments

1. Setup Task Folders

Copy ./tasks/MATH/ to respective task folders: ./tasks/xxx, where xxx is the task name.

For example:

cp -r ./tasks/MATH/ ./tasks/GSM8K/
cp -r ./tasks/MATH/ ./tasks/HumanEval/
# Jialing needs to copy GSM8K folder to a new GSM8K-level5 folder
cp -r ./tasks/GSM8K/ ./tasks/GSM8K-level5/

2. Modify Configuration Files

Modify various .py files in ./tasks/xxx, mainly involving the following content:

# Project path configuration
MODULE_PATH = "/path/to/your/AgentGroupChat-V2"  # Change to your project's absolute path

# API configuration
ENGINE = "xxx"  # Keep unchanged
API_KEY = "your_api_key_here"  # Use your own AIGC website API
MAX_RETRY = 10  # Keep unchanged
SAVE_PATH = "result_naive.json"  # Result save file

# Log and result directories
LOG_DIR = "tasks/your_task_name/logs_qwen_72b"  # Change MATH to your task name
SAVE_DIR = "tasks/your_task_name/results_qwen_72b"  # Change MATH to your task name
ENGINE_NAME = "TA/Qwen/Qwen2.5-72B-Instruct"  # Model to use, note to change to qwen2.5 and llama3.1
# Dataset configuration
test_file = "tasks/your_task_name/dataset/test.json"  # Read dataset file
# Note: Jialing's task might not have test_file, replaced by load_dataset(xxx)
# After loading, write code to filter, only need level 5 data
# Main execution loop
for i in range(num_problems):
    print(f"========== Solving {i}/{num_problems} Problem ==========")
    problem = test_data[i]
    question, ground_truth = problem["problem"], problem["solution"]  # Read dataset
    
    # Extract ground truth
    pattern = r"\\boxed\{(.*)\}"
    match = regex.search(pattern, ground_truth, flags=regex.DOTALL)
    ground_truth = match.group(1)

    try:
        success, result = solve_problem(question, ground_truth)  # Get prompt + call API
        # ... Process results

3. AgentGroupChat Role Configuration

Group chat role configuration files are located in the ./tasks/xxx/characters directory. You can refer to existing examples for configuration.

4. Run Experiments

# Run experiments for specific tasks
cd tasks/your_task_name
python run_experiment.py

# Or run all baseline comparisons
python run_all_baselines.py

โš ๏ธ Important Notice - Current Code Status

๐Ÿ–๏ธ Author Vacation Notice ๐Ÿ–๏ธ

Due to the first author rushing to go on vacation, the current open-source version only includes the core agent group chat functionality code of AgentGroupChat-V2!

๐Ÿ“‹ Currently Available Features:

  • โœ… Multi-agent group chat collaboration core algorithms
  • โœ… Complete reproduction code for paper experimental results
  • โœ… Comparison experiments with various baseline methods

๐Ÿšง Not Yet Open-Sourced:

  • โŒ Complete three-module system architecture (Query Manager, Task Manager, Group Manager)
  • โŒ Adaptive LLM selection engine

Expected Update Time: The author will immediately organize and open-source the complete framework code after returning from vacation in the middle of July!

The current code differs from the complete framework described in the paper, mainly because the framework part of the code is still being organized. Please wait patiently for the release of the complete version!

๐Ÿ“Š Experimental Results

We evaluated AgentGroupChat-V2's performance on multiple benchmark datasets:

Mathematical Reasoning Tasks

MethodGSM8KMATH L5AIME
Naive35.70%19.84%10.0%
Naive-CoT87.33%67.32%16.7%
AutoGen85.21%66.93%20.0%
AgentGroupChat-V291.50%83.54%30.4%

Code Generation Tasks

MethodHumanEval (pass@1)MBPP (pass@1)
Naive68.90%51.80%
ReAct78.53%55.88%
AgentGroupChat-V279.20%58.84%

DIR

./
โ”œโ”€โ”€ evaluation
โ”‚   โ”œโ”€โ”€ config.py                          # ้…็ฝฎๆ–‡ไปถ
โ”‚   โ”œโ”€โ”€ main.py                           # ไธป่ฟ่กŒๅ™จ
โ”‚   โ”œโ”€โ”€ run_tasks.sh                      # Shell่„šๆœฌ
โ”‚   โ”œโ”€โ”€ data_loader.py                    # ๆ•ฐๆฎๅŠ ่ฝฝๅ™จ
โ”‚   โ”œโ”€โ”€ problem_parser.py                 # ้—ฎ้ข˜่งฃๆžๅ™จ
โ”‚   โ”œโ”€โ”€ solver.py                         # ้€š็”จๆฑ‚่งฃๅ™จ
โ”‚   โ”œโ”€โ”€ code_evaluator.py                 # ไปฃ็ ่ฏ„ไผฐๅ™จ
โ”‚   โ”œโ”€โ”€ character_manager.py              # ่ง’่‰ฒ็ฎก็†ๅ™จ
โ”‚   โ”œโ”€โ”€ character_generator.py            # ่ง’่‰ฒ็”Ÿๆˆๅ™จ
โ”œโ”€โ”€ models/                           # ๆจกๅž‹่ฐƒ็”จๆจกๅ—
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ unified_model_client.py       # ็ปŸไธ€ๆจกๅž‹ๅฎขๆˆท็ซฏ
โ”‚   โ”œโ”€โ”€ generator.py                  # ๆจกๅž‹็”Ÿๆˆๅ™จ๏ผˆๅทฒไฟฎๆ”นไธบAPIๅผ๏ผ‰
โ”‚   โ”œโ”€โ”€ api_models.py                 # APIๆจกๅž‹่ฐƒ็”จ๏ผˆๅทฒไฟฎๆ”น๏ผ‰
โ”‚   โ””โ”€โ”€ model_utils.py                # ๆจกๅž‹่ฐƒ็”จๅทฅๅ…ทๅ‡ฝๆ•ฐ
โ”œโ”€โ”€ environment/                      # ็Žฏๅขƒ็ฎก็†ๆจกๅ—
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ managers/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ event_manager.py          # ไบ‹ไปถ็ฎก็†ๅ™จ
โ”‚   โ”‚   โ”œโ”€โ”€ group_manager.py          # ็พค็ป„็ฎก็†ๅ™จ
โ”‚   โ”‚   โ”œโ”€โ”€ task_manager.py           # ไปปๅŠก็ฎก็†ๅ™จ
โ”‚   โ”‚   โ””โ”€โ”€ actions.py                # ๅŠจไฝœ็ฎก็†ๅ™จ๏ผˆ้œ€ไฟฎๆ”นๆจกๅž‹่ฐƒ็”จ๏ผ‰
โ”‚   โ””โ”€โ”€ characters/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ””โ”€โ”€ character.py              # ่ง’่‰ฒ็ฑป
โ”œโ”€โ”€ prompts/                          # Promptๆจกๆฟ
โ”‚   โ””โ”€โ”€ managers/
โ”‚       โ””โ”€โ”€ prompt_character_generation.txt  # ่ง’่‰ฒ็”Ÿๆˆprompt
โ”œโ”€โ”€ tasks/                            # ไปปๅŠก็›ธๅ…ณๆ–‡ไปถ
โ”‚   โ”œโ”€โ”€ AIME/
โ”‚   โ”‚   โ”œโ”€โ”€ characters/               # ้ข„ๅฎšไน‰่ง’่‰ฒ
โ”‚   โ”‚   โ”œโ”€โ”€ dataset/                  # ๆ•ฐๆฎ้›†
โ”‚   โ”‚   โ”œโ”€โ”€ logs_*/                   # ๆ—ฅๅฟ—็›ฎๅฝ•
โ”‚   โ”‚   โ””โ”€โ”€ results_*/                # ็ป“ๆžœ็›ฎๅฝ•
โ”‚   โ”œโ”€โ”€ Finance/
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ GSM8K/
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ HellaSwag/
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ HumanEval/
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ MBPP/
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ StructText/
โ”‚       โ””โ”€โ”€ ...
โ”‚โ”€โ”€ characters/                       # ็”Ÿๆˆ็š„่ง’่‰ฒ็›ฎๅฝ•
โ”‚   โ”œโ”€โ”€ gen_aime/                     # ่‡ชๅŠจ็”Ÿๆˆ็š„AIME่ง’่‰ฒ
โ”‚   โ”œโ”€โ”€ gen_finance/                  # ่‡ชๅŠจ็”Ÿๆˆ็š„Finance่ง’่‰ฒ
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ logger.py                         # ๆ—ฅๅฟ—่ฎฐๅฝ•ๅ™จ
โ”œโ”€โ”€ utils.py                          # ๅทฅๅ…ทๅ‡ฝๆ•ฐ
โ”œโ”€โ”€ config.py                         # ๅทฅๅ…ทๅ‡ฝๆ•ฐ
โ”œโ”€โ”€ run_evaluation.sh                 # ๅทฅๅ…ทๅ‡ฝๆ•ฐ

๐Ÿค Contributing

We welcome community contributions! Please refer to the following ways:

  1. ๐Ÿ› Bug Reports: Use GitHub Issues to report problems
  2. ๐Ÿ’ก Feature Suggestions: Submit Enhancement Issues
  3. ๐Ÿ”ง Code Contributions: Submit Pull Requests

๐Ÿ“„ Citation

If you use AgentGroupChat-V2 in your research, please cite our paper:

@article{gu2024agentgroupchatv2,
  title={AgentGroupChat-V2: Divide-and-Conquer Is What LLM-Based Multi-Agent System Need},
  author={Gu, Zhouhong and Zhu, Xiaoxuan and Cai, Yin and others},
  journal={arXiv preprint arXiv:TO BE UPDATED},
  year={2025}
}

๐Ÿ“ž Contact Us

  • ๐Ÿ“ง Email: zhgu22@m.fudan.edu.cn
  • ๐Ÿข Institution: Shanghai Key Laboratory of Data Science, Fudan University

๐ŸŒŸ If this project helps you, please give us a star! ๐ŸŒŸ