Skip to content

Repository files navigation

MACA: Multi-Agent Consensus Alignment

A framework for training language models through multi-agent debate and preference learning

License: MITPython 3.8+arXiv


📖 Overview

MACA (Multi-Agent Consensus Alignment) is a complete implementation of the research paper "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (Meta AI, 2024). It provides tools for improving LLM reasoning through multi-agent debate and preference-based fine-tuning.

Key Features

  • 🤖 Multi-Agent Debates: Orchestrate M agents across R rounds to generate diverse reasoning
  • 🎯 Consensus Calculation: Majority voting to identify preferred vs rejected responses
  • 📊 DPO Training: Direct Preference Optimization using consensus-derived training pairs
  • 🔌 Claude Code Integration: Complete plugin with agents, skills, hooks, and MCP server
  • 🚀 End-to-End Pipeline: From debate generation to model fine-tuning and evaluation
  • 🌐 Domain-Agnostic: Apply to any domain requiring preference-based alignment

Research Results (from original MACA paper)

  • +27.6% improvement on GSM8K (self-consistency)
  • +23.7% improvement on MATH (single-agent reasoning)
  • +22.4% improvement on MATH (Pass@20 sampling)
  • +42.7% improvement on MathQA (multi-agent decision-making)

🧠 How It Works

1. Multi-Agent Debate

M agents (LLM clones) engage in R rounds of structured debate:

Round 1 (Independent):
Agent 1: [independent response]
Agent 2: [independent response]
...
Agent M: [independent response]
Round 2 (Peer Feedback):
Agent 1: [revised response after seeing peers]
Agent 2: [revised response after seeing peers]
...
Agent M: [revised response after seeing peers]

2. Answer Parsing & Normalization

Before consensus calculation, answers are normalized to handle domain-specific formats:

# Financial domain"$1,000"=="1000"=="1K"=="one thousand"# All equivalent# Legal domain"42 U.S.C. § 1983"=="42 USC 1983"=="42 USC Section 1983"# Citation variations# Medical domain"E11.9"=="E11.9 (Type 2 diabetes)"=="e11.9"# ICD code variations# Generic domain"Yes, I agree"=="yes"=="Yes"# Fuzzy matching (85% similarity)

How it works:

  • Domain-specific normalizers handle format variations
  • Fuzzy string matching groups semantically equivalent answers
  • Configurable similarity threshold (default: 85%)
  • Reduces false disagreements in consensus calculation

Configuration:

{
"parser": {
"domain": "financial", // or "legal", "medical", "generic""similarity_threshold": 0.85
}
}

3. Consensus Calculation

Majority voting determines consensus using normalized answers:

Question: "Should we prioritize feature A or B?"
Round 2 Results:
Agent 1: "A" ← Majority (3/5)
Agent 2: "A" ← Majority (3/5)
Agent 3: "B" ← Minority (2/5)
Agent 4: "A" ← Majority (3/5)
Agent 5: "B" ← Minority (2/5)
Consensus Strength: 60% (3/5 agents agree)

4. DPO Pair Generation

Convert debates into training data:

{
"prompt": "Should we prioritize feature A or B?",
"chosen": "[Reasoning from Agent 1, 2, or 4 - majority consensus]",
"rejected": "[Reasoning from Agent 3 or 5 - minority opinion]",
"metadata": {
"consensus_strength": 0.6,
"convergence": "improved"
}
}

5. Fine-Tuning with DPO

Train model to prefer consensus reasoning:

Base Model → MACA Debates → DPO Training → Aligned Model
(generic) (diverse (preference (consensus-
reasoning) learning) aligned)

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Ollama (for local LLM serving)
  • Node.js 18+ (for MCP server)

Installation

# Clone the repository
git clone https://github.com/yourusername/maca.git
cd maca
# Set up Python environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate# Install dependencies
pip install -r requirements.txt
# Build MCP servercd mcp-server
npm install
npm run build
cd ..

Run Your First Debate

# Start Ollama
ollama serve
# Pull a base model
ollama pull qwen2.5:3b
# Run debate on example questions
python scripts/run_batch_debates.py \
--config examples/configs/debate_config.json \
--questions examples/datasets/example_questions.json \
--output data/debate_results.json

Train with DPO or KTO

MACA supports two training methods:

DPO (Direct Preference Optimization) - Recommended for debate pairs:

python scripts/train_dpo.py \
--config examples/configs/training_config.json \
--train data/dpo_train.jsonl \
--val data/dpo_val.jsonl \
--output models/your-model-dpo

KTO (Kahneman-Tversky Optimization) - Alternative using individual ratings:

# Prepare KTO data from debates
python scripts/prepare_kto_data.py \
--input data/batch_debate_results.json \
--output data/kto_data.jsonl \
--min-consensus 0.6
# Train with KTO
python scripts/train_kto.py \
--config examples/configs/kto_training_config.json

When to use each:

  • DPO: Use when you have natural pairs (chosen vs rejected) from debates. Better for MACA's multi-agent setup.
  • KTO: Use when you have individual responses with clear good/bad labels. Simpler data format, similar results.

Export to Ollama

# Export fine-tuned model
python scripts/export_to_ollama.py \
--model models/your-model \
--name your-model:latest
# Use your model
ollama run your-model:latest "Your question here"

🛠️ Architecture

Components

maca/
├── mcp-server/ # MCP server for debate orchestration
│ ├── connect_llm # Register agents
│ ├── start_debate # Initialize debate
│ ├── get_agent_response # Get agent reasoning
│ ├── calculate_consensus # Majority voting
│ └── export_training_data # Generate DPO pairs
│
├── plugin/ # Claude Code plugin
│ ├── agents/ # Specialized agents
│ │ ├── debate-orchestrator.md
│ │ ├── dpo-trainer.md
│ │ └── dataset-curator.md
│ ├── skills/ # Reusable workflows
│ │ ├── run-debate/
│ │ ├── export-training-data/
│ │ └── analyze-consensus/
│ └── hooks/ # Automation hooks
│
├── scripts/ # Python utilities
│ ├── run_batch_debates.py
│ ├── train_dpo.py
│ ├── evaluate_model.py
│ └── export_to_ollama.py
│
└── examples/ # Example data & configs
├── datasets/
└── configs/

Claude Code Integration

Install the MACA plugin:

cd plugin
./.claude-plugin/install.sh

Use in Claude Code:

You: Run a MACA debate on whether to refactor or rebuild this module
Claude: I'll use the debate-orchestrator agent to run a multi-agent debate...

📚 Documentation

Analyzing Results

After running debates, analyze the results with detailed metrics:

python scripts/analyze_batch_results.py

Metrics provided:

  1. Per-Agent Performance

    • Agreement rate with majority consensus
    • Average response length
    • Answer changes between rounds
    • Individual agent quality assessment
  2. Consensus Distribution

    • Histogram of consensus strengths
    • Optimal range targeting (0.6-0.8)
    • Quality filtering breakdown
  3. Convergence Analysis

    • Improved/stable/degraded patterns
    • Average improvement from Round 1 to Round 2
    • Convergence rate tracking
  4. Quality Score

    • Overall training data quality (0.0-1.0)
    • Based on optimal consensus distribution
    • Recommendations for improvement
  5. Visualizations (requires matplotlib)

    • Agent agreement charts
    • Consensus distribution histogram
    • Convergence pattern analysis
    • Quality score gauge

Example output:

PER-AGENT PERFORMANCE
────────────────────────────────────────────────────────────────────────────────
agent_alpha:
Total responses: 98
Agreement rate: 73.5%
Avg response length: 1247 chars
Answer changes (R1→R2): 12
TRAINING DATA QUALITY SCORE
────────────────────────────────────────────────────────────────────────────────
Quality score: 68.3%
Rating: Good - Proceed with training
Quality is based on:
• Optimal consensus range (0.6-0.8): Higher is better
• Avoiding unanimous (1.0) debates: Too easy, no signal
• Avoiding ambiguous (<0.5) debates: Too hard, unclear

🎯 Use Cases

MACA can be applied to any domain requiring preference-based alignment:

Professional Domains

  • Legal: Legal reasoning, case analysis, contract review
  • Medical: Clinical decision-making, diagnosis support, treatment recommendations
  • Financial: Investment analysis, risk assessment, portfolio strategies
  • Technical: Software architecture, debugging strategies, code review
  • Customer Support: Response quality, empathy training, problem-solving

Development Workflows

  • Code Review: Multi-agent validation of code changes
  • Architecture Decisions: Consensus-based design choices
  • Test Generation: Diverse test case creation
  • Documentation: Quality assessment and improvement
  • Refactoring: Evaluating refactor vs rebuild decisions

🧪 Research Background

Original Paper

Title: Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment Authors: Ankur Samanta, Akshayaa Magesh, Youliang Yu, et al. Institution: Meta AI, Meta Superintelligence Labs, Columbia University, Cornell Tech Date: September 19, 2024 arXiv: 2509.15172v2Code: github.com/facebookresearch/maca

Key Contributions

  1. Self-Consistency as Intrinsic Property: Formalizes self-consistency as a learnable trait
  2. Multi-Agent Debate Framework: M agents × R rounds generates diverse reasoning paths
  3. Training Objectives: Supports MV-SFT, MV-GRPO, MV-DPO, MV-KTO
  4. Convergence Analysis: Tracks reasoning improvement across debate rounds

Implementation Details

This implementation focuses on:

  • MV-DPO (Majority-Vote Direct Preference Optimization) as primary training method
  • LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning
  • Local deployment via Ollama for privacy and control
  • Claude Code integration for seamless development workflows

🔧 Configuration

Debate Configuration

Key parameters in examples/configs/debate_config.json:

  • agents.count: Number of agents (M) - recommended: 3-7
  • agents.temperature: Response diversity - recommended: 0.7-0.9
  • rounds.total: Number of debate rounds (R) - recommended: 2
  • consensus.optimal_range: Filter debates by consensus strength - recommended: 0.6-0.8

Training Configuration

Key parameters in examples/configs/training_config.json:

  • lora.r: LoRA rank - recommended: 16 (small datasets), 32 (large datasets)
  • training_args.learning_rate: Learning rate - recommended: 1e-6 (small), 5e-6 (large)
  • training_args.num_train_epochs: Training epochs - recommended: 2-3
  • dpo_args.beta: DPO temperature - recommended: 0.1

📊 Expected Results

Based on our implementation and the original research:

Quality Metrics

  • Consensus Strength: Target 0.6-0.8 (sweet spot for training signal)
  • Convergence Rate: 30-50% of debates should show Round 1 → Round 2 improvement
  • DPO Pair Quality: Chosen responses should be 15-25% longer and more detailed

Training Outcomes

With 50-100 high-quality debate pairs:

  • Validation Accuracy: 80-95% (chosen > rejected)
  • Response Quality: +10-30% improvement in detail and reasoning
  • Zero Catastrophic Forgetting: Model retains general knowledge

Small Dataset Performance

Our conservative approach works with as few as 30-40 pairs:

  • Use learning_rate ≤ 1e-6
  • Limit to 2-3 epochs
  • Apply LoRA with r=16
  • Enable early stopping
  • Monitor train vs validation loss

🤝 Contributing

We welcome contributions! Areas where you can help:

  • Domain Examples: Share your domain-specific applications
  • Training Recipes: Optimize hyperparameters for different dataset sizes
  • Evaluation Methods: Improve quality assessment metrics
  • Documentation: Expand guides and tutorials
  • Bug Fixes: Report and fix issues

See CONTRIBUTING.md for guidelines.


📄 License

This project is licensed under the MIT License - see LICENSE file for details.


📖 Citation

This project implements the Multi-Agent Consensus Alignment (MACA) approach from Meta AI research.

Original Research

Paper: Samanta et al., "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (2024)

Developed by: Meta AI in collaboration with Meta Superintelligence Labs and the LIINC Lab at Columbia University

If you use this framework in your research or application, please cite the original paper:

@misc{samanta2024maca,
title={Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment},
author={Ankur Samanta and Akshayaa Magesh and Youliang Yu and Runzhe Wu and Ayush Jain and Daniel Jiang and Boris Vidolov and Paul Sajda and Yonathan Efroni and Kaveh Hassani},
year={2024},
eprint={2509.15172},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://doi.org/10.48550/arXiv.2509.15172}
}

Related Resources

Implementation Differences

This implementation differs from Meta's research code in several key ways:

AspectMeta MACA (Research)This Implementation (Practical)
FocusMathematical reasoning benchmarks (GSM8K, MATH)Domain-agnostic business applications
InfrastructureMulti-GPU HuggingFace clustersLocal Ollama + single GPU
Training MethodsMV-SFT, MV-GRPO, MV-KTO, MV-DPOMV-DPO (Direct Preference Optimization)
ComplexityResearch-grade comprehensive implementationProduction-ready minimal dependencies
DeploymentHuggingFace checkpointsOllama models (instant local use)
Target UsersML researchersDomain experts and developers

Our implementation prioritizes accessibility, simplicity, and practical deployment while maintaining the core MACA methodology.


🙏 Acknowledgments

  • Meta AI for the original MACA research and implementation
  • Hugging Face for Transformers and TRL libraries
  • Ollama for local LLM serving
  • Anthropic for Claude Code and MCP framework

📮 Contact & Community


⚠️ Disclaimer

This is an independent implementation of the MACA research paper. Results may vary based on:

  • Base model quality
  • Dataset size and quality
  • Domain complexity
  • Training configuration
  • Hardware resources

Always evaluate thoroughly before production use.


Built with ❤️ for the open-source AI community

Last Updated: November 2025

About

Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - cfdude/claude-maca: Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework · GitHub
Skip to content

Repository files navigation

MACA: Multi-Agent Consensus Alignment

A framework for training language models through multi-agent debate and preference learning

License: MITPython 3.8+arXiv


📖 Overview

MACA (Multi-Agent Consensus Alignment) is a complete implementation of the research paper "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (Meta AI, 2024). It provides tools for improving LLM reasoning through multi-agent debate and preference-based fine-tuning.

Key Features

  • 🤖 Multi-Agent Debates: Orchestrate M agents across R rounds to generate diverse reasoning
  • 🎯 Consensus Calculation: Majority voting to identify preferred vs rejected responses
  • 📊 DPO Training: Direct Preference Optimization using consensus-derived training pairs
  • 🔌 Claude Code Integration: Complete plugin with agents, skills, hooks, and MCP server
  • 🚀 End-to-End Pipeline: From debate generation to model fine-tuning and evaluation
  • 🌐 Domain-Agnostic: Apply to any domain requiring preference-based alignment

Research Results (from original MACA paper)

  • +27.6% improvement on GSM8K (self-consistency)
  • +23.7% improvement on MATH (single-agent reasoning)
  • +22.4% improvement on MATH (Pass@20 sampling)
  • +42.7% improvement on MathQA (multi-agent decision-making)

🧠 How It Works

1. Multi-Agent Debate

M agents (LLM clones) engage in R rounds of structured debate:

Round 1 (Independent):
Agent 1: [independent response]
Agent 2: [independent response]
...
Agent M: [independent response]
Round 2 (Peer Feedback):
Agent 1: [revised response after seeing peers]
Agent 2: [revised response after seeing peers]
...
Agent M: [revised response after seeing peers]

2. Answer Parsing & Normalization

Before consensus calculation, answers are normalized to handle domain-specific formats:

# Financial domain"$1,000"=="1000"=="1K"=="one thousand"# All equivalent# Legal domain"42 U.S.C. § 1983"=="42 USC 1983"=="42 USC Section 1983"# Citation variations# Medical domain"E11.9"=="E11.9 (Type 2 diabetes)"=="e11.9"# ICD code variations# Generic domain"Yes, I agree"=="yes"=="Yes"# Fuzzy matching (85% similarity)

How it works:

  • Domain-specific normalizers handle format variations
  • Fuzzy string matching groups semantically equivalent answers
  • Configurable similarity threshold (default: 85%)
  • Reduces false disagreements in consensus calculation

Configuration:

{
"parser": {
"domain": "financial", // or "legal", "medical", "generic""similarity_threshold": 0.85
}
}

3. Consensus Calculation

Majority voting determines consensus using normalized answers:

Question: "Should we prioritize feature A or B?"
Round 2 Results:
Agent 1: "A" ← Majority (3/5)
Agent 2: "A" ← Majority (3/5)
Agent 3: "B" ← Minority (2/5)
Agent 4: "A" ← Majority (3/5)
Agent 5: "B" ← Minority (2/5)
Consensus Strength: 60% (3/5 agents agree)

4. DPO Pair Generation

Convert debates into training data:

{
"prompt": "Should we prioritize feature A or B?",
"chosen": "[Reasoning from Agent 1, 2, or 4 - majority consensus]",
"rejected": "[Reasoning from Agent 3 or 5 - minority opinion]",
"metadata": {
"consensus_strength": 0.6,
"convergence": "improved"
}
}

5. Fine-Tuning with DPO

Train model to prefer consensus reasoning:

Base Model → MACA Debates → DPO Training → Aligned Model
(generic) (diverse (preference (consensus-
reasoning) learning) aligned)

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Ollama (for local LLM serving)
  • Node.js 18+ (for MCP server)

Installation

# Clone the repository
git clone https://github.com/yourusername/maca.git
cd maca
# Set up Python environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate# Install dependencies
pip install -r requirements.txt
# Build MCP servercd mcp-server
npm install
npm run build
cd ..

Run Your First Debate

# Start Ollama
ollama serve
# Pull a base model
ollama pull qwen2.5:3b
# Run debate on example questions
python scripts/run_batch_debates.py \
--config examples/configs/debate_config.json \
--questions examples/datasets/example_questions.json \
--output data/debate_results.json

Train with DPO or KTO

MACA supports two training methods:

DPO (Direct Preference Optimization) - Recommended for debate pairs:

python scripts/train_dpo.py \
--config examples/configs/training_config.json \
--train data/dpo_train.jsonl \
--val data/dpo_val.jsonl \
--output models/your-model-dpo

KTO (Kahneman-Tversky Optimization) - Alternative using individual ratings:

# Prepare KTO data from debates
python scripts/prepare_kto_data.py \
--input data/batch_debate_results.json \
--output data/kto_data.jsonl \
--min-consensus 0.6
# Train with KTO
python scripts/train_kto.py \
--config examples/configs/kto_training_config.json

When to use each:

  • DPO: Use when you have natural pairs (chosen vs rejected) from debates. Better for MACA's multi-agent setup.
  • KTO: Use when you have individual responses with clear good/bad labels. Simpler data format, similar results.

Export to Ollama

# Export fine-tuned model
python scripts/export_to_ollama.py \
--model models/your-model \
--name your-model:latest
# Use your model
ollama run your-model:latest "Your question here"

🛠️ Architecture

Components

maca/
├── mcp-server/ # MCP server for debate orchestration
│ ├── connect_llm # Register agents
│ ├── start_debate # Initialize debate
│ ├── get_agent_response # Get agent reasoning
│ ├── calculate_consensus # Majority voting
│ └── export_training_data # Generate DPO pairs
│
├── plugin/ # Claude Code plugin
│ ├── agents/ # Specialized agents
│ │ ├── debate-orchestrator.md
│ │ ├── dpo-trainer.md
│ │ └── dataset-curator.md
│ ├── skills/ # Reusable workflows
│ │ ├── run-debate/
│ │ ├── export-training-data/
│ │ └── analyze-consensus/
│ └── hooks/ # Automation hooks
│
├── scripts/ # Python utilities
│ ├── run_batch_debates.py
│ ├── train_dpo.py
│ ├── evaluate_model.py
│ └── export_to_ollama.py
│
└── examples/ # Example data & configs
├── datasets/
└── configs/

Claude Code Integration

Install the MACA plugin:

cd plugin
./.claude-plugin/install.sh

Use in Claude Code:

You: Run a MACA debate on whether to refactor or rebuild this module
Claude: I'll use the debate-orchestrator agent to run a multi-agent debate...

📚 Documentation

Analyzing Results

After running debates, analyze the results with detailed metrics:

python scripts/analyze_batch_results.py

Metrics provided:

  1. Per-Agent Performance

    • Agreement rate with majority consensus
    • Average response length
    • Answer changes between rounds
    • Individual agent quality assessment
  2. Consensus Distribution

    • Histogram of consensus strengths
    • Optimal range targeting (0.6-0.8)
    • Quality filtering breakdown
  3. Convergence Analysis

    • Improved/stable/degraded patterns
    • Average improvement from Round 1 to Round 2
    • Convergence rate tracking
  4. Quality Score

    • Overall training data quality (0.0-1.0)
    • Based on optimal consensus distribution
    • Recommendations for improvement
  5. Visualizations (requires matplotlib)

    • Agent agreement charts
    • Consensus distribution histogram
    • Convergence pattern analysis
    • Quality score gauge

Example output:

PER-AGENT PERFORMANCE
────────────────────────────────────────────────────────────────────────────────
agent_alpha:
Total responses: 98
Agreement rate: 73.5%
Avg response length: 1247 chars
Answer changes (R1→R2): 12
TRAINING DATA QUALITY SCORE
────────────────────────────────────────────────────────────────────────────────
Quality score: 68.3%
Rating: Good - Proceed with training
Quality is based on:
• Optimal consensus range (0.6-0.8): Higher is better
• Avoiding unanimous (1.0) debates: Too easy, no signal
• Avoiding ambiguous (<0.5) debates: Too hard, unclear

🎯 Use Cases

MACA can be applied to any domain requiring preference-based alignment:

Professional Domains

  • Legal: Legal reasoning, case analysis, contract review
  • Medical: Clinical decision-making, diagnosis support, treatment recommendations
  • Financial: Investment analysis, risk assessment, portfolio strategies
  • Technical: Software architecture, debugging strategies, code review
  • Customer Support: Response quality, empathy training, problem-solving

Development Workflows

  • Code Review: Multi-agent validation of code changes
  • Architecture Decisions: Consensus-based design choices
  • Test Generation: Diverse test case creation
  • Documentation: Quality assessment and improvement
  • Refactoring: Evaluating refactor vs rebuild decisions

🧪 Research Background

Original Paper

Title: Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment Authors: Ankur Samanta, Akshayaa Magesh, Youliang Yu, et al. Institution: Meta AI, Meta Superintelligence Labs, Columbia University, Cornell Tech Date: September 19, 2024 arXiv: 2509.15172v2Code: github.com/facebookresearch/maca

Key Contributions

  1. Self-Consistency as Intrinsic Property: Formalizes self-consistency as a learnable trait
  2. Multi-Agent Debate Framework: M agents × R rounds generates diverse reasoning paths
  3. Training Objectives: Supports MV-SFT, MV-GRPO, MV-DPO, MV-KTO
  4. Convergence Analysis: Tracks reasoning improvement across debate rounds

Implementation Details

This implementation focuses on:

  • MV-DPO (Majority-Vote Direct Preference Optimization) as primary training method
  • LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning
  • Local deployment via Ollama for privacy and control
  • Claude Code integration for seamless development workflows

🔧 Configuration

Debate Configuration

Key parameters in examples/configs/debate_config.json:

  • agents.count: Number of agents (M) - recommended: 3-7
  • agents.temperature: Response diversity - recommended: 0.7-0.9
  • rounds.total: Number of debate rounds (R) - recommended: 2
  • consensus.optimal_range: Filter debates by consensus strength - recommended: 0.6-0.8

Training Configuration

Key parameters in examples/configs/training_config.json:

  • lora.r: LoRA rank - recommended: 16 (small datasets), 32 (large datasets)
  • training_args.learning_rate: Learning rate - recommended: 1e-6 (small), 5e-6 (large)
  • training_args.num_train_epochs: Training epochs - recommended: 2-3
  • dpo_args.beta: DPO temperature - recommended: 0.1

📊 Expected Results

Based on our implementation and the original research:

Quality Metrics

  • Consensus Strength: Target 0.6-0.8 (sweet spot for training signal)
  • Convergence Rate: 30-50% of debates should show Round 1 → Round 2 improvement
  • DPO Pair Quality: Chosen responses should be 15-25% longer and more detailed

Training Outcomes

With 50-100 high-quality debate pairs:

  • Validation Accuracy: 80-95% (chosen > rejected)
  • Response Quality: +10-30% improvement in detail and reasoning
  • Zero Catastrophic Forgetting: Model retains general knowledge

Small Dataset Performance

Our conservative approach works with as few as 30-40 pairs:

  • Use learning_rate ≤ 1e-6
  • Limit to 2-3 epochs
  • Apply LoRA with r=16
  • Enable early stopping
  • Monitor train vs validation loss

🤝 Contributing

We welcome contributions! Areas where you can help:

  • Domain Examples: Share your domain-specific applications
  • Training Recipes: Optimize hyperparameters for different dataset sizes
  • Evaluation Methods: Improve quality assessment metrics
  • Documentation: Expand guides and tutorials
  • Bug Fixes: Report and fix issues

See CONTRIBUTING.md for guidelines.


📄 License

This project is licensed under the MIT License - see LICENSE file for details.


📖 Citation

This project implements the Multi-Agent Consensus Alignment (MACA) approach from Meta AI research.

Original Research

Paper: Samanta et al., "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (2024)

Developed by: Meta AI in collaboration with Meta Superintelligence Labs and the LIINC Lab at Columbia University

If you use this framework in your research or application, please cite the original paper:

@misc{samanta2024maca,
title={Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment},
author={Ankur Samanta and Akshayaa Magesh and Youliang Yu and Runzhe Wu and Ayush Jain and Daniel Jiang and Boris Vidolov and Paul Sajda and Yonathan Efroni and Kaveh Hassani},
year={2024},
eprint={2509.15172},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://doi.org/10.48550/arXiv.2509.15172}
}

Related Resources

Implementation Differences

This implementation differs from Meta's research code in several key ways:

AspectMeta MACA (Research)This Implementation (Practical)
FocusMathematical reasoning benchmarks (GSM8K, MATH)Domain-agnostic business applications
InfrastructureMulti-GPU HuggingFace clustersLocal Ollama + single GPU
Training MethodsMV-SFT, MV-GRPO, MV-KTO, MV-DPOMV-DPO (Direct Preference Optimization)
ComplexityResearch-grade comprehensive implementationProduction-ready minimal dependencies
DeploymentHuggingFace checkpointsOllama models (instant local use)
Target UsersML researchersDomain experts and developers

Our implementation prioritizes accessibility, simplicity, and practical deployment while maintaining the core MACA methodology.


🙏 Acknowledgments

  • Meta AI for the original MACA research and implementation
  • Hugging Face for Transformers and TRL libraries
  • Ollama for local LLM serving
  • Anthropic for Claude Code and MCP framework

📮 Contact & Community


⚠️ Disclaimer

This is an independent implementation of the MACA research paper. Results may vary based on:

  • Base model quality
  • Dataset size and quality
  • Domain complexity
  • Training configuration
  • Hardware resources

Always evaluate thoroughly before production use.


Built with ❤️ for the open-source AI community

Last Updated: November 2025

About

Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - cfdude/claude-maca: Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework · GitHub
Skip to content

Repository files navigation

MACA: Multi-Agent Consensus Alignment

A framework for training language models through multi-agent debate and preference learning

License: MITPython 3.8+arXiv


📖 Overview

MACA (Multi-Agent Consensus Alignment) is a complete implementation of the research paper "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (Meta AI, 2024). It provides tools for improving LLM reasoning through multi-agent debate and preference-based fine-tuning.

Key Features

  • 🤖 Multi-Agent Debates: Orchestrate M agents across R rounds to generate diverse reasoning
  • 🎯 Consensus Calculation: Majority voting to identify preferred vs rejected responses
  • 📊 DPO Training: Direct Preference Optimization using consensus-derived training pairs
  • 🔌 Claude Code Integration: Complete plugin with agents, skills, hooks, and MCP server
  • 🚀 End-to-End Pipeline: From debate generation to model fine-tuning and evaluation
  • 🌐 Domain-Agnostic: Apply to any domain requiring preference-based alignment

Research Results (from original MACA paper)

  • +27.6% improvement on GSM8K (self-consistency)
  • +23.7% improvement on MATH (single-agent reasoning)
  • +22.4% improvement on MATH (Pass@20 sampling)
  • +42.7% improvement on MathQA (multi-agent decision-making)

🧠 How It Works

1. Multi-Agent Debate

M agents (LLM clones) engage in R rounds of structured debate:

Round 1 (Independent):
Agent 1: [independent response]
Agent 2: [independent response]
...
Agent M: [independent response]
Round 2 (Peer Feedback):
Agent 1: [revised response after seeing peers]
Agent 2: [revised response after seeing peers]
...
Agent M: [revised response after seeing peers]

2. Answer Parsing & Normalization

Before consensus calculation, answers are normalized to handle domain-specific formats:

# Financial domain"$1,000"=="1000"=="1K"=="one thousand"# All equivalent# Legal domain"42 U.S.C. § 1983"=="42 USC 1983"=="42 USC Section 1983"# Citation variations# Medical domain"E11.9"=="E11.9 (Type 2 diabetes)"=="e11.9"# ICD code variations# Generic domain"Yes, I agree"=="yes"=="Yes"# Fuzzy matching (85% similarity)

How it works:

  • Domain-specific normalizers handle format variations
  • Fuzzy string matching groups semantically equivalent answers
  • Configurable similarity threshold (default: 85%)
  • Reduces false disagreements in consensus calculation

Configuration:

{
"parser": {
"domain": "financial", // or "legal", "medical", "generic""similarity_threshold": 0.85
}
}

3. Consensus Calculation

Majority voting determines consensus using normalized answers:

Question: "Should we prioritize feature A or B?"
Round 2 Results:
Agent 1: "A" ← Majority (3/5)
Agent 2: "A" ← Majority (3/5)
Agent 3: "B" ← Minority (2/5)
Agent 4: "A" ← Majority (3/5)
Agent 5: "B" ← Minority (2/5)
Consensus Strength: 60% (3/5 agents agree)

4. DPO Pair Generation

Convert debates into training data:

{
"prompt": "Should we prioritize feature A or B?",
"chosen": "[Reasoning from Agent 1, 2, or 4 - majority consensus]",
"rejected": "[Reasoning from Agent 3 or 5 - minority opinion]",
"metadata": {
"consensus_strength": 0.6,
"convergence": "improved"
}
}

5. Fine-Tuning with DPO

Train model to prefer consensus reasoning:

Base Model → MACA Debates → DPO Training → Aligned Model
(generic) (diverse (preference (consensus-
reasoning) learning) aligned)

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Ollama (for local LLM serving)
  • Node.js 18+ (for MCP server)

Installation

# Clone the repository
git clone https://github.com/yourusername/maca.git
cd maca
# Set up Python environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate# Install dependencies
pip install -r requirements.txt
# Build MCP servercd mcp-server
npm install
npm run build
cd ..

Run Your First Debate

# Start Ollama
ollama serve
# Pull a base model
ollama pull qwen2.5:3b
# Run debate on example questions
python scripts/run_batch_debates.py \
--config examples/configs/debate_config.json \
--questions examples/datasets/example_questions.json \
--output data/debate_results.json

Train with DPO or KTO

MACA supports two training methods:

DPO (Direct Preference Optimization) - Recommended for debate pairs:

python scripts/train_dpo.py \
--config examples/configs/training_config.json \
--train data/dpo_train.jsonl \
--val data/dpo_val.jsonl \
--output models/your-model-dpo

KTO (Kahneman-Tversky Optimization) - Alternative using individual ratings:

# Prepare KTO data from debates
python scripts/prepare_kto_data.py \
--input data/batch_debate_results.json \
--output data/kto_data.jsonl \
--min-consensus 0.6
# Train with KTO
python scripts/train_kto.py \
--config examples/configs/kto_training_config.json

When to use each:

  • DPO: Use when you have natural pairs (chosen vs rejected) from debates. Better for MACA's multi-agent setup.
  • KTO: Use when you have individual responses with clear good/bad labels. Simpler data format, similar results.

Export to Ollama

# Export fine-tuned model
python scripts/export_to_ollama.py \
--model models/your-model \
--name your-model:latest
# Use your model
ollama run your-model:latest "Your question here"

🛠️ Architecture

Components

maca/
├── mcp-server/ # MCP server for debate orchestration
│ ├── connect_llm # Register agents
│ ├── start_debate # Initialize debate
│ ├── get_agent_response # Get agent reasoning
│ ├── calculate_consensus # Majority voting
│ └── export_training_data # Generate DPO pairs
│
├── plugin/ # Claude Code plugin
│ ├── agents/ # Specialized agents
│ │ ├── debate-orchestrator.md
│ │ ├── dpo-trainer.md
│ │ └── dataset-curator.md
│ ├── skills/ # Reusable workflows
│ │ ├── run-debate/
│ │ ├── export-training-data/
│ │ └── analyze-consensus/
│ └── hooks/ # Automation hooks
│
├── scripts/ # Python utilities
│ ├── run_batch_debates.py
│ ├── train_dpo.py
│ ├── evaluate_model.py
│ └── export_to_ollama.py
│
└── examples/ # Example data & configs
├── datasets/
└── configs/

Claude Code Integration

Install the MACA plugin:

cd plugin
./.claude-plugin/install.sh

Use in Claude Code:

You: Run a MACA debate on whether to refactor or rebuild this module
Claude: I'll use the debate-orchestrator agent to run a multi-agent debate...

📚 Documentation

Analyzing Results

After running debates, analyze the results with detailed metrics:

python scripts/analyze_batch_results.py

Metrics provided:

  1. Per-Agent Performance

    • Agreement rate with majority consensus
    • Average response length
    • Answer changes between rounds
    • Individual agent quality assessment
  2. Consensus Distribution

    • Histogram of consensus strengths
    • Optimal range targeting (0.6-0.8)
    • Quality filtering breakdown
  3. Convergence Analysis

    • Improved/stable/degraded patterns
    • Average improvement from Round 1 to Round 2
    • Convergence rate tracking
  4. Quality Score

    • Overall training data quality (0.0-1.0)
    • Based on optimal consensus distribution
    • Recommendations for improvement
  5. Visualizations (requires matplotlib)

    • Agent agreement charts
    • Consensus distribution histogram
    • Convergence pattern analysis
    • Quality score gauge

Example output:

PER-AGENT PERFORMANCE
────────────────────────────────────────────────────────────────────────────────
agent_alpha:
Total responses: 98
Agreement rate: 73.5%
Avg response length: 1247 chars
Answer changes (R1→R2): 12
TRAINING DATA QUALITY SCORE
────────────────────────────────────────────────────────────────────────────────
Quality score: 68.3%
Rating: Good - Proceed with training
Quality is based on:
• Optimal consensus range (0.6-0.8): Higher is better
• Avoiding unanimous (1.0) debates: Too easy, no signal
• Avoiding ambiguous (<0.5) debates: Too hard, unclear

🎯 Use Cases

MACA can be applied to any domain requiring preference-based alignment:

Professional Domains

  • Legal: Legal reasoning, case analysis, contract review
  • Medical: Clinical decision-making, diagnosis support, treatment recommendations
  • Financial: Investment analysis, risk assessment, portfolio strategies
  • Technical: Software architecture, debugging strategies, code review
  • Customer Support: Response quality, empathy training, problem-solving

Development Workflows

  • Code Review: Multi-agent validation of code changes
  • Architecture Decisions: Consensus-based design choices
  • Test Generation: Diverse test case creation
  • Documentation: Quality assessment and improvement
  • Refactoring: Evaluating refactor vs rebuild decisions

🧪 Research Background

Original Paper

Title: Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment Authors: Ankur Samanta, Akshayaa Magesh, Youliang Yu, et al. Institution: Meta AI, Meta Superintelligence Labs, Columbia University, Cornell Tech Date: September 19, 2024 arXiv: 2509.15172v2Code: github.com/facebookresearch/maca

Key Contributions

  1. Self-Consistency as Intrinsic Property: Formalizes self-consistency as a learnable trait
  2. Multi-Agent Debate Framework: M agents × R rounds generates diverse reasoning paths
  3. Training Objectives: Supports MV-SFT, MV-GRPO, MV-DPO, MV-KTO
  4. Convergence Analysis: Tracks reasoning improvement across debate rounds

Implementation Details

This implementation focuses on:

  • MV-DPO (Majority-Vote Direct Preference Optimization) as primary training method
  • LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning
  • Local deployment via Ollama for privacy and control
  • Claude Code integration for seamless development workflows

🔧 Configuration

Debate Configuration

Key parameters in examples/configs/debate_config.json:

  • agents.count: Number of agents (M) - recommended: 3-7
  • agents.temperature: Response diversity - recommended: 0.7-0.9
  • rounds.total: Number of debate rounds (R) - recommended: 2
  • consensus.optimal_range: Filter debates by consensus strength - recommended: 0.6-0.8

Training Configuration

Key parameters in examples/configs/training_config.json:

  • lora.r: LoRA rank - recommended: 16 (small datasets), 32 (large datasets)
  • training_args.learning_rate: Learning rate - recommended: 1e-6 (small), 5e-6 (large)
  • training_args.num_train_epochs: Training epochs - recommended: 2-3
  • dpo_args.beta: DPO temperature - recommended: 0.1

📊 Expected Results

Based on our implementation and the original research:

Quality Metrics

  • Consensus Strength: Target 0.6-0.8 (sweet spot for training signal)
  • Convergence Rate: 30-50% of debates should show Round 1 → Round 2 improvement
  • DPO Pair Quality: Chosen responses should be 15-25% longer and more detailed

Training Outcomes

With 50-100 high-quality debate pairs:

  • Validation Accuracy: 80-95% (chosen > rejected)
  • Response Quality: +10-30% improvement in detail and reasoning
  • Zero Catastrophic Forgetting: Model retains general knowledge

Small Dataset Performance

Our conservative approach works with as few as 30-40 pairs:

  • Use learning_rate ≤ 1e-6
  • Limit to 2-3 epochs
  • Apply LoRA with r=16
  • Enable early stopping
  • Monitor train vs validation loss

🤝 Contributing

We welcome contributions! Areas where you can help:

  • Domain Examples: Share your domain-specific applications
  • Training Recipes: Optimize hyperparameters for different dataset sizes
  • Evaluation Methods: Improve quality assessment metrics
  • Documentation: Expand guides and tutorials
  • Bug Fixes: Report and fix issues

See CONTRIBUTING.md for guidelines.


📄 License

This project is licensed under the MIT License - see LICENSE file for details.


📖 Citation

This project implements the Multi-Agent Consensus Alignment (MACA) approach from Meta AI research.

Original Research

Paper: Samanta et al., "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (2024)

Developed by: Meta AI in collaboration with Meta Superintelligence Labs and the LIINC Lab at Columbia University

If you use this framework in your research or application, please cite the original paper:

@misc{samanta2024maca,
title={Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment},
author={Ankur Samanta and Akshayaa Magesh and Youliang Yu and Runzhe Wu and Ayush Jain and Daniel Jiang and Boris Vidolov and Paul Sajda and Yonathan Efroni and Kaveh Hassani},
year={2024},
eprint={2509.15172},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://doi.org/10.48550/arXiv.2509.15172}
}

Related Resources

Implementation Differences

This implementation differs from Meta's research code in several key ways:

AspectMeta MACA (Research)This Implementation (Practical)
FocusMathematical reasoning benchmarks (GSM8K, MATH)Domain-agnostic business applications
InfrastructureMulti-GPU HuggingFace clustersLocal Ollama + single GPU
Training MethodsMV-SFT, MV-GRPO, MV-KTO, MV-DPOMV-DPO (Direct Preference Optimization)
ComplexityResearch-grade comprehensive implementationProduction-ready minimal dependencies
DeploymentHuggingFace checkpointsOllama models (instant local use)
Target UsersML researchersDomain experts and developers

Our implementation prioritizes accessibility, simplicity, and practical deployment while maintaining the core MACA methodology.


🙏 Acknowledgments

  • Meta AI for the original MACA research and implementation
  • Hugging Face for Transformers and TRL libraries
  • Ollama for local LLM serving
  • Anthropic for Claude Code and MCP framework

📮 Contact & Community


⚠️ Disclaimer

This is an independent implementation of the MACA research paper. Results may vary based on:

  • Base model quality
  • Dataset size and quality
  • Domain complexity
  • Training configuration
  • Hardware resources

Always evaluate thoroughly before production use.


Built with ❤️ for the open-source AI community

Last Updated: November 2025

About

Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - cfdude/claude-maca: Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework · GitHub
Skip to content

Repository files navigation

MACA: Multi-Agent Consensus Alignment

A framework for training language models through multi-agent debate and preference learning

License: MITPython 3.8+arXiv


📖 Overview

MACA (Multi-Agent Consensus Alignment) is a complete implementation of the research paper "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (Meta AI, 2024). It provides tools for improving LLM reasoning through multi-agent debate and preference-based fine-tuning.

Key Features

  • 🤖 Multi-Agent Debates: Orchestrate M agents across R rounds to generate diverse reasoning
  • 🎯 Consensus Calculation: Majority voting to identify preferred vs rejected responses
  • 📊 DPO Training: Direct Preference Optimization using consensus-derived training pairs
  • 🔌 Claude Code Integration: Complete plugin with agents, skills, hooks, and MCP server
  • 🚀 End-to-End Pipeline: From debate generation to model fine-tuning and evaluation
  • 🌐 Domain-Agnostic: Apply to any domain requiring preference-based alignment

Research Results (from original MACA paper)

  • +27.6% improvement on GSM8K (self-consistency)
  • +23.7% improvement on MATH (single-agent reasoning)
  • +22.4% improvement on MATH (Pass@20 sampling)
  • +42.7% improvement on MathQA (multi-agent decision-making)

🧠 How It Works

1. Multi-Agent Debate

M agents (LLM clones) engage in R rounds of structured debate:

Round 1 (Independent):
Agent 1: [independent response]
Agent 2: [independent response]
...
Agent M: [independent response]
Round 2 (Peer Feedback):
Agent 1: [revised response after seeing peers]
Agent 2: [revised response after seeing peers]
...
Agent M: [revised response after seeing peers]

2. Answer Parsing & Normalization

Before consensus calculation, answers are normalized to handle domain-specific formats:

# Financial domain"$1,000"=="1000"=="1K"=="one thousand"# All equivalent# Legal domain"42 U.S.C. § 1983"=="42 USC 1983"=="42 USC Section 1983"# Citation variations# Medical domain"E11.9"=="E11.9 (Type 2 diabetes)"=="e11.9"# ICD code variations# Generic domain"Yes, I agree"=="yes"=="Yes"# Fuzzy matching (85% similarity)

How it works:

  • Domain-specific normalizers handle format variations
  • Fuzzy string matching groups semantically equivalent answers
  • Configurable similarity threshold (default: 85%)
  • Reduces false disagreements in consensus calculation

Configuration:

{
"parser": {
"domain": "financial", // or "legal", "medical", "generic""similarity_threshold": 0.85
}
}

3. Consensus Calculation

Majority voting determines consensus using normalized answers:

Question: "Should we prioritize feature A or B?"
Round 2 Results:
Agent 1: "A" ← Majority (3/5)
Agent 2: "A" ← Majority (3/5)
Agent 3: "B" ← Minority (2/5)
Agent 4: "A" ← Majority (3/5)
Agent 5: "B" ← Minority (2/5)
Consensus Strength: 60% (3/5 agents agree)

4. DPO Pair Generation

Convert debates into training data:

{
"prompt": "Should we prioritize feature A or B?",
"chosen": "[Reasoning from Agent 1, 2, or 4 - majority consensus]",
"rejected": "[Reasoning from Agent 3 or 5 - minority opinion]",
"metadata": {
"consensus_strength": 0.6,
"convergence": "improved"
}
}

5. Fine-Tuning with DPO

Train model to prefer consensus reasoning:

Base Model → MACA Debates → DPO Training → Aligned Model
(generic) (diverse (preference (consensus-
reasoning) learning) aligned)

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Ollama (for local LLM serving)
  • Node.js 18+ (for MCP server)

Installation

# Clone the repository
git clone https://github.com/yourusername/maca.git
cd maca
# Set up Python environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate# Install dependencies
pip install -r requirements.txt
# Build MCP servercd mcp-server
npm install
npm run build
cd ..

Run Your First Debate

# Start Ollama
ollama serve
# Pull a base model
ollama pull qwen2.5:3b
# Run debate on example questions
python scripts/run_batch_debates.py \
--config examples/configs/debate_config.json \
--questions examples/datasets/example_questions.json \
--output data/debate_results.json

Train with DPO or KTO

MACA supports two training methods:

DPO (Direct Preference Optimization) - Recommended for debate pairs:

python scripts/train_dpo.py \
--config examples/configs/training_config.json \
--train data/dpo_train.jsonl \
--val data/dpo_val.jsonl \
--output models/your-model-dpo

KTO (Kahneman-Tversky Optimization) - Alternative using individual ratings:

# Prepare KTO data from debates
python scripts/prepare_kto_data.py \
--input data/batch_debate_results.json \
--output data/kto_data.jsonl \
--min-consensus 0.6
# Train with KTO
python scripts/train_kto.py \
--config examples/configs/kto_training_config.json

When to use each:

  • DPO: Use when you have natural pairs (chosen vs rejected) from debates. Better for MACA's multi-agent setup.
  • KTO: Use when you have individual responses with clear good/bad labels. Simpler data format, similar results.

Export to Ollama

# Export fine-tuned model
python scripts/export_to_ollama.py \
--model models/your-model \
--name your-model:latest
# Use your model
ollama run your-model:latest "Your question here"

🛠️ Architecture

Components

maca/
├── mcp-server/ # MCP server for debate orchestration
│ ├── connect_llm # Register agents
│ ├── start_debate # Initialize debate
│ ├── get_agent_response # Get agent reasoning
│ ├── calculate_consensus # Majority voting
│ └── export_training_data # Generate DPO pairs
│
├── plugin/ # Claude Code plugin
│ ├── agents/ # Specialized agents
│ │ ├── debate-orchestrator.md
│ │ ├── dpo-trainer.md
│ │ └── dataset-curator.md
│ ├── skills/ # Reusable workflows
│ │ ├── run-debate/
│ │ ├── export-training-data/
│ │ └── analyze-consensus/
│ └── hooks/ # Automation hooks
│
├── scripts/ # Python utilities
│ ├── run_batch_debates.py
│ ├── train_dpo.py
│ ├── evaluate_model.py
│ └── export_to_ollama.py
│
└── examples/ # Example data & configs
├── datasets/
└── configs/

Claude Code Integration

Install the MACA plugin:

cd plugin
./.claude-plugin/install.sh

Use in Claude Code:

You: Run a MACA debate on whether to refactor or rebuild this module
Claude: I'll use the debate-orchestrator agent to run a multi-agent debate...

📚 Documentation

Analyzing Results

After running debates, analyze the results with detailed metrics:

python scripts/analyze_batch_results.py

Metrics provided:

  1. Per-Agent Performance

    • Agreement rate with majority consensus
    • Average response length
    • Answer changes between rounds
    • Individual agent quality assessment
  2. Consensus Distribution

    • Histogram of consensus strengths
    • Optimal range targeting (0.6-0.8)
    • Quality filtering breakdown
  3. Convergence Analysis

    • Improved/stable/degraded patterns
    • Average improvement from Round 1 to Round 2
    • Convergence rate tracking
  4. Quality Score

    • Overall training data quality (0.0-1.0)
    • Based on optimal consensus distribution
    • Recommendations for improvement
  5. Visualizations (requires matplotlib)

    • Agent agreement charts
    • Consensus distribution histogram
    • Convergence pattern analysis
    • Quality score gauge

Example output:

PER-AGENT PERFORMANCE
────────────────────────────────────────────────────────────────────────────────
agent_alpha:
Total responses: 98
Agreement rate: 73.5%
Avg response length: 1247 chars
Answer changes (R1→R2): 12
TRAINING DATA QUALITY SCORE
────────────────────────────────────────────────────────────────────────────────
Quality score: 68.3%
Rating: Good - Proceed with training
Quality is based on:
• Optimal consensus range (0.6-0.8): Higher is better
• Avoiding unanimous (1.0) debates: Too easy, no signal
• Avoiding ambiguous (<0.5) debates: Too hard, unclear

🎯 Use Cases

MACA can be applied to any domain requiring preference-based alignment:

Professional Domains

  • Legal: Legal reasoning, case analysis, contract review
  • Medical: Clinical decision-making, diagnosis support, treatment recommendations
  • Financial: Investment analysis, risk assessment, portfolio strategies
  • Technical: Software architecture, debugging strategies, code review
  • Customer Support: Response quality, empathy training, problem-solving

Development Workflows

  • Code Review: Multi-agent validation of code changes
  • Architecture Decisions: Consensus-based design choices
  • Test Generation: Diverse test case creation
  • Documentation: Quality assessment and improvement
  • Refactoring: Evaluating refactor vs rebuild decisions

🧪 Research Background

Original Paper

Title: Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment Authors: Ankur Samanta, Akshayaa Magesh, Youliang Yu, et al. Institution: Meta AI, Meta Superintelligence Labs, Columbia University, Cornell Tech Date: September 19, 2024 arXiv: 2509.15172v2Code: github.com/facebookresearch/maca

Key Contributions

  1. Self-Consistency as Intrinsic Property: Formalizes self-consistency as a learnable trait
  2. Multi-Agent Debate Framework: M agents × R rounds generates diverse reasoning paths
  3. Training Objectives: Supports MV-SFT, MV-GRPO, MV-DPO, MV-KTO
  4. Convergence Analysis: Tracks reasoning improvement across debate rounds

Implementation Details

This implementation focuses on:

  • MV-DPO (Majority-Vote Direct Preference Optimization) as primary training method
  • LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning
  • Local deployment via Ollama for privacy and control
  • Claude Code integration for seamless development workflows

🔧 Configuration

Debate Configuration

Key parameters in examples/configs/debate_config.json:

  • agents.count: Number of agents (M) - recommended: 3-7
  • agents.temperature: Response diversity - recommended: 0.7-0.9
  • rounds.total: Number of debate rounds (R) - recommended: 2
  • consensus.optimal_range: Filter debates by consensus strength - recommended: 0.6-0.8

Training Configuration

Key parameters in examples/configs/training_config.json:

  • lora.r: LoRA rank - recommended: 16 (small datasets), 32 (large datasets)
  • training_args.learning_rate: Learning rate - recommended: 1e-6 (small), 5e-6 (large)
  • training_args.num_train_epochs: Training epochs - recommended: 2-3
  • dpo_args.beta: DPO temperature - recommended: 0.1

📊 Expected Results

Based on our implementation and the original research:

Quality Metrics

  • Consensus Strength: Target 0.6-0.8 (sweet spot for training signal)
  • Convergence Rate: 30-50% of debates should show Round 1 → Round 2 improvement
  • DPO Pair Quality: Chosen responses should be 15-25% longer and more detailed

Training Outcomes

With 50-100 high-quality debate pairs:

  • Validation Accuracy: 80-95% (chosen > rejected)
  • Response Quality: +10-30% improvement in detail and reasoning
  • Zero Catastrophic Forgetting: Model retains general knowledge

Small Dataset Performance

Our conservative approach works with as few as 30-40 pairs:

  • Use learning_rate ≤ 1e-6
  • Limit to 2-3 epochs
  • Apply LoRA with r=16
  • Enable early stopping
  • Monitor train vs validation loss

🤝 Contributing

We welcome contributions! Areas where you can help:

  • Domain Examples: Share your domain-specific applications
  • Training Recipes: Optimize hyperparameters for different dataset sizes
  • Evaluation Methods: Improve quality assessment metrics
  • Documentation: Expand guides and tutorials
  • Bug Fixes: Report and fix issues

See CONTRIBUTING.md for guidelines.


📄 License

This project is licensed under the MIT License - see LICENSE file for details.


📖 Citation

This project implements the Multi-Agent Consensus Alignment (MACA) approach from Meta AI research.

Original Research

Paper: Samanta et al., "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (2024)

Developed by: Meta AI in collaboration with Meta Superintelligence Labs and the LIINC Lab at Columbia University

If you use this framework in your research or application, please cite the original paper:

@misc{samanta2024maca,
title={Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment},
author={Ankur Samanta and Akshayaa Magesh and Youliang Yu and Runzhe Wu and Ayush Jain and Daniel Jiang and Boris Vidolov and Paul Sajda and Yonathan Efroni and Kaveh Hassani},
year={2024},
eprint={2509.15172},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://doi.org/10.48550/arXiv.2509.15172}
}

Related Resources

Implementation Differences

This implementation differs from Meta's research code in several key ways:

AspectMeta MACA (Research)This Implementation (Practical)
FocusMathematical reasoning benchmarks (GSM8K, MATH)Domain-agnostic business applications
InfrastructureMulti-GPU HuggingFace clustersLocal Ollama + single GPU
Training MethodsMV-SFT, MV-GRPO, MV-KTO, MV-DPOMV-DPO (Direct Preference Optimization)
ComplexityResearch-grade comprehensive implementationProduction-ready minimal dependencies
DeploymentHuggingFace checkpointsOllama models (instant local use)
Target UsersML researchersDomain experts and developers

Our implementation prioritizes accessibility, simplicity, and practical deployment while maintaining the core MACA methodology.


🙏 Acknowledgments

  • Meta AI for the original MACA research and implementation
  • Hugging Face for Transformers and TRL libraries
  • Ollama for local LLM serving
  • Anthropic for Claude Code and MCP framework

📮 Contact & Community


⚠️ Disclaimer

This is an independent implementation of the MACA research paper. Results may vary based on:

  • Base model quality
  • Dataset size and quality
  • Domain complexity
  • Training configuration
  • Hardware resources

Always evaluate thoroughly before production use.


Built with ❤️ for the open-source AI community

Last Updated: November 2025

About

Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - cfdude/claude-maca: Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework · GitHub
Skip to content

Repository files navigation

MACA: Multi-Agent Consensus Alignment

A framework for training language models through multi-agent debate and preference learning

License: MITPython 3.8+arXiv


📖 Overview

MACA (Multi-Agent Consensus Alignment) is a complete implementation of the research paper "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (Meta AI, 2024). It provides tools for improving LLM reasoning through multi-agent debate and preference-based fine-tuning.

Key Features

  • 🤖 Multi-Agent Debates: Orchestrate M agents across R rounds to generate diverse reasoning
  • 🎯 Consensus Calculation: Majority voting to identify preferred vs rejected responses
  • 📊 DPO Training: Direct Preference Optimization using consensus-derived training pairs
  • 🔌 Claude Code Integration: Complete plugin with agents, skills, hooks, and MCP server
  • 🚀 End-to-End Pipeline: From debate generation to model fine-tuning and evaluation
  • 🌐 Domain-Agnostic: Apply to any domain requiring preference-based alignment

Research Results (from original MACA paper)

  • +27.6% improvement on GSM8K (self-consistency)
  • +23.7% improvement on MATH (single-agent reasoning)
  • +22.4% improvement on MATH (Pass@20 sampling)
  • +42.7% improvement on MathQA (multi-agent decision-making)

🧠 How It Works

1. Multi-Agent Debate

M agents (LLM clones) engage in R rounds of structured debate:

Round 1 (Independent):
Agent 1: [independent response]
Agent 2: [independent response]
...
Agent M: [independent response]
Round 2 (Peer Feedback):
Agent 1: [revised response after seeing peers]
Agent 2: [revised response after seeing peers]
...
Agent M: [revised response after seeing peers]

2. Answer Parsing & Normalization

Before consensus calculation, answers are normalized to handle domain-specific formats:

# Financial domain"$1,000"=="1000"=="1K"=="one thousand"# All equivalent# Legal domain"42 U.S.C. § 1983"=="42 USC 1983"=="42 USC Section 1983"# Citation variations# Medical domain"E11.9"=="E11.9 (Type 2 diabetes)"=="e11.9"# ICD code variations# Generic domain"Yes, I agree"=="yes"=="Yes"# Fuzzy matching (85% similarity)

How it works:

  • Domain-specific normalizers handle format variations
  • Fuzzy string matching groups semantically equivalent answers
  • Configurable similarity threshold (default: 85%)
  • Reduces false disagreements in consensus calculation

Configuration:

{
"parser": {
"domain": "financial", // or "legal", "medical", "generic""similarity_threshold": 0.85
}
}

3. Consensus Calculation

Majority voting determines consensus using normalized answers:

Question: "Should we prioritize feature A or B?"
Round 2 Results:
Agent 1: "A" ← Majority (3/5)
Agent 2: "A" ← Majority (3/5)
Agent 3: "B" ← Minority (2/5)
Agent 4: "A" ← Majority (3/5)
Agent 5: "B" ← Minority (2/5)
Consensus Strength: 60% (3/5 agents agree)

4. DPO Pair Generation

Convert debates into training data:

{
"prompt": "Should we prioritize feature A or B?",
"chosen": "[Reasoning from Agent 1, 2, or 4 - majority consensus]",
"rejected": "[Reasoning from Agent 3 or 5 - minority opinion]",
"metadata": {
"consensus_strength": 0.6,
"convergence": "improved"
}
}

5. Fine-Tuning with DPO

Train model to prefer consensus reasoning:

Base Model → MACA Debates → DPO Training → Aligned Model
(generic) (diverse (preference (consensus-
reasoning) learning) aligned)

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Ollama (for local LLM serving)
  • Node.js 18+ (for MCP server)

Installation

# Clone the repository
git clone https://github.com/yourusername/maca.git
cd maca
# Set up Python environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate# Install dependencies
pip install -r requirements.txt
# Build MCP servercd mcp-server
npm install
npm run build
cd ..

Run Your First Debate

# Start Ollama
ollama serve
# Pull a base model
ollama pull qwen2.5:3b
# Run debate on example questions
python scripts/run_batch_debates.py \
--config examples/configs/debate_config.json \
--questions examples/datasets/example_questions.json \
--output data/debate_results.json

Train with DPO or KTO

MACA supports two training methods:

DPO (Direct Preference Optimization) - Recommended for debate pairs:

python scripts/train_dpo.py \
--config examples/configs/training_config.json \
--train data/dpo_train.jsonl \
--val data/dpo_val.jsonl \
--output models/your-model-dpo

KTO (Kahneman-Tversky Optimization) - Alternative using individual ratings:

# Prepare KTO data from debates
python scripts/prepare_kto_data.py \
--input data/batch_debate_results.json \
--output data/kto_data.jsonl \
--min-consensus 0.6
# Train with KTO
python scripts/train_kto.py \
--config examples/configs/kto_training_config.json

When to use each:

  • DPO: Use when you have natural pairs (chosen vs rejected) from debates. Better for MACA's multi-agent setup.
  • KTO: Use when you have individual responses with clear good/bad labels. Simpler data format, similar results.

Export to Ollama

# Export fine-tuned model
python scripts/export_to_ollama.py \
--model models/your-model \
--name your-model:latest
# Use your model
ollama run your-model:latest "Your question here"

🛠️ Architecture

Components

maca/
├── mcp-server/ # MCP server for debate orchestration
│ ├── connect_llm # Register agents
│ ├── start_debate # Initialize debate
│ ├── get_agent_response # Get agent reasoning
│ ├── calculate_consensus # Majority voting
│ └── export_training_data # Generate DPO pairs
│
├── plugin/ # Claude Code plugin
│ ├── agents/ # Specialized agents
│ │ ├── debate-orchestrator.md
│ │ ├── dpo-trainer.md
│ │ └── dataset-curator.md
│ ├── skills/ # Reusable workflows
│ │ ├── run-debate/
│ │ ├── export-training-data/
│ │ └── analyze-consensus/
│ └── hooks/ # Automation hooks
│
├── scripts/ # Python utilities
│ ├── run_batch_debates.py
│ ├── train_dpo.py
│ ├── evaluate_model.py
│ └── export_to_ollama.py
│
└── examples/ # Example data & configs
├── datasets/
└── configs/

Claude Code Integration

Install the MACA plugin:

cd plugin
./.claude-plugin/install.sh

Use in Claude Code:

You: Run a MACA debate on whether to refactor or rebuild this module
Claude: I'll use the debate-orchestrator agent to run a multi-agent debate...

📚 Documentation

Analyzing Results

After running debates, analyze the results with detailed metrics:

python scripts/analyze_batch_results.py

Metrics provided:

  1. Per-Agent Performance

    • Agreement rate with majority consensus
    • Average response length
    • Answer changes between rounds
    • Individual agent quality assessment
  2. Consensus Distribution

    • Histogram of consensus strengths
    • Optimal range targeting (0.6-0.8)
    • Quality filtering breakdown
  3. Convergence Analysis

    • Improved/stable/degraded patterns
    • Average improvement from Round 1 to Round 2
    • Convergence rate tracking
  4. Quality Score

    • Overall training data quality (0.0-1.0)
    • Based on optimal consensus distribution
    • Recommendations for improvement
  5. Visualizations (requires matplotlib)

    • Agent agreement charts
    • Consensus distribution histogram
    • Convergence pattern analysis
    • Quality score gauge

Example output:

PER-AGENT PERFORMANCE
────────────────────────────────────────────────────────────────────────────────
agent_alpha:
Total responses: 98
Agreement rate: 73.5%
Avg response length: 1247 chars
Answer changes (R1→R2): 12
TRAINING DATA QUALITY SCORE
────────────────────────────────────────────────────────────────────────────────
Quality score: 68.3%
Rating: Good - Proceed with training
Quality is based on:
• Optimal consensus range (0.6-0.8): Higher is better
• Avoiding unanimous (1.0) debates: Too easy, no signal
• Avoiding ambiguous (<0.5) debates: Too hard, unclear

🎯 Use Cases

MACA can be applied to any domain requiring preference-based alignment:

Professional Domains

  • Legal: Legal reasoning, case analysis, contract review
  • Medical: Clinical decision-making, diagnosis support, treatment recommendations
  • Financial: Investment analysis, risk assessment, portfolio strategies
  • Technical: Software architecture, debugging strategies, code review
  • Customer Support: Response quality, empathy training, problem-solving

Development Workflows

  • Code Review: Multi-agent validation of code changes
  • Architecture Decisions: Consensus-based design choices
  • Test Generation: Diverse test case creation
  • Documentation: Quality assessment and improvement
  • Refactoring: Evaluating refactor vs rebuild decisions

🧪 Research Background

Original Paper

Title: Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment Authors: Ankur Samanta, Akshayaa Magesh, Youliang Yu, et al. Institution: Meta AI, Meta Superintelligence Labs, Columbia University, Cornell Tech Date: September 19, 2024 arXiv: 2509.15172v2Code: github.com/facebookresearch/maca

Key Contributions

  1. Self-Consistency as Intrinsic Property: Formalizes self-consistency as a learnable trait
  2. Multi-Agent Debate Framework: M agents × R rounds generates diverse reasoning paths
  3. Training Objectives: Supports MV-SFT, MV-GRPO, MV-DPO, MV-KTO
  4. Convergence Analysis: Tracks reasoning improvement across debate rounds

Implementation Details

This implementation focuses on:

  • MV-DPO (Majority-Vote Direct Preference Optimization) as primary training method
  • LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning
  • Local deployment via Ollama for privacy and control
  • Claude Code integration for seamless development workflows

🔧 Configuration

Debate Configuration

Key parameters in examples/configs/debate_config.json:

  • agents.count: Number of agents (M) - recommended: 3-7
  • agents.temperature: Response diversity - recommended: 0.7-0.9
  • rounds.total: Number of debate rounds (R) - recommended: 2
  • consensus.optimal_range: Filter debates by consensus strength - recommended: 0.6-0.8

Training Configuration

Key parameters in examples/configs/training_config.json:

  • lora.r: LoRA rank - recommended: 16 (small datasets), 32 (large datasets)
  • training_args.learning_rate: Learning rate - recommended: 1e-6 (small), 5e-6 (large)
  • training_args.num_train_epochs: Training epochs - recommended: 2-3
  • dpo_args.beta: DPO temperature - recommended: 0.1

📊 Expected Results

Based on our implementation and the original research:

Quality Metrics

  • Consensus Strength: Target 0.6-0.8 (sweet spot for training signal)
  • Convergence Rate: 30-50% of debates should show Round 1 → Round 2 improvement
  • DPO Pair Quality: Chosen responses should be 15-25% longer and more detailed

Training Outcomes

With 50-100 high-quality debate pairs:

  • Validation Accuracy: 80-95% (chosen > rejected)
  • Response Quality: +10-30% improvement in detail and reasoning
  • Zero Catastrophic Forgetting: Model retains general knowledge

Small Dataset Performance

Our conservative approach works with as few as 30-40 pairs:

  • Use learning_rate ≤ 1e-6
  • Limit to 2-3 epochs
  • Apply LoRA with r=16
  • Enable early stopping
  • Monitor train vs validation loss

🤝 Contributing

We welcome contributions! Areas where you can help:

  • Domain Examples: Share your domain-specific applications
  • Training Recipes: Optimize hyperparameters for different dataset sizes
  • Evaluation Methods: Improve quality assessment metrics
  • Documentation: Expand guides and tutorials
  • Bug Fixes: Report and fix issues

See CONTRIBUTING.md for guidelines.


📄 License

This project is licensed under the MIT License - see LICENSE file for details.


📖 Citation

This project implements the Multi-Agent Consensus Alignment (MACA) approach from Meta AI research.

Original Research

Paper: Samanta et al., "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (2024)

Developed by: Meta AI in collaboration with Meta Superintelligence Labs and the LIINC Lab at Columbia University

If you use this framework in your research or application, please cite the original paper:

@misc{samanta2024maca,
title={Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment},
author={Ankur Samanta and Akshayaa Magesh and Youliang Yu and Runzhe Wu and Ayush Jain and Daniel Jiang and Boris Vidolov and Paul Sajda and Yonathan Efroni and Kaveh Hassani},
year={2024},
eprint={2509.15172},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://doi.org/10.48550/arXiv.2509.15172}
}

Related Resources

Implementation Differences

This implementation differs from Meta's research code in several key ways:

AspectMeta MACA (Research)This Implementation (Practical)
FocusMathematical reasoning benchmarks (GSM8K, MATH)Domain-agnostic business applications
InfrastructureMulti-GPU HuggingFace clustersLocal Ollama + single GPU
Training MethodsMV-SFT, MV-GRPO, MV-KTO, MV-DPOMV-DPO (Direct Preference Optimization)
ComplexityResearch-grade comprehensive implementationProduction-ready minimal dependencies
DeploymentHuggingFace checkpointsOllama models (instant local use)
Target UsersML researchersDomain experts and developers

Our implementation prioritizes accessibility, simplicity, and practical deployment while maintaining the core MACA methodology.


🙏 Acknowledgments

  • Meta AI for the original MACA research and implementation
  • Hugging Face for Transformers and TRL libraries
  • Ollama for local LLM serving
  • Anthropic for Claude Code and MCP framework

📮 Contact & Community


⚠️ Disclaimer

This is an independent implementation of the MACA research paper. Results may vary based on:

  • Base model quality
  • Dataset size and quality
  • Domain complexity
  • Training configuration
  • Hardware resources

Always evaluate thoroughly before production use.


Built with ❤️ for the open-source AI community

Last Updated: November 2025

About

Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - cfdude/claude-maca: Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework · GitHub
Skip to content

Repository files navigation

MACA: Multi-Agent Consensus Alignment

A framework for training language models through multi-agent debate and preference learning

License: MITPython 3.8+arXiv


📖 Overview

MACA (Multi-Agent Consensus Alignment) is a complete implementation of the research paper "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (Meta AI, 2024). It provides tools for improving LLM reasoning through multi-agent debate and preference-based fine-tuning.

Key Features

  • 🤖 Multi-Agent Debates: Orchestrate M agents across R rounds to generate diverse reasoning
  • 🎯 Consensus Calculation: Majority voting to identify preferred vs rejected responses
  • 📊 DPO Training: Direct Preference Optimization using consensus-derived training pairs
  • 🔌 Claude Code Integration: Complete plugin with agents, skills, hooks, and MCP server
  • 🚀 End-to-End Pipeline: From debate generation to model fine-tuning and evaluation
  • 🌐 Domain-Agnostic: Apply to any domain requiring preference-based alignment

Research Results (from original MACA paper)

  • +27.6% improvement on GSM8K (self-consistency)
  • +23.7% improvement on MATH (single-agent reasoning)
  • +22.4% improvement on MATH (Pass@20 sampling)
  • +42.7% improvement on MathQA (multi-agent decision-making)

🧠 How It Works

1. Multi-Agent Debate

M agents (LLM clones) engage in R rounds of structured debate:

Round 1 (Independent):
Agent 1: [independent response]
Agent 2: [independent response]
...
Agent M: [independent response]
Round 2 (Peer Feedback):
Agent 1: [revised response after seeing peers]
Agent 2: [revised response after seeing peers]
...
Agent M: [revised response after seeing peers]

2. Answer Parsing & Normalization

Before consensus calculation, answers are normalized to handle domain-specific formats:

# Financial domain"$1,000"=="1000"=="1K"=="one thousand"# All equivalent# Legal domain"42 U.S.C. § 1983"=="42 USC 1983"=="42 USC Section 1983"# Citation variations# Medical domain"E11.9"=="E11.9 (Type 2 diabetes)"=="e11.9"# ICD code variations# Generic domain"Yes, I agree"=="yes"=="Yes"# Fuzzy matching (85% similarity)

How it works:

  • Domain-specific normalizers handle format variations
  • Fuzzy string matching groups semantically equivalent answers
  • Configurable similarity threshold (default: 85%)
  • Reduces false disagreements in consensus calculation

Configuration:

{
"parser": {
"domain": "financial", // or "legal", "medical", "generic""similarity_threshold": 0.85
}
}

3. Consensus Calculation

Majority voting determines consensus using normalized answers:

Question: "Should we prioritize feature A or B?"
Round 2 Results:
Agent 1: "A" ← Majority (3/5)
Agent 2: "A" ← Majority (3/5)
Agent 3: "B" ← Minority (2/5)
Agent 4: "A" ← Majority (3/5)
Agent 5: "B" ← Minority (2/5)
Consensus Strength: 60% (3/5 agents agree)

4. DPO Pair Generation

Convert debates into training data:

{
"prompt": "Should we prioritize feature A or B?",
"chosen": "[Reasoning from Agent 1, 2, or 4 - majority consensus]",
"rejected": "[Reasoning from Agent 3 or 5 - minority opinion]",
"metadata": {
"consensus_strength": 0.6,
"convergence": "improved"
}
}

5. Fine-Tuning with DPO

Train model to prefer consensus reasoning:

Base Model → MACA Debates → DPO Training → Aligned Model
(generic) (diverse (preference (consensus-
reasoning) learning) aligned)

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Ollama (for local LLM serving)
  • Node.js 18+ (for MCP server)

Installation

# Clone the repository
git clone https://github.com/yourusername/maca.git
cd maca
# Set up Python environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate# Install dependencies
pip install -r requirements.txt
# Build MCP servercd mcp-server
npm install
npm run build
cd ..

Run Your First Debate

# Start Ollama
ollama serve
# Pull a base model
ollama pull qwen2.5:3b
# Run debate on example questions
python scripts/run_batch_debates.py \
--config examples/configs/debate_config.json \
--questions examples/datasets/example_questions.json \
--output data/debate_results.json

Train with DPO or KTO

MACA supports two training methods:

DPO (Direct Preference Optimization) - Recommended for debate pairs:

python scripts/train_dpo.py \
--config examples/configs/training_config.json \
--train data/dpo_train.jsonl \
--val data/dpo_val.jsonl \
--output models/your-model-dpo

KTO (Kahneman-Tversky Optimization) - Alternative using individual ratings:

# Prepare KTO data from debates
python scripts/prepare_kto_data.py \
--input data/batch_debate_results.json \
--output data/kto_data.jsonl \
--min-consensus 0.6
# Train with KTO
python scripts/train_kto.py \
--config examples/configs/kto_training_config.json

When to use each:

  • DPO: Use when you have natural pairs (chosen vs rejected) from debates. Better for MACA's multi-agent setup.
  • KTO: Use when you have individual responses with clear good/bad labels. Simpler data format, similar results.

Export to Ollama

# Export fine-tuned model
python scripts/export_to_ollama.py \
--model models/your-model \
--name your-model:latest
# Use your model
ollama run your-model:latest "Your question here"

🛠️ Architecture

Components

maca/
├── mcp-server/ # MCP server for debate orchestration
│ ├── connect_llm # Register agents
│ ├── start_debate # Initialize debate
│ ├── get_agent_response # Get agent reasoning
│ ├── calculate_consensus # Majority voting
│ └── export_training_data # Generate DPO pairs
│
├── plugin/ # Claude Code plugin
│ ├── agents/ # Specialized agents
│ │ ├── debate-orchestrator.md
│ │ ├── dpo-trainer.md
│ │ └── dataset-curator.md
│ ├── skills/ # Reusable workflows
│ │ ├── run-debate/
│ │ ├── export-training-data/
│ │ └── analyze-consensus/
│ └── hooks/ # Automation hooks
│
├── scripts/ # Python utilities
│ ├── run_batch_debates.py
│ ├── train_dpo.py
│ ├── evaluate_model.py
│ └── export_to_ollama.py
│
└── examples/ # Example data & configs
├── datasets/
└── configs/

Claude Code Integration

Install the MACA plugin:

cd plugin
./.claude-plugin/install.sh

Use in Claude Code:

You: Run a MACA debate on whether to refactor or rebuild this module
Claude: I'll use the debate-orchestrator agent to run a multi-agent debate...

📚 Documentation

Analyzing Results

After running debates, analyze the results with detailed metrics:

python scripts/analyze_batch_results.py

Metrics provided:

  1. Per-Agent Performance

    • Agreement rate with majority consensus
    • Average response length
    • Answer changes between rounds
    • Individual agent quality assessment
  2. Consensus Distribution

    • Histogram of consensus strengths
    • Optimal range targeting (0.6-0.8)
    • Quality filtering breakdown
  3. Convergence Analysis

    • Improved/stable/degraded patterns
    • Average improvement from Round 1 to Round 2
    • Convergence rate tracking
  4. Quality Score

    • Overall training data quality (0.0-1.0)
    • Based on optimal consensus distribution
    • Recommendations for improvement
  5. Visualizations (requires matplotlib)

    • Agent agreement charts
    • Consensus distribution histogram
    • Convergence pattern analysis
    • Quality score gauge

Example output:

PER-AGENT PERFORMANCE
────────────────────────────────────────────────────────────────────────────────
agent_alpha:
Total responses: 98
Agreement rate: 73.5%
Avg response length: 1247 chars
Answer changes (R1→R2): 12
TRAINING DATA QUALITY SCORE
────────────────────────────────────────────────────────────────────────────────
Quality score: 68.3%
Rating: Good - Proceed with training
Quality is based on:
• Optimal consensus range (0.6-0.8): Higher is better
• Avoiding unanimous (1.0) debates: Too easy, no signal
• Avoiding ambiguous (<0.5) debates: Too hard, unclear

🎯 Use Cases

MACA can be applied to any domain requiring preference-based alignment:

Professional Domains

  • Legal: Legal reasoning, case analysis, contract review
  • Medical: Clinical decision-making, diagnosis support, treatment recommendations
  • Financial: Investment analysis, risk assessment, portfolio strategies
  • Technical: Software architecture, debugging strategies, code review
  • Customer Support: Response quality, empathy training, problem-solving

Development Workflows

  • Code Review: Multi-agent validation of code changes
  • Architecture Decisions: Consensus-based design choices
  • Test Generation: Diverse test case creation
  • Documentation: Quality assessment and improvement
  • Refactoring: Evaluating refactor vs rebuild decisions

🧪 Research Background

Original Paper

Title: Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment Authors: Ankur Samanta, Akshayaa Magesh, Youliang Yu, et al. Institution: Meta AI, Meta Superintelligence Labs, Columbia University, Cornell Tech Date: September 19, 2024 arXiv: 2509.15172v2Code: github.com/facebookresearch/maca

Key Contributions

  1. Self-Consistency as Intrinsic Property: Formalizes self-consistency as a learnable trait
  2. Multi-Agent Debate Framework: M agents × R rounds generates diverse reasoning paths
  3. Training Objectives: Supports MV-SFT, MV-GRPO, MV-DPO, MV-KTO
  4. Convergence Analysis: Tracks reasoning improvement across debate rounds

Implementation Details

This implementation focuses on:

  • MV-DPO (Majority-Vote Direct Preference Optimization) as primary training method
  • LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning
  • Local deployment via Ollama for privacy and control
  • Claude Code integration for seamless development workflows

🔧 Configuration

Debate Configuration

Key parameters in examples/configs/debate_config.json:

  • agents.count: Number of agents (M) - recommended: 3-7
  • agents.temperature: Response diversity - recommended: 0.7-0.9
  • rounds.total: Number of debate rounds (R) - recommended: 2
  • consensus.optimal_range: Filter debates by consensus strength - recommended: 0.6-0.8

Training Configuration

Key parameters in examples/configs/training_config.json:

  • lora.r: LoRA rank - recommended: 16 (small datasets), 32 (large datasets)
  • training_args.learning_rate: Learning rate - recommended: 1e-6 (small), 5e-6 (large)
  • training_args.num_train_epochs: Training epochs - recommended: 2-3
  • dpo_args.beta: DPO temperature - recommended: 0.1

📊 Expected Results

Based on our implementation and the original research:

Quality Metrics

  • Consensus Strength: Target 0.6-0.8 (sweet spot for training signal)
  • Convergence Rate: 30-50% of debates should show Round 1 → Round 2 improvement
  • DPO Pair Quality: Chosen responses should be 15-25% longer and more detailed

Training Outcomes

With 50-100 high-quality debate pairs:

  • Validation Accuracy: 80-95% (chosen > rejected)
  • Response Quality: +10-30% improvement in detail and reasoning
  • Zero Catastrophic Forgetting: Model retains general knowledge

Small Dataset Performance

Our conservative approach works with as few as 30-40 pairs:

  • Use learning_rate ≤ 1e-6
  • Limit to 2-3 epochs
  • Apply LoRA with r=16
  • Enable early stopping
  • Monitor train vs validation loss

🤝 Contributing

We welcome contributions! Areas where you can help:

  • Domain Examples: Share your domain-specific applications
  • Training Recipes: Optimize hyperparameters for different dataset sizes
  • Evaluation Methods: Improve quality assessment metrics
  • Documentation: Expand guides and tutorials
  • Bug Fixes: Report and fix issues

See CONTRIBUTING.md for guidelines.


📄 License

This project is licensed under the MIT License - see LICENSE file for details.


📖 Citation

This project implements the Multi-Agent Consensus Alignment (MACA) approach from Meta AI research.

Original Research

Paper: Samanta et al., "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (2024)

Developed by: Meta AI in collaboration with Meta Superintelligence Labs and the LIINC Lab at Columbia University

If you use this framework in your research or application, please cite the original paper:

@misc{samanta2024maca,
title={Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment},
author={Ankur Samanta and Akshayaa Magesh and Youliang Yu and Runzhe Wu and Ayush Jain and Daniel Jiang and Boris Vidolov and Paul Sajda and Yonathan Efroni and Kaveh Hassani},
year={2024},
eprint={2509.15172},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://doi.org/10.48550/arXiv.2509.15172}
}

Related Resources

Implementation Differences

This implementation differs from Meta's research code in several key ways:

AspectMeta MACA (Research)This Implementation (Practical)
FocusMathematical reasoning benchmarks (GSM8K, MATH)Domain-agnostic business applications
InfrastructureMulti-GPU HuggingFace clustersLocal Ollama + single GPU
Training MethodsMV-SFT, MV-GRPO, MV-KTO, MV-DPOMV-DPO (Direct Preference Optimization)
ComplexityResearch-grade comprehensive implementationProduction-ready minimal dependencies
DeploymentHuggingFace checkpointsOllama models (instant local use)
Target UsersML researchersDomain experts and developers

Our implementation prioritizes accessibility, simplicity, and practical deployment while maintaining the core MACA methodology.


🙏 Acknowledgments

  • Meta AI for the original MACA research and implementation
  • Hugging Face for Transformers and TRL libraries
  • Ollama for local LLM serving
  • Anthropic for Claude Code and MCP framework

📮 Contact & Community


⚠️ Disclaimer

This is an independent implementation of the MACA research paper. Results may vary based on:

  • Base model quality
  • Dataset size and quality
  • Domain complexity
  • Training configuration
  • Hardware resources

Always evaluate thoroughly before production use.


Built with ❤️ for the open-source AI community

Last Updated: November 2025

About

Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - cfdude/claude-maca: Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework · GitHub
Skip to content

Repository files navigation

MACA: Multi-Agent Consensus Alignment

A framework for training language models through multi-agent debate and preference learning

License: MITPython 3.8+arXiv


📖 Overview

MACA (Multi-Agent Consensus Alignment) is a complete implementation of the research paper "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (Meta AI, 2024). It provides tools for improving LLM reasoning through multi-agent debate and preference-based fine-tuning.

Key Features

  • 🤖 Multi-Agent Debates: Orchestrate M agents across R rounds to generate diverse reasoning
  • 🎯 Consensus Calculation: Majority voting to identify preferred vs rejected responses
  • 📊 DPO Training: Direct Preference Optimization using consensus-derived training pairs
  • 🔌 Claude Code Integration: Complete plugin with agents, skills, hooks, and MCP server
  • 🚀 End-to-End Pipeline: From debate generation to model fine-tuning and evaluation
  • 🌐 Domain-Agnostic: Apply to any domain requiring preference-based alignment

Research Results (from original MACA paper)

  • +27.6% improvement on GSM8K (self-consistency)
  • +23.7% improvement on MATH (single-agent reasoning)
  • +22.4% improvement on MATH (Pass@20 sampling)
  • +42.7% improvement on MathQA (multi-agent decision-making)

🧠 How It Works

1. Multi-Agent Debate

M agents (LLM clones) engage in R rounds of structured debate:

Round 1 (Independent):
Agent 1: [independent response]
Agent 2: [independent response]
...
Agent M: [independent response]
Round 2 (Peer Feedback):
Agent 1: [revised response after seeing peers]
Agent 2: [revised response after seeing peers]
...
Agent M: [revised response after seeing peers]

2. Answer Parsing & Normalization

Before consensus calculation, answers are normalized to handle domain-specific formats:

# Financial domain"$1,000"=="1000"=="1K"=="one thousand"# All equivalent# Legal domain"42 U.S.C. § 1983"=="42 USC 1983"=="42 USC Section 1983"# Citation variations# Medical domain"E11.9"=="E11.9 (Type 2 diabetes)"=="e11.9"# ICD code variations# Generic domain"Yes, I agree"=="yes"=="Yes"# Fuzzy matching (85% similarity)

How it works:

  • Domain-specific normalizers handle format variations
  • Fuzzy string matching groups semantically equivalent answers
  • Configurable similarity threshold (default: 85%)
  • Reduces false disagreements in consensus calculation

Configuration:

{
"parser": {
"domain": "financial", // or "legal", "medical", "generic""similarity_threshold": 0.85
}
}

3. Consensus Calculation

Majority voting determines consensus using normalized answers:

Question: "Should we prioritize feature A or B?"
Round 2 Results:
Agent 1: "A" ← Majority (3/5)
Agent 2: "A" ← Majority (3/5)
Agent 3: "B" ← Minority (2/5)
Agent 4: "A" ← Majority (3/5)
Agent 5: "B" ← Minority (2/5)
Consensus Strength: 60% (3/5 agents agree)

4. DPO Pair Generation

Convert debates into training data:

{
"prompt": "Should we prioritize feature A or B?",
"chosen": "[Reasoning from Agent 1, 2, or 4 - majority consensus]",
"rejected": "[Reasoning from Agent 3 or 5 - minority opinion]",
"metadata": {
"consensus_strength": 0.6,
"convergence": "improved"
}
}

5. Fine-Tuning with DPO

Train model to prefer consensus reasoning:

Base Model → MACA Debates → DPO Training → Aligned Model
(generic) (diverse (preference (consensus-
reasoning) learning) aligned)

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Ollama (for local LLM serving)
  • Node.js 18+ (for MCP server)

Installation

# Clone the repository
git clone https://github.com/yourusername/maca.git
cd maca
# Set up Python environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate# Install dependencies
pip install -r requirements.txt
# Build MCP servercd mcp-server
npm install
npm run build
cd ..

Run Your First Debate

# Start Ollama
ollama serve
# Pull a base model
ollama pull qwen2.5:3b
# Run debate on example questions
python scripts/run_batch_debates.py \
--config examples/configs/debate_config.json \
--questions examples/datasets/example_questions.json \
--output data/debate_results.json

Train with DPO or KTO

MACA supports two training methods:

DPO (Direct Preference Optimization) - Recommended for debate pairs:

python scripts/train_dpo.py \
--config examples/configs/training_config.json \
--train data/dpo_train.jsonl \
--val data/dpo_val.jsonl \
--output models/your-model-dpo

KTO (Kahneman-Tversky Optimization) - Alternative using individual ratings:

# Prepare KTO data from debates
python scripts/prepare_kto_data.py \
--input data/batch_debate_results.json \
--output data/kto_data.jsonl \
--min-consensus 0.6
# Train with KTO
python scripts/train_kto.py \
--config examples/configs/kto_training_config.json

When to use each:

  • DPO: Use when you have natural pairs (chosen vs rejected) from debates. Better for MACA's multi-agent setup.
  • KTO: Use when you have individual responses with clear good/bad labels. Simpler data format, similar results.

Export to Ollama

# Export fine-tuned model
python scripts/export_to_ollama.py \
--model models/your-model \
--name your-model:latest
# Use your model
ollama run your-model:latest "Your question here"

🛠️ Architecture

Components

maca/
├── mcp-server/ # MCP server for debate orchestration
│ ├── connect_llm # Register agents
│ ├── start_debate # Initialize debate
│ ├── get_agent_response # Get agent reasoning
│ ├── calculate_consensus # Majority voting
│ └── export_training_data # Generate DPO pairs
│
├── plugin/ # Claude Code plugin
│ ├── agents/ # Specialized agents
│ │ ├── debate-orchestrator.md
│ │ ├── dpo-trainer.md
│ │ └── dataset-curator.md
│ ├── skills/ # Reusable workflows
│ │ ├── run-debate/
│ │ ├── export-training-data/
│ │ └── analyze-consensus/
│ └── hooks/ # Automation hooks
│
├── scripts/ # Python utilities
│ ├── run_batch_debates.py
│ ├── train_dpo.py
│ ├── evaluate_model.py
│ └── export_to_ollama.py
│
└── examples/ # Example data & configs
├── datasets/
└── configs/

Claude Code Integration

Install the MACA plugin:

cd plugin
./.claude-plugin/install.sh

Use in Claude Code:

You: Run a MACA debate on whether to refactor or rebuild this module
Claude: I'll use the debate-orchestrator agent to run a multi-agent debate...

📚 Documentation

Analyzing Results

After running debates, analyze the results with detailed metrics:

python scripts/analyze_batch_results.py

Metrics provided:

  1. Per-Agent Performance

    • Agreement rate with majority consensus
    • Average response length
    • Answer changes between rounds
    • Individual agent quality assessment
  2. Consensus Distribution

    • Histogram of consensus strengths
    • Optimal range targeting (0.6-0.8)
    • Quality filtering breakdown
  3. Convergence Analysis

    • Improved/stable/degraded patterns
    • Average improvement from Round 1 to Round 2
    • Convergence rate tracking
  4. Quality Score

    • Overall training data quality (0.0-1.0)
    • Based on optimal consensus distribution
    • Recommendations for improvement
  5. Visualizations (requires matplotlib)

    • Agent agreement charts
    • Consensus distribution histogram
    • Convergence pattern analysis
    • Quality score gauge

Example output:

PER-AGENT PERFORMANCE
────────────────────────────────────────────────────────────────────────────────
agent_alpha:
Total responses: 98
Agreement rate: 73.5%
Avg response length: 1247 chars
Answer changes (R1→R2): 12
TRAINING DATA QUALITY SCORE
────────────────────────────────────────────────────────────────────────────────
Quality score: 68.3%
Rating: Good - Proceed with training
Quality is based on:
• Optimal consensus range (0.6-0.8): Higher is better
• Avoiding unanimous (1.0) debates: Too easy, no signal
• Avoiding ambiguous (<0.5) debates: Too hard, unclear

🎯 Use Cases

MACA can be applied to any domain requiring preference-based alignment:

Professional Domains

  • Legal: Legal reasoning, case analysis, contract review
  • Medical: Clinical decision-making, diagnosis support, treatment recommendations
  • Financial: Investment analysis, risk assessment, portfolio strategies
  • Technical: Software architecture, debugging strategies, code review
  • Customer Support: Response quality, empathy training, problem-solving

Development Workflows

  • Code Review: Multi-agent validation of code changes
  • Architecture Decisions: Consensus-based design choices
  • Test Generation: Diverse test case creation
  • Documentation: Quality assessment and improvement
  • Refactoring: Evaluating refactor vs rebuild decisions

🧪 Research Background

Original Paper

Title: Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment Authors: Ankur Samanta, Akshayaa Magesh, Youliang Yu, et al. Institution: Meta AI, Meta Superintelligence Labs, Columbia University, Cornell Tech Date: September 19, 2024 arXiv: 2509.15172v2Code: github.com/facebookresearch/maca

Key Contributions

  1. Self-Consistency as Intrinsic Property: Formalizes self-consistency as a learnable trait
  2. Multi-Agent Debate Framework: M agents × R rounds generates diverse reasoning paths
  3. Training Objectives: Supports MV-SFT, MV-GRPO, MV-DPO, MV-KTO
  4. Convergence Analysis: Tracks reasoning improvement across debate rounds

Implementation Details

This implementation focuses on:

  • MV-DPO (Majority-Vote Direct Preference Optimization) as primary training method
  • LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning
  • Local deployment via Ollama for privacy and control
  • Claude Code integration for seamless development workflows

🔧 Configuration

Debate Configuration

Key parameters in examples/configs/debate_config.json:

  • agents.count: Number of agents (M) - recommended: 3-7
  • agents.temperature: Response diversity - recommended: 0.7-0.9
  • rounds.total: Number of debate rounds (R) - recommended: 2
  • consensus.optimal_range: Filter debates by consensus strength - recommended: 0.6-0.8

Training Configuration

Key parameters in examples/configs/training_config.json:

  • lora.r: LoRA rank - recommended: 16 (small datasets), 32 (large datasets)
  • training_args.learning_rate: Learning rate - recommended: 1e-6 (small), 5e-6 (large)
  • training_args.num_train_epochs: Training epochs - recommended: 2-3
  • dpo_args.beta: DPO temperature - recommended: 0.1

📊 Expected Results

Based on our implementation and the original research:

Quality Metrics

  • Consensus Strength: Target 0.6-0.8 (sweet spot for training signal)
  • Convergence Rate: 30-50% of debates should show Round 1 → Round 2 improvement
  • DPO Pair Quality: Chosen responses should be 15-25% longer and more detailed

Training Outcomes

With 50-100 high-quality debate pairs:

  • Validation Accuracy: 80-95% (chosen > rejected)
  • Response Quality: +10-30% improvement in detail and reasoning
  • Zero Catastrophic Forgetting: Model retains general knowledge

Small Dataset Performance

Our conservative approach works with as few as 30-40 pairs:

  • Use learning_rate ≤ 1e-6
  • Limit to 2-3 epochs
  • Apply LoRA with r=16
  • Enable early stopping
  • Monitor train vs validation loss

🤝 Contributing

We welcome contributions! Areas where you can help:

  • Domain Examples: Share your domain-specific applications
  • Training Recipes: Optimize hyperparameters for different dataset sizes
  • Evaluation Methods: Improve quality assessment metrics
  • Documentation: Expand guides and tutorials
  • Bug Fixes: Report and fix issues

See CONTRIBUTING.md for guidelines.


📄 License

This project is licensed under the MIT License - see LICENSE file for details.


📖 Citation

This project implements the Multi-Agent Consensus Alignment (MACA) approach from Meta AI research.

Original Research

Paper: Samanta et al., "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (2024)

Developed by: Meta AI in collaboration with Meta Superintelligence Labs and the LIINC Lab at Columbia University

If you use this framework in your research or application, please cite the original paper:

@misc{samanta2024maca,
title={Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment},
author={Ankur Samanta and Akshayaa Magesh and Youliang Yu and Runzhe Wu and Ayush Jain and Daniel Jiang and Boris Vidolov and Paul Sajda and Yonathan Efroni and Kaveh Hassani},
year={2024},
eprint={2509.15172},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://doi.org/10.48550/arXiv.2509.15172}
}

Related Resources

Implementation Differences

This implementation differs from Meta's research code in several key ways:

AspectMeta MACA (Research)This Implementation (Practical)
FocusMathematical reasoning benchmarks (GSM8K, MATH)Domain-agnostic business applications
InfrastructureMulti-GPU HuggingFace clustersLocal Ollama + single GPU
Training MethodsMV-SFT, MV-GRPO, MV-KTO, MV-DPOMV-DPO (Direct Preference Optimization)
ComplexityResearch-grade comprehensive implementationProduction-ready minimal dependencies
DeploymentHuggingFace checkpointsOllama models (instant local use)
Target UsersML researchersDomain experts and developers

Our implementation prioritizes accessibility, simplicity, and practical deployment while maintaining the core MACA methodology.


🙏 Acknowledgments

  • Meta AI for the original MACA research and implementation
  • Hugging Face for Transformers and TRL libraries
  • Ollama for local LLM serving
  • Anthropic for Claude Code and MCP framework

📮 Contact & Community


⚠️ Disclaimer

This is an independent implementation of the MACA research paper. Results may vary based on:

  • Base model quality
  • Dataset size and quality
  • Domain complexity
  • Training configuration
  • Hardware resources

Always evaluate thoroughly before production use.


Built with ❤️ for the open-source AI community

Last Updated: November 2025

About

Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - cfdude/claude-maca: Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework · GitHub
Skip to content

Repository files navigation

MACA: Multi-Agent Consensus Alignment

A framework for training language models through multi-agent debate and preference learning

License: MITPython 3.8+arXiv


📖 Overview

MACA (Multi-Agent Consensus Alignment) is a complete implementation of the research paper "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (Meta AI, 2024). It provides tools for improving LLM reasoning through multi-agent debate and preference-based fine-tuning.

Key Features

  • 🤖 Multi-Agent Debates: Orchestrate M agents across R rounds to generate diverse reasoning
  • 🎯 Consensus Calculation: Majority voting to identify preferred vs rejected responses
  • 📊 DPO Training: Direct Preference Optimization using consensus-derived training pairs
  • 🔌 Claude Code Integration: Complete plugin with agents, skills, hooks, and MCP server
  • 🚀 End-to-End Pipeline: From debate generation to model fine-tuning and evaluation
  • 🌐 Domain-Agnostic: Apply to any domain requiring preference-based alignment

Research Results (from original MACA paper)

  • +27.6% improvement on GSM8K (self-consistency)
  • +23.7% improvement on MATH (single-agent reasoning)
  • +22.4% improvement on MATH (Pass@20 sampling)
  • +42.7% improvement on MathQA (multi-agent decision-making)

🧠 How It Works

1. Multi-Agent Debate

M agents (LLM clones) engage in R rounds of structured debate:

Round 1 (Independent):
Agent 1: [independent response]
Agent 2: [independent response]
...
Agent M: [independent response]
Round 2 (Peer Feedback):
Agent 1: [revised response after seeing peers]
Agent 2: [revised response after seeing peers]
...
Agent M: [revised response after seeing peers]

2. Answer Parsing & Normalization

Before consensus calculation, answers are normalized to handle domain-specific formats:

# Financial domain"$1,000"=="1000"=="1K"=="one thousand"# All equivalent# Legal domain"42 U.S.C. § 1983"=="42 USC 1983"=="42 USC Section 1983"# Citation variations# Medical domain"E11.9"=="E11.9 (Type 2 diabetes)"=="e11.9"# ICD code variations# Generic domain"Yes, I agree"=="yes"=="Yes"# Fuzzy matching (85% similarity)

How it works:

  • Domain-specific normalizers handle format variations
  • Fuzzy string matching groups semantically equivalent answers
  • Configurable similarity threshold (default: 85%)
  • Reduces false disagreements in consensus calculation

Configuration:

{
"parser": {
"domain": "financial", // or "legal", "medical", "generic""similarity_threshold": 0.85
}
}

3. Consensus Calculation

Majority voting determines consensus using normalized answers:

Question: "Should we prioritize feature A or B?"
Round 2 Results:
Agent 1: "A" ← Majority (3/5)
Agent 2: "A" ← Majority (3/5)
Agent 3: "B" ← Minority (2/5)
Agent 4: "A" ← Majority (3/5)
Agent 5: "B" ← Minority (2/5)
Consensus Strength: 60% (3/5 agents agree)

4. DPO Pair Generation

Convert debates into training data:

{
"prompt": "Should we prioritize feature A or B?",
"chosen": "[Reasoning from Agent 1, 2, or 4 - majority consensus]",
"rejected": "[Reasoning from Agent 3 or 5 - minority opinion]",
"metadata": {
"consensus_strength": 0.6,
"convergence": "improved"
}
}

5. Fine-Tuning with DPO

Train model to prefer consensus reasoning:

Base Model → MACA Debates → DPO Training → Aligned Model
(generic) (diverse (preference (consensus-
reasoning) learning) aligned)

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Ollama (for local LLM serving)
  • Node.js 18+ (for MCP server)

Installation

# Clone the repository
git clone https://github.com/yourusername/maca.git
cd maca
# Set up Python environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate# Install dependencies
pip install -r requirements.txt
# Build MCP servercd mcp-server
npm install
npm run build
cd ..

Run Your First Debate

# Start Ollama
ollama serve
# Pull a base model
ollama pull qwen2.5:3b
# Run debate on example questions
python scripts/run_batch_debates.py \
--config examples/configs/debate_config.json \
--questions examples/datasets/example_questions.json \
--output data/debate_results.json

Train with DPO or KTO

MACA supports two training methods:

DPO (Direct Preference Optimization) - Recommended for debate pairs:

python scripts/train_dpo.py \
--config examples/configs/training_config.json \
--train data/dpo_train.jsonl \
--val data/dpo_val.jsonl \
--output models/your-model-dpo

KTO (Kahneman-Tversky Optimization) - Alternative using individual ratings:

# Prepare KTO data from debates
python scripts/prepare_kto_data.py \
--input data/batch_debate_results.json \
--output data/kto_data.jsonl \
--min-consensus 0.6
# Train with KTO
python scripts/train_kto.py \
--config examples/configs/kto_training_config.json

When to use each:

  • DPO: Use when you have natural pairs (chosen vs rejected) from debates. Better for MACA's multi-agent setup.
  • KTO: Use when you have individual responses with clear good/bad labels. Simpler data format, similar results.

Export to Ollama

# Export fine-tuned model
python scripts/export_to_ollama.py \
--model models/your-model \
--name your-model:latest
# Use your model
ollama run your-model:latest "Your question here"

🛠️ Architecture

Components

maca/
├── mcp-server/ # MCP server for debate orchestration
│ ├── connect_llm # Register agents
│ ├── start_debate # Initialize debate
│ ├── get_agent_response # Get agent reasoning
│ ├── calculate_consensus # Majority voting
│ └── export_training_data # Generate DPO pairs
│
├── plugin/ # Claude Code plugin
│ ├── agents/ # Specialized agents
│ │ ├── debate-orchestrator.md
│ │ ├── dpo-trainer.md
│ │ └── dataset-curator.md
│ ├── skills/ # Reusable workflows
│ │ ├── run-debate/
│ │ ├── export-training-data/
│ │ └── analyze-consensus/
│ └── hooks/ # Automation hooks
│
├── scripts/ # Python utilities
│ ├── run_batch_debates.py
│ ├── train_dpo.py
│ ├── evaluate_model.py
│ └── export_to_ollama.py
│
└── examples/ # Example data & configs
├── datasets/
└── configs/

Claude Code Integration

Install the MACA plugin:

cd plugin
./.claude-plugin/install.sh

Use in Claude Code:

You: Run a MACA debate on whether to refactor or rebuild this module
Claude: I'll use the debate-orchestrator agent to run a multi-agent debate...

📚 Documentation

Analyzing Results

After running debates, analyze the results with detailed metrics:

python scripts/analyze_batch_results.py

Metrics provided:

  1. Per-Agent Performance

    • Agreement rate with majority consensus
    • Average response length
    • Answer changes between rounds
    • Individual agent quality assessment
  2. Consensus Distribution

    • Histogram of consensus strengths
    • Optimal range targeting (0.6-0.8)
    • Quality filtering breakdown
  3. Convergence Analysis

    • Improved/stable/degraded patterns
    • Average improvement from Round 1 to Round 2
    • Convergence rate tracking
  4. Quality Score

    • Overall training data quality (0.0-1.0)
    • Based on optimal consensus distribution
    • Recommendations for improvement
  5. Visualizations (requires matplotlib)

    • Agent agreement charts
    • Consensus distribution histogram
    • Convergence pattern analysis
    • Quality score gauge

Example output:

PER-AGENT PERFORMANCE
────────────────────────────────────────────────────────────────────────────────
agent_alpha:
Total responses: 98
Agreement rate: 73.5%
Avg response length: 1247 chars
Answer changes (R1→R2): 12
TRAINING DATA QUALITY SCORE
────────────────────────────────────────────────────────────────────────────────
Quality score: 68.3%
Rating: Good - Proceed with training
Quality is based on:
• Optimal consensus range (0.6-0.8): Higher is better
• Avoiding unanimous (1.0) debates: Too easy, no signal
• Avoiding ambiguous (<0.5) debates: Too hard, unclear

🎯 Use Cases

MACA can be applied to any domain requiring preference-based alignment:

Professional Domains

  • Legal: Legal reasoning, case analysis, contract review
  • Medical: Clinical decision-making, diagnosis support, treatment recommendations
  • Financial: Investment analysis, risk assessment, portfolio strategies
  • Technical: Software architecture, debugging strategies, code review
  • Customer Support: Response quality, empathy training, problem-solving

Development Workflows

  • Code Review: Multi-agent validation of code changes
  • Architecture Decisions: Consensus-based design choices
  • Test Generation: Diverse test case creation
  • Documentation: Quality assessment and improvement
  • Refactoring: Evaluating refactor vs rebuild decisions

🧪 Research Background

Original Paper

Title: Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment Authors: Ankur Samanta, Akshayaa Magesh, Youliang Yu, et al. Institution: Meta AI, Meta Superintelligence Labs, Columbia University, Cornell Tech Date: September 19, 2024 arXiv: 2509.15172v2Code: github.com/facebookresearch/maca

Key Contributions

  1. Self-Consistency as Intrinsic Property: Formalizes self-consistency as a learnable trait
  2. Multi-Agent Debate Framework: M agents × R rounds generates diverse reasoning paths
  3. Training Objectives: Supports MV-SFT, MV-GRPO, MV-DPO, MV-KTO
  4. Convergence Analysis: Tracks reasoning improvement across debate rounds

Implementation Details

This implementation focuses on:

  • MV-DPO (Majority-Vote Direct Preference Optimization) as primary training method
  • LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning
  • Local deployment via Ollama for privacy and control
  • Claude Code integration for seamless development workflows

🔧 Configuration

Debate Configuration

Key parameters in examples/configs/debate_config.json:

  • agents.count: Number of agents (M) - recommended: 3-7
  • agents.temperature: Response diversity - recommended: 0.7-0.9
  • rounds.total: Number of debate rounds (R) - recommended: 2
  • consensus.optimal_range: Filter debates by consensus strength - recommended: 0.6-0.8

Training Configuration

Key parameters in examples/configs/training_config.json:

  • lora.r: LoRA rank - recommended: 16 (small datasets), 32 (large datasets)
  • training_args.learning_rate: Learning rate - recommended: 1e-6 (small), 5e-6 (large)
  • training_args.num_train_epochs: Training epochs - recommended: 2-3
  • dpo_args.beta: DPO temperature - recommended: 0.1

📊 Expected Results

Based on our implementation and the original research:

Quality Metrics

  • Consensus Strength: Target 0.6-0.8 (sweet spot for training signal)
  • Convergence Rate: 30-50% of debates should show Round 1 → Round 2 improvement
  • DPO Pair Quality: Chosen responses should be 15-25% longer and more detailed

Training Outcomes

With 50-100 high-quality debate pairs:

  • Validation Accuracy: 80-95% (chosen > rejected)
  • Response Quality: +10-30% improvement in detail and reasoning
  • Zero Catastrophic Forgetting: Model retains general knowledge

Small Dataset Performance

Our conservative approach works with as few as 30-40 pairs:

  • Use learning_rate ≤ 1e-6
  • Limit to 2-3 epochs
  • Apply LoRA with r=16
  • Enable early stopping
  • Monitor train vs validation loss

🤝 Contributing

We welcome contributions! Areas where you can help:

  • Domain Examples: Share your domain-specific applications
  • Training Recipes: Optimize hyperparameters for different dataset sizes
  • Evaluation Methods: Improve quality assessment metrics
  • Documentation: Expand guides and tutorials
  • Bug Fixes: Report and fix issues

See CONTRIBUTING.md for guidelines.


📄 License

This project is licensed under the MIT License - see LICENSE file for details.


📖 Citation

This project implements the Multi-Agent Consensus Alignment (MACA) approach from Meta AI research.

Original Research

Paper: Samanta et al., "Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment" (2024)

Developed by: Meta AI in collaboration with Meta Superintelligence Labs and the LIINC Lab at Columbia University

If you use this framework in your research or application, please cite the original paper:

@misc{samanta2024maca,
title={Internalizing Self-Consistency in Language Models: Multi-Agent Consensus Alignment},
author={Ankur Samanta and Akshayaa Magesh and Youliang Yu and Runzhe Wu and Ayush Jain and Daniel Jiang and Boris Vidolov and Paul Sajda and Yonathan Efroni and Kaveh Hassani},
year={2024},
eprint={2509.15172},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://doi.org/10.48550/arXiv.2509.15172}
}

Related Resources

Implementation Differences

This implementation differs from Meta's research code in several key ways:

AspectMeta MACA (Research)This Implementation (Practical)
FocusMathematical reasoning benchmarks (GSM8K, MATH)Domain-agnostic business applications
InfrastructureMulti-GPU HuggingFace clustersLocal Ollama + single GPU
Training MethodsMV-SFT, MV-GRPO, MV-KTO, MV-DPOMV-DPO (Direct Preference Optimization)
ComplexityResearch-grade comprehensive implementationProduction-ready minimal dependencies
DeploymentHuggingFace checkpointsOllama models (instant local use)
Target UsersML researchersDomain experts and developers

Our implementation prioritizes accessibility, simplicity, and practical deployment while maintaining the core MACA methodology.


🙏 Acknowledgments

  • Meta AI for the original MACA research and implementation
  • Hugging Face for Transformers and TRL libraries
  • Ollama for local LLM serving
  • Anthropic for Claude Code and MCP framework

📮 Contact & Community


⚠️ Disclaimer

This is an independent implementation of the MACA research paper. Results may vary based on:

  • Base model quality
  • Dataset size and quality
  • Domain complexity
  • Training configuration
  • Hardware resources

Always evaluate thoroughly before production use.


Built with ❤️ for the open-source AI community

Last Updated: November 2025

About

Combining Meta's Multi Agent Consensus Alignment research with Claude Code plugin framework

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages