Abstract
Large Language Models (LLMs) possess diverse strengths and weaknesses based on their training data and architecture. While ensembling multiple models can improve performance, existing methods often suffer from high computational costs or architectural constraints. This paper introduces Dynamic Ensemble Reasoning (DER), a framework that treats ensembling as a sequential decision-making process. By utilizing a lightweight agent to route questions through a chain of diverse LLM experts and employing a specialized "Knowledge Transfer Prompt," DER achieves state-of-the-art performance with up to a 7-fold reduction in computational costs compared to traditional parallel ensemble methods.
Introduction
The rapid proliferation of Large Language Models (LLMs) has led to a diverse ecosystem of models, each with unique "personalities" and specialized capabilities. To leverage these complementary strengths, researchers have turned to ensembling. However, current ensembling techniques face a critical "trilemma":
- Efficiency: Methods like ranking or voting require running all available models, leading to prohibitive inference costs.
- Compatibility: Parameter-level merging is restricted to homologous models with identical architectures.
- Collaboration: Simple routing (picking one "best" model) fails to exploit the potential synergy where models build upon each other's intermediate reasoning.
Dynamic Ensemble Reasoning (DER) addresses these challenges by framing the ensemble process as a sequential task where a small agent dynamically selects the most appropriate expert at each step.
Methods: Dynamic Ensemble Reasoning
The core of DER is the formulation of the ensembling process as a Markov Decision Process (MDP). Unlike static approaches, DER creates a dynamic pipeline where models collaborate iteratively.
The DER Architecture
The system consists of several key components working within an environment:
- DER-Agent: A lightweight model (based on OPT-125M) that serves as the controller. At each time step $t$, it observes the state $s_t$ (the original question $x$ and the previous answer $\hat{y}_{t-1}$) and selects an action $a_t$—choosing an LLM expert from the pool.
- Knowledge Transfer Prompt (KTP): To facilitate effective collaboration, the selected expert is provided with a KTP. This prompt frames the previous output as "advice from another student," which encourages the model to refine the existing answer rather than blindly following it or starting from scratch.
- The Terminator: A binary classifier monitors the quality of the evolving answer. If the answer meets a predefined quality threshold (e.g., based on BERTScore), the process terminates early, saving resources.
Training via Reinforcement Learning
The DER-Agent is trained using Proximal Policy Optimization (PPO). The reward function $r_t$ is designed to balance two competing objectives: maximizing the quality of the final answer (measured by BERTScore) and minimizing the computational cost (penalizing the use of excessively large models or long chains).
Experimental Evaluation
The authors evaluated DER against a wide range of baselines, including individual LLMs (like ChatGPT, Vicuna, and Koala) and state-of-the-art ensemble methods (like PairRanker and LLM-debate).
Datasets
Testing was conducted across three diverse benchmarks:
- MixInstruct: A comprehensive benchmark for general instruction-following.
- GSM8K: A standard dataset for grade-school math word problems, testing logical reasoning.
- Multidomain QA: A custom dataset designed to evaluate generalization across various specialized topics.
Key Results
- Superior Efficiency: DER achieved a 7-fold reduction in parameters during inference compared to traditional ensemble methods that process all model outputs. On the GSM8K benchmark, it reduced inference costs by over 77% while outperforming baselines like PairRanker.
- Competitive Performance: Using a pool of smaller, open-source models, the DER system reached 98% of ChatGPT's performance on the BERTScore metric.
- Effective Collaboration: Ablation studies confirmed the importance of the Knowledge Transfer Prompt (KTP), which alone provided a 9% improvement in BARTScore by mitigating model bias and hallucinations.
Discussion and Conclusion
The success of DER highlights that LLMs are often more effective at improving an existing answer than generating a perfect one in a single pass. By chaining models sequentially, the system can correct errors mid-stream.
However, some limitations remain. The sequential nature of DER may introduce higher "time to first token" latency compared to parallel methods, even if the total FLOPs are lower. Additionally, the system requires an initial training phase for the agent and the terminator. Future research will explore scaling the model pool to include thousands of specialized "open-world" models and optimizing the sequential latency.
In summary, DER provides a scalable and efficient path for integrating diverse LLM experts, overcoming the traditional trade-offs between performance and computational cost.
Summary updated