Abstract
Ensembling various Large Language Models (LLMs) to unlock their complementary potential and leverage their individual strengths is highly valuable. Previous studies typically focus on two main paradigms: sample-level and token-level ensembles. Sample-level ensemble methods either select or blend fully generated outputs, which hinders dynamic correction and enhancement of outputs during the generation process. On the other hand, token-level ensemble methods enable real-time correction through fine-grained ensemble at each generation step. However, the information carried by an individual token is quite limited, leading to suboptimal decisions at each step. To address these issues, we propose SweetSpan, a span-level ensemble method that effectively balances the need for real-time adjustments and the information required for accurate ensemble decisions. Our approach involves two key steps: First, we have each candidate model independently generate candidate spans based on the shared prefix. Second, we calculate perplexity scores to facilitate mutual evaluation among the candidate models and achieve robust span selection by filtering out unfaithful scores. Experimental results in both standard and challenging settings across various language generation tasks demonstrate the effectiveness, robustness, and versatility of our approach compared with previous ensemble methods.
The Ensembling Dilemma: Sample vs. Token Level
Ensembling multiple LLMs is a proven strategy to boost performance by combining the unique strengths of different architectures. However, researchers have traditionally been forced to choose between two suboptimal scales:
- Sample-level ensembling: Models generate full responses, and a ranker selects the best one. This approach is rigid; if every model makes a single mistake at different points in their long responses, the final output is guaranteed to be flawed. There is no mechanism to "mix and match" the correct segments of different outputs.
- Token-level ensembling: Models collaborate at every single token. While this allows for fine-grained correction, a single token often lacks the semantic context necessary for other models to judge it accurately. Furthermore, differing tokenizers across models make this approach computationally complex and difficult to scale.
As illustrated in Figure 1, the proposed SweetSpan framework identifies a "sweet spot" at the span level—sequences of words that carry enough information for accurate evaluation while remaining flexible enough for mid-stream error correction.
The SweetSpan Method
SweetSpan is a training-free, "plug-and-play" ensemble method that operates through a continuous generation-and-selection loop:
- Span Generation: Each candidate model in the ensemble independently generates a candidate span (a fixed number of words, such as 4 or 16) based on the current shared prefix.
- Mutual Evaluation: Every model then calculates a perplexity score for every candidate span. Perplexity measures how "likely" a model considers a sequence of text; lower perplexity generally correlates with higher quality.
- Adaptive Filtering: To ensure robustness, the system filters out outlier scores. This prevents a single underperforming or "noisy" model from skewing the average and dragging down the ensemble's performance.
- Selection: The span with the lowest average filtered perplexity is appended to the prefix, and the process repeats.
Because SweetSpan operates on words rather than raw tokens, it is entirely vocabulary-agnostic. This allows for the seamless ensembling of models with different architectures, such as Llama, Baichuan, or InternLM, without complex alignment procedures.
Experimental Results and Task-Specific Insights
The researchers evaluated SweetSpan across a diverse array of benchmarks, including Natural Questions (NQ) for reasoning, GSM8K for arithmetic, MBPP for code generation, and Flores-101 for machine translation.
As shown in Figure 3, SweetSpan consistently outperformed both individual models and state-of-the-art ensemble baselines like LLM-Blender and EVA. A key finding is that the optimal "sweet spot" for span length varies significantly by task:
- Deterministic Tasks: For coding (MBPP) or short-answer questions (NQ), shorter spans (1-4 words) are ideal. In these domains, a single incorrect word can break logic or syntax, so frequent correction is paramount.
- Reasoning Tasks: For complex multi-step math (GSM8K), longer spans (16 words) performed best. This allows a model to complete a full logical "thought" before the ensemble evaluates its validity.
In the GSM8K benchmark, SweetSpan achieved a massive 12.21-point improvement over the best individual model. Furthermore, in a "Challenging Setting" where high-performing models were paired with significantly weaker ones, SweetSpan’s adaptive filtering successfully ignored the "unfaithful" scores of the weaker models, maintaining high performance where traditional methods collapsed.
Conclusion
SweetSpan effectively addresses the limitations of previous ensembling paradigms by operating at the span level. By balancing real-time error correction with sufficient semantic context, it provides a robust and versatile framework for leveraging the collective intelligence of Large Language Models across a wide variety of linguistic and reasoning tasks.
Summary updated