RL-MoE Evolution: Architecture for Recursive Self-Improvement Multi-Agent System
Status: Conceptual exploration — theoretical design with references to existing techniques
Date: 2026-07-18
Inspiration: AlphaGo self-play, RLAIF, DPO/GRPO, SPIN, Mixture of Experts, Neuroevolution
1. Executive Summary
This document explores a system where multiple language models (LLMs) recursively improve their capabilities through a cycle of:
- Task assignment between models
- Response generation by worker models
- Cross-evaluation of responses between models
- Preference dataset synthesis for RL fine-tuning
- Fine-tuning of specific models using RL (DPO/GRPO)
- Reset and replication of knowledge across models
- Evolutionary selection (best models replicate, worst ones get refined)
The system resembles an evolutionary Mixture of Experts, where experts are not static but continuously improve through interaction and competition.
2. Core Concept
2.1 The Metaphor: From Deep Blue to an Evolutionary Ecosystem
| System | Mechanism | Limitation |
|---|---|---|
| AlphaGo | Self-play → RL → single agent improvement | One model, one domain |
| RLAIF | AI evaluates AI → preference dataset | Unidirectional evaluation |
| MoE | Multiple experts, one router | Static experts post-training |
| RL-MoE Evolution | Multiple models mutually evaluate and improve each other in a cycle | Novel: distributed evolution |
2.2 Fundamental Principles
- Cyclicity: The system operates in epochs. Each epoch: generate → evaluate → fine-tune → reset
- Distribution: No single “master” model. Improvement emerges from peer-to-peer interactions
- Self-selection: Models collectively decide who needs improvement and in what direction
- Preservation vs. Innovation: “Elite” models are preserved, “explorer” models experiment
- Emergent Specialization: Models naturally develop competence niches
3. System Architecture
3.1 Model Roles
graph TD
subgraph Pool_de_Modelos[Model Pool]
O[Orchestrator<br/>1 per epoch]
W[Worker<br/>×N]
E[Evaluator<br/>×M]
S[Selector<br/>×K]
end
O --> T[Generates Tasks]
T --> W
W --> R[Responses]
R --> E
E --> EV[Evaluations]
EV --> S
S --> D[Evolutionary Decisions]
D --> Pool_de_Modelos
classDef orchestrator fill:#4a90d9,color:#fff
classDef worker fill:#27ae60,color:#fff
classDef evaluator fill:#e67e22,color:#fff
classDef selector fill:#9b59b6,color:#fff
class O orchestrator
class W worker
class E evaluator
class S selector
Orchestrator (1 per epoch)
- Function: Decompose high-level objectives into concrete tasks
- Input: High-level goal + pool performance history
- Output: Set of tasks with success criteria
- Selection: The model with the best composite score from the previous epoch
Worker (N per epoch)
- Function: Execute assigned tasks, generate responses
- Input: Task description + context
- Output: Structured response
- Special note: Multiple workers receive the same task to generate diversity
Evaluator (M per epoch — preferably M ≥ 2)
- Function: Evaluate worker responses using rubrics
- Input: Original task + worker response + evaluation rubric
- Output: Numeric score + justification + preference signal (A > B)
- Key: Produces the preference dataset for RL fine-tuning
Selector (K per epoch)
- Function: Analyze results and determine:
- Which model(s) need fine-tuning
- What direction of improvement (based on systematic errors)
- Which model(s) deserve “elite” status (preserved)
- Which model(s) should be reset to a previous checkpoint
- Input: Complete epoch evaluations + evolutionary history
- Output: Fine-tuning and replication decisions
3.2 Model Pool and States
Each model in the pool has a state that determines its behavior:
| |
3.3 Epoch Dynamics
Each system epoch follows this structure:
| |
4. Iteration Lifecycle
4.1 Detailed Pipeline
graph LR
subgraph Epoca[Full Epoch]
direction LR
A[1 Task Assign<br/>Orchestrator] --> B[2 Generate<br/>Workers]
B --> C[3 Cross Evaluate<br/>Evaluators]
C --> D[4 Synthesize<br/>Dataset]
D --> E[5 RL Fine-Tune<br/>DPO/GRPO]
E --> F[6 Reset & Replicate]
end
F --> A
classDef step fill:#3498db,color:#fff
classDef rl fill:#e74c3c,color:#fff
classDef reset fill:#f39c12,color:#fff
class A,B,C step
class D,E rl
class F reset
4.2 Step by Step
Step 1: Task Assignment (Orchestrator)
The Orchestrator receives a high-level goal, for example: “Improve the mathematical reasoning capability of the pool”.
It generates tasks like:
| |
Step 2: Generate (Workers)
Each worker independently produces responses for their assigned tasks.
Step 3: Cross-Evaluate (Evaluators)
Each evaluator receives response pairs (or full sets) and produces:
| |
Step 4: Synthesize Dataset (Selector/Orchestrator)
Evaluations are consolidated into a preference dataset for RL fine-tuning:
| |
Step 5: RL Fine-Tune
Apply DPO (Direct Preference Optimization) or GRPO (Group Relative Policy Optimization) to the selected model:
| |
Why DPO over PPO:
- No separate reward model needed (the evaluations ARE the reward)
- More computationally stable
- Better for iterative fine-tuning with small datasets
- GRPO is an alternative when training with groups without a reward model
Step 6: Reset & Replicate
This critical phase distinguishes this system from linear fine-tuning:
| |
5. RL Fine-Tuning Mechanism
5.1 Method Comparison
| Method | Reward Model | Stability | Dataset Needed | Maturity | Ideal for… |
|---|---|---|---|---|---|
| PPO | Yes (separate) | Low-medium | Medium | Very high | Systems with external reward model |
| DPO | No (implicit) | High | Binary preferences | High | Cross-model evaluations (our case) |
| GRPO | No (groups) | High | Response groups | Medium | Multiple workers per task (our case) |
| KTO | No | High | Unpaired data | Medium | When no direct pairs available |
| ORPO | No | High | Single forward pass | Low | Rapid experimentation |
5.2 Recommended Architecture: GRPO with Multi-Evaluator Signal
| |
5.3 Advantage of Multi-Evaluator Approach
| |
6. Selection and Evolution
6.1 Self-Selection Mechanism
The Selectors analyze the pool and decide evolutionary actions. This is one of the most innovative aspects of the system.
| |
6.2 Evolutionary Algorithm
| |
6.3 Diversity Preservation
A risk is that all models converge to the same local optimum. Countermeasures:
- Diversity Reward: Bonus in evaluation for responses different from pool average
- Forced Specialization: Assign certain task types only to certain models
- Niche Protection: If a model is the only good one in a category, preserve it even if global score is low
- Exploration Bonus: Models exploring novel directions receive temporary protection
7. Self-Evaluation and Reward
7.1 Reward Signal Sources
graph TD
subgraph Reward_Signal[Composite Reward Signal]
direction LR
C1[Cross-Evaluation<br/>Weight: 0.5] --> R[Total Reward]
C2[Self-Evaluation<br/>Weight: 0.2] --> R
C3[External Metrics<br/>Weight: 0.2] --> R
C4[Diversity<br/>Weight: 0.1] --> R
end
classDef cross fill:#4a90d9,color:#fff
classDef self fill:#27ae60,color:#fff
classDef ext fill:#e67e22,color:#fff
classDef div fill:#9b59b6,color:#fff
classDef total fill:#e74c3c,color:#fff
class C1 cross
class C2 self
class C3 ext
class C4 div
class R total
7.2 The Reward Hacking Problem
Risk: Evaluators learn to give high scores to responses that resemble their own (self-similarity bias).
Mitigations:
- Evaluators never evaluate their own responses
- Evaluators rotate each epoch (no one is a permanent evaluator)
- Multiple evaluators per response (M ≥ 2, forced disagreement)
- Evaluators are models from different “lineage” than workers
- Occasionally inject human evaluation as ground truth
7.3 Reward Shaping
The composite reward is calculated:
Where weights w_* can evolve between epochs based on which signal best correlates with real improvement.
8. System Diagrams
8.1 General Flow Diagram
graph TD
%% Epoch
subgraph Epoch_N[Epoch N]
A[Model Pool] --> B[Assign Roles]
B --> C[Orchestrator generates tasks]
C --> D[Workers produce responses]
D --> E[Evaluators cross-evaluate]
E --> F{Sufficient data?}
F -->|Yes| G[Selector analyzes results]
F -->|No| C
G --> H{Decision per model}
end
subgraph Decisions[Evolutionary Decisions]
H -->|REINFORCE| I[DPO/GRPO Fine-Tune]
H -->|PRESERVE| J[Freeze model]
H -->|MERGE| K[Weight Averaging]
H -->|RESET| L[Revert checkpoint]
H -->|SPAWN| M[Create LoRA variant]
H -->|PRUNE| N[Archive model]
end
I --> O[Updated Pool]
J --> O
K --> O
L --> O
M --> O
N --> O
O --> P{New epoch?}
P -->|Yes| A
P -->|No| Q[System Stabilized]
style A fill:#4a90d9,color:#fff
style G fill:#e67e22,color:#fff
style I fill:#27ae60,color:#fff
style L fill:#e74c3c,color:#fff
8.2 Fine-Tuning Cycle
sequenceDiagram
participant Selector
participant Target_Model
participant Evaluator_Pool
participant DPO_Trainer
Selector->>Target_Model: Identify weakness: "unit conversion errors in math problems"
loop For each identified error
Selector->>Evaluator_Pool: Retrieve examples where Target_Model failed
Evaluator_Pool->>DPO_Trainer: (prompt, bad_answer, good_answer, score)
end
DPO_Trainer->>DPO_Trainer: Build preference dataset
Note over DPO_Trainer: DPO Loss = -log σ(β(log π_θ(y_w|x) - log π_ref(y_w|x) - β(log π_θ(y_l|x) - log π_ref(y_l|x))))
DPO_Trainer->>Target_Model: Fine-tune with dataset (3 epochs, lr=1e-6)
Target_Model-->>Selector: New checkpoint: model-3.epoch-13.rl-v1
Selector->>Selector: Validate on held-out tasks
alt Improvement confirmed (+5% accuracy)
Selector->>Pool: Replace model-3 with model-3.rl-v1
else No significant improvement
Selector->>Target_Model: Discard, preserve original
end
8.3 Evolutionary MoE
graph LR
subgraph Generation_1[Generation 1]
M1A[Model A - general purpose]
M1B[Model B - general purpose]
M1C[Model C - general purpose]
end
subgraph Epochs_1_5[Epochs 1-5: Specialization]
M2A[Model A - logical reasoning]
M2B[Model B - creativity]
M2C[Model C - factual precision]
M2D[Model D - code ← spawn from A]
end
subgraph Epochs_6_10[Epochs 6-10: Fusion]
M3A[Model A - logic + code ← merge A+D]
M3B[Model B - creativity + precision ← reset+merge B+C]
end
subgraph Epochs_11_15[Epochs 11-15: Maturity]
M4A[Model Elite - general reasoner]
M4B[Model Expert - pure creativity]
M4C[Model Expert - verifier]
end
M1A --> M2A
M1B --> M2B
M1C --> M2C
M2A --> M2D
M2A --> M3A
M2D --> M3A
M2B -.-> M3B
M2C -.-> M3B
M3A --> M4A
M3B --> M4B
M3B --> M4C
9. Implementable vs. Speculative Components
| Component | Status | Existing Technology | Difficulty |
|---|---|---|---|
| Task generation by LLM | ✅ Implementable | Any LLM with careful prompting | Low |
| Cross-evaluation between models | ✅ Implementable | RLAIF already demonstrated (Anthropic, Google) | Medium |
| DPO/GRPO fine-tuning | ✅ Implementable | TRL (HuggingFace), Axolotl, Unsloth | Medium |
| Weight averaging (model merging) | ✅ Implementable | MergeKit, TIES, DARE | Low |
| Multi-evaluator with aggregation | ✅ Implementable | Ensemble methods, voting systems | Medium |
| Self-selection of models to improve | ⚠️ Partial | Requires heuristics + experimentation | High |
| Complete autonomous cycle | ⚠️ Partial | Requires orchestration (Temporal, Airflow, or custom) | High |
| Knowledge reset and replication | ⚠️ Partial | Model merging exists, conditional reset doesn’t | High |
| Diversity reward/shaping | ⚠️ Partial | Known concept, novel application to LLMs | High |
| MoE evolution without explicit router | ❌ Speculative | Novel idea, no direct precedent | Very High |
| Self-evaluation without reward hacking | ❌ Speculative | Open problem in RLHF/RLAIF | Very High |
| Emergent niche selection | ❌ Speculative | Inspired by natural ecosystems | Very High |
10. MVP: Minimum Viable Prototype
10.1 MVP Scope
A concrete experiment that can be built with existing technology:
| |
10.2 MVP Architecture
| |
10.3 Required Resources
| Resource | MVP | Full Scale |
|---|---|---|
| GPUs | 1× RTX 3090/4090 (24GB) | 4-8× A100 (80GB) |
| Models | 2 small models | 8-16 medium/large models |
| Data | GSM8K (8K examples) | Benchmarks + synthetic datasets |
| Time | Days | Weeks |
| Code | ~500 lines Python | Distributed system |
| Fine-tuning | LoRA/QLoRA (15 min per epoch) | Full fine-tuning (hours per epoch) |
10.4 MVP Risks
- Overfitting: The evaluator may learn to prefer responses similar to itself
- Mitigation: Evaluator and worker must be different models
- Drift: Fine-tuning may degrade non-target capabilities
- Mitigation: Evaluation on diverse benchmarks pre/post fine-tuning
- Error reinforcement loop: If evaluator has bias, it amplifies it
- Mitigation: Periodic human evaluation as ground truth
11. Technology Gaps
11.1 Open Problems
| Gap | Description | Relevance |
|---|---|---|
| Reward Hacking in RLAIF | LLM evaluators prefer responses similar to themselves | Critical for the system |
| Catastrophic Forgetting | Fine-tuning improves task A but degrades B | High (multi-task) |
| Pool Convergence | All models end up identical | Critical (destroys MoE) |
| Diversity Measurement | How to quantify “how different” a response is? | Medium |
| Computational Cost | Training multiple models is prohibitive | High (practical) |
| Cycle Stability | The system might oscillate or diverge instead of converging | Critical |
| Reliable Self-Evaluation | When can a model evaluate itself without bias? | Very High |
| Weak Reward Signal | Cross-evaluations can be noisy | High |
11.2 Related Research Directions
| Work | Relationship | Key Difference |
|---|---|---|
| SPIN (Self-Play Fine-Tuning, 2024) | Model fine-tunes against itself as data generator | Single model vs. multi-model |
| Constitutional AI (Anthropic, 2022) | Model evaluates against constitution | Unidirectional vs. cross-evaluation |
| Self-Rewarding Models (Meta, 2024) | Model generates its own reward | Individual vs. collective reward |
| Mixture of Agents (Together AI, 2024) | Multiple models collaborate in generation | Static collaboration vs. evolution |
| Branch-Train-Merge (2022-2024) | Train specialized branches and merge | No self-improvement cycle |
| PALM (Self-Improvement, 2023) | Self-training with verification | Single cycle vs. recursive |
12. Relationship with NGBot
12.1 Can Synapse use this for self-improvement?
Currently Synapse has a basic self-improvement system that:
- Identifies error patterns in conversations
- Stores them in semantic memory (MCP)
- Uses them to improve future responses
Current limitations:
- No real fine-tuning (only improved prompting)
- No multiple Synapse instances
- No cross-evaluation between instances
- No evolutionary cycle
12.2 Scalability for NGBot
| |
12.3 Immediate Application: Meta-Learning Loop
Without implementing real fine-tuning, Synapse can already benefit from the philosophy of the system:
| |
13. Roadmap
Phase 0: Conceptual Validation (this document) ✅
Phase 1: Simulated Prototype (1-2 weeks)
- Implement MVP in Python (no GPUs)
- Use existing LLM APIs to simulate workers/evaluators
- Test the cycle with 2-3 API models (GPT-4o-mini, Claude, etc.)
- Validate that the cycle produces measurable improvement
Phase 2: Real Fine-Tuning (2-4 weeks)
- Integrate TRL/Axolotl for DPO/GRPO locally
- Use small models (Llama 3.2-3B, Phi-3)
- Test with GSM8K or another closed benchmark
- Compare against baseline without cycle
Phase 3: Extended Pool (1-2 months)
- Scale to 4-6 models with specialization
- Incorporate model merging (MergeKit)
- Test reset/replication cycle
- Evaluate against multiple benchmarks
Phase 4: Autonomous System (3-6 months)
- Full orchestration (Temporal/Airflow)
- Heuristic self-selection
- Diversity tracking
- Monitoring interface
Phase 5: NGBot Integration (6-12 months)
- Multiple Synapse instances
- Cross-evaluation between instances
- Automatic prompt/rag fine-tuning
- Human-AI hybrid system in the loop
Appendix A: Glossary
| Term | Definition |
|---|---|
| DPO | Direct Preference Optimization — RL fine-tuning without reward model |
| GRPO | Group Relative Policy Optimization — PPO variant without reward model |
| MoE | Mixture of Experts — architecture with specialized sub-models + router |
| RLAIF | RL from AI Feedback — using an LLM as evaluator instead of human |
| Self-Play | Technique where an agent plays against itself to generate data |
| Reward Hacking | When the model optimizes the reward signal without actually improving |
| Catastrophic Forgetting | Loss of prior capabilities when fine-tuning for new tasks |
| TIES-Merging | Technique to merge models by eliminating redundant parameters |
| Weight Averaging | Averaging parameters of two models to combine capabilities |
| LoRA | Low-Rank Adaptation — efficient fine-tuning of few parameters |
| QLoRA | Quantized LoRA — fine-tuning with quantization for memory savings |
Appendix B: References
- Rafailov et al. (2023). Direct Preference Optimization: Your Language Model is Secretly a Reward Model. arXiv:2305.18290.
- Bai et al. (2022). Constitutional AI: Harmlessness from AI Feedback. arXiv:2212.08073.
- Shao et al. (2024). DeepSeekMath: Pushing the Limits of Mathematical Reasoning. (GRPO)
- Chen et al. (2024). SPIN: Self-Play Fine-Tuning. arXiv:2401.01335.
- Silver et al. (2017). Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm. Nature.
- Fedus et al. (2021). Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity. (MoE)
- Yuan et al. (2024). Self-Rewarding Language Models. arXiv:2401.xxxxx.
- Wang et al. (2024). Mixture-of-Agents: A Multi-LLM Collaboration Framework.
- Wortsman et al. (2022). Model Soups: Averaging Weights of Multiple Fine-Tuned Models. (model merging)
- Yadav et al. (2023). TIES-Merging: Resolving Interference When Merging Models. (TIES)