Text Generation Beyond Discrete Token Sampling

Yufan Zhuang, Liyuan Liu, Chandan Singh, Jingbo Shang, Jianfeng Gao
5/20/2025
cs.CLcs.AI

No official code found. Best implementation: EvanZhuang/mixinputs (26 stars, Apache-2.0, last commit 2025-08-11).

Abstract

In standard autoregressive generation, an LLM predicts the next-token distribution, samples a discrete token, and then discards the distribution, passing only the sampled token as new input. To preserve this distribution's rich information, we propose Mixture of Inputs (MoI), a training-free method for autoregressive generation. After generating a token following the standard paradigm, we construct a new input that blends the generated discrete token with the previously discarded token distribution. Specifically, we employ a Bayesian estimation method that treats the token distribution as the prior, the sampled token as the observation, and replaces the conventional one-hot vector with the continuous posterior expectation as the new model input. MoI allows the model to maintain a richer internal representation throughout the generation process, resulting in improved text quality and reasoning capabilities. On mathematical reasoning, code generation, and PhD-level QA tasks, MoI consistently improves performance across multiple models including QwQ-32B, Nemotron-Super-49B, Gemma-3-27B, and DAPO-Qwen-32B, with no additional training and negligible computational overhead.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Official implementation for Text Generation Beyond Discrete Token Sampling

265Shell, PythonMay 20, 20251 years agoApache-2.0
llmvllm

Similar Papers

Cite this paper

@article{zhuang2025text,
  title  = {Text Generation Beyond Discrete Token Sampling},
  author = {Yufan Zhuang and Liyuan Liu and Chandan Singh and Jingbo Shang and Jianfeng Gao},
  year   = {2025},
  eprint = {2505.14827},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.14827v3},
  journal = {NEURIPS 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.14827.svg)](https://codeofpaper.com/paper/2505.14827)

Discussion