Token Level Ensemble Averaging in Autoregressive Generation

20 concepts12 papers1 proposal

In traditional machine learning, ensembling is straightforward: you take the final outputs of multiple models, average their predictions or take a majority vote, and deliver the result. While this works well for classification or regression, it breaks down in autoregressive structured prediction—tasks like machine translation, speech recognition, and text generation where a model generates a sequence token by token.

If you wait until multiple language models finish generating entire sentences to rank or vote on them, you are often too late. Autoregressive generation is a sequential dependency chain; a single logical error or hallucinated token early on alters the context for all subsequent steps, causing errors to compound rapidly. As Xu et al. point out, sentence-level ensembling completely fails if every individual model makes a mistake somewhere along its generation path.

To solve this, a powerful paradigm has emerged: token-level ensemble averaging (or step-wise probability fusion). Instead of ensembling completed sequences, these methods intervene at every single decoding step, merging the internal probability distributions or logits of multiple models or inference paths before the next token is sampled.

The Mechanism of Step-Wise Fusion

To understand why this works, consider how an autoregressive model predicts the next word. At step $t$, the model outputs a vector of raw scores (logits) across its entire vocabulary, which is then converted into a probability distribution via a softmax operation.

In token-level ensembling, rather than letting a single model sample from its distribution, the system aggregates the distributions of multiple models at that exact step. This is often framed as a "product-of-expectations" approach. As demonstrated by Malinin et al., combining predictions at this granular token level yields significantly better predictive performance and more reliable uncertainty estimates than global, sequence-level averaging.

[Context] ---> Model A Logits \
         ---> Model B Logits ---> [Weighted Average / Fusion] ---> Softmax ---> [Next Token]
         ---> Model C Logits /

By averaging token-level probability vectors, the ensemble acts as a real-time course-correction mechanism. If one model begins to hallucinate or drift into an error, the collective probability profiles of the other models steer the generation back to accuracy before the mistake can cascade (Yu et al.). This fine-grained interaction allows for mid-sequence error correction, which is particularly vital for complex, multi-step tasks like arithmetic reasoning or medical summarization (Liu et al.; Manakul et al.).

Aligning Disparate Vocabularies

A significant hurdle to implementing this idea across different state-of-the-art models is that they rarely share the same tokenizer. If Model A's vocabulary maps index 42 to the word "cat" and Model B's vocabulary maps index 42 to the word "the", you cannot simply average their logit vectors.

To unlock training-free collaboration between heterogeneous models, researchers have focused on real-time vocabulary alignment. For example, Feng et al. developed a framework called DEEPEN, which maps the internal probability distributions of different models into a universal "relative space" built on shared anchor tokens. Similarly, Xu et al. introduced EVA (Ensemble via Vocabulary Alignment), which mathematically projects disparate vocabulary spaces into a unified target space mid-sentence. These methods allow entirely different architectures to pool their confidence profiles at each decoding step without requiring expensive fine-tuning or distillation.

A Universal Pattern Across Architectures

The intuition of step-wise fusion extends far beyond combining different large language models. The same core mechanism—averaging distributions at the generation step to stabilize outputs—appears across several distinct research facets:

  • Multi-Decoder Fusion: In string-based molecular generation, character-by-character autoregressive models frequently suffer from compounding errors. To mitigate this, Kwon et al. utilized a shared encoder with multiple decoders, averaging their raw logit scores at each step to stabilize the generation of novel molecules.
  • Implicit Self-Consistency: Instead of running independent generation passes and voting on the final text, the Integrative Decoding method proposed by Cheng et al. tracks multiple parallel inference paths simultaneously, summing their logits at every single token step to ensure the final output reflects a continuous consensus.
  • Test-Time Augmentation: For vision-language models, Kaya et al. demonstrated that averaging probability distributions from multiple augmented variations of an input image/prompt at each decoding step allows the model to reach an internal consensus on individual tokens, correcting reasoning errors mid-generation.
  • Uncertainty-Driven Reframing: Rather than ensembling different models, Storaï developed HARP to ensemble different views of the same context. When the model detects high uncertainty at a specific token, it reframes the input pass and blends the original output logits with the reframed logits to immediately resolve the hesitation.
  • Mixture of Experts (MoE): In zero-shot dialogue state tracking, the authors of the Divide, Conquer, and Combine framework showed that merging token-level probability distributions from specialized, semantically independent experts via weighted aggregation yields higher accuracy than averaging the underlying model parameters.

Why It Works: Calibration and Nuance Preservation

The fundamental reason token-level fusion outperforms sequence-level alternatives is that it treats sequence generation as a continuous sequence of classification choices, preserving the nuanced internal states of the models (Yu et al.).

When models output a final sentence, their alternative token candidates and confidence metrics are discarded. Token-level ensembling retains this information. If Model A is 99% confident in token $X$, and Model B is split 50/50 between token $X$ and token $Y$, the averaged distribution heavily weights token $X$. This local probability alignment smooths out individual model errors and significantly improves the calibration of the generated sequence (Malinin et al.).

Furthermore, this granular approach enables computational efficiency through cascading. Because uncertainty can be measured at each discrete step, systems do not need to run a massive ensemble constantly; they can invoke the full token-level ensemble exclusively when the primary model flags a token as highly uncertain, combining robust error prevention with test-time efficiency (Yu et al.).

Key Foundational Work

Uncertainty Estimation in Autoregressive Structured Prediction (2021) — contributed 2 concept elements to this direction.
Uncertainty in Structured Prediction (2020) — contributed 2 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_product_of_expectations_6c963b9e,
  title = {product-of-expectations},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/product-of-expectations/rdr_6c963b9ebd85416ca44ba31d1cb2e246},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-26},
}

This exact version (version 1, frozen text):

@misc{lacuna_product_of_expectations_6c963b9e_v1,
  title = {product-of-expectations},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/product-of-expectations/rdr_6c963b9ebd85416ca44ba31d1cb2e246/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-26},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake