TL;DR
Instead of running massive, computationally expensive LLM ensembles or relying on a single model, Dynamic Ensemble Reasoning (DER) models the ensembling process as a Markov Decision Process (MDP). A lightweight reinforcement learning agent dynamically routes questions through a sequence of specialized LLM experts, passing intermediate answers along the way and stopping early once a satisfactory answer is reached. This approach matches or exceeds state-of-the-art ensemble performance while reducing inference compute by up to 85%.
What Problem Does This Paper Address?
Large Language Models (LLMs) possess distinct strengths and weaknesses shaped by their unique architectures, sizes, and training data. To exploit these differences, researchers use ensembling—combining multiple models to get a better answer. However, current ensembling strategies fall into two extreme, flawed camps:
- Computationally Heavy Aggregators: Methods like PairRanker or LLM-Blender run all candidate LLMs in parallel and then rank or fuse their outputs. This wastes massive amounts of compute on easy questions that a single small model could answer.
- Hard Routers: Methods like ZOOTER use a classifier to pick the single best LLM for a given prompt. While cheap, this approach fails to leverage the complementary knowledge of multiple experts working together.
The authors introduce DER to bridge this gap, allowing multiple non-homologous LLMs to collaboratively refine an answer in a sequential, compute-efficient pipeline.
Methods
DER frames dynamic ensembling as a sequential decision-making problem, formalizing it as a Markov Decision Process (MDP):
- State ($s_t$): The current state consists of the original input question ($x$) paired with the latest generated answer ($\hat{y}_{t-1}$).
- Action ($a_t$): The action chosen by the agent is the index of the LLM expert selected from the model pool to refine the current answer.
- Policy ($\pi_\theta$): A lightweight, tuned
OPT-125Mmodel acts as the DER-Agent, taking the current state text and outputting a probability distribution over the available LLMs. It is trained using Proximal Policy Optimization (PPO). - Knowledge Transfer Prompt (KTP): To prevent subsequent LLMs from blindly copying or getting confused by prior outputs, the authors design a specialized prompt. It frames the previous LLM's output as "another student's answer" and instructs the current LLM to use it as advice to generate a superior response.
- Reward Function: The agent is rewarded based on three factors: the absolute quality of the answer (measured via BERTScore), the incremental improvement over the last step ($\Delta P$), and a penalty proportional to the computational cost of the selected LLM.
- Early Termination ("The Terminator"): To save compute, a binary classifier (the Terminator) evaluates the answer at each step. If the quality crosses a predefined threshold ($p_0$) or hits the maximum step limit ($T_{max} = 4$), the trajectory stops and outputs the final text.
Datasets
The authors evaluated DER across diverse language and reasoning tasks using:
- MixInstruct: A benchmark dataset commonly used for instruction-following and general QA ensembling evaluation.
- GSM8K: A standard dataset for multi-step mathematical reasoning.
- Multidomain QA: A dataset constructed by the authors to evaluate generalization across multiple distinct domains (detailed in the paper's appendix).
The model pool consisted of eleven diverse, open-source LLM experts ranging from 6B to 16B parameters (including Vicuna, Alpaca, MOSS, ChatGLM, and Koala).
Key Insights and Ideas
- Collaborative Refinement beats Parallel Voting: Instead of generating answers in isolation, LLMs perform better when they build upon each other's work. One model's output serves as a stepping stone for the next expert.
- The "Student Advice" Framing is Crucial: Simply concatenating prompts often causes LLMs to replicate errors. Framing prior answers as a peer's advice encourages the model to critically evaluate and improve the text rather than copy it.
- Ensembles Don't Need to Be Uniformly Deep: The agent naturally learns an early-stopping strategy. The authors found that 55.7% of the generated routes required two or fewer steps, meaning the system automatically saves compute on easier queries.
Key Results
DER achieved significant performance gains over both individual models and state-of-the-art ensemble frameworks:
- Massive Parameter Reduction: On the MixInstruct benchmark, DER achieved SOTA results while requiring an average of only 17B inference parameters—an 85% reduction compared to PairRanker, which requires 117B parameters.
- Close to ChatGPT Performance: DER reached 98% of ChatGPT's performance on the BERTScore metric while utilizing only a fraction of the inference compute.
- Math Reasoning Boost: On GSM8K, DER outperformed the next-best ensemble method by 15.94% in absolute accuracy, proving that sequential knowledge transfer is highly effective for reasoning chains.
Limitations and Future Work
While highly efficient, DER introduces a few dependencies:
- Proxy Metric Reliance: The reward function heavily relies on BERTScore during training. While BERTScore correlates well with human judgment, it is an imperfect proxy for text quality.
- The Terminator Overhead: The framework requires training a separate binary classifier to act as the early-stopping "Terminator," adding a small amount of system complexity.
- Fixed Horizon: The maximum trajectory length is strictly capped ($T_{max}=4$). Future work could explore fully flexible horizons or scaling the framework to include much larger pools of heterogeneous models, including proprietary APIs.
Summary updated