Improving Consistency in LLM Inference using Probabilistic Tokenization

Ashutosh Sathe, Divyanshu Aggarwal, Sunayana SitaramNAACL 2025

Abstract

Large Language Models (LLMs) typically process text through a single, deterministic tokenization sequence. However, many strings can be validly segmented into multiple token sequences. This paper introduces Probabilistic Tokenization, a novel inference-time technique that samples multiple valid input tokenizations to generate diverse reasoning paths. By shifting the source of diversity from the model's output to its input, this method significantly improves consistency and performance across both generative reasoning and log-likelihood-based multiple-choice tasks.

Introduction

Modern LLMs do not process raw text; they operate on tokens—discrete chunks of characters typically generated via Byte-Pair Encoding (BPE). Standard inference pipelines use a greedy approach to pick the most frequent tokens, resulting in a single "best-guess" representation of the input. This deterministic mapping ignores the inherent ambiguity in string segmentation.

Existing reliability-enhancing techniques, such as Chain-of-Thought with Self-Consistency (CoT+SC), rely on sampling diverse outputs (e.g., via temperature sampling). While effective, this approach is limited by the model's output distribution and is fundamentally inapplicable to "log-likelihood" tasks, such as multiple-choice evaluations where the model ranks fixed answer choices without generating new text. Probabilistic Tokenization addresses these gaps by introducing diversity at the input stage.

Methodology

The proposed method involves three primary steps:

  1. Token Probability Estimation: The authors estimate the probability of individual tokens using a 10-billion token subset of the FineWeb dataset.
  2. Sampling Tokenizations: Instead of greedy BPE, a unigram language model approach is used to sample $m$ different valid tokenizations for a single input prompt.
  3. Inference and Aggregation:
    • Reasoning Tasks: For each sampled tokenization, the model generates a reasoning path using greedy decoding. The final answer is determined by a majority vote across the $m$ paths.
  4. Log-likelihood Tasks: For multiple-choice questions, the model calculates the likelihood of each option under $m$ different input tokenizations. The final selection is made using either "Majority Voting" or a "Classifier"—a small, two-layer neural network trained to identify the most reliable distributions.

Experimental Setup

The method was evaluated across a diverse set of models, including Mistral-7B, Llama3 (8B and 70B), Gemma (2B and 7B), OLMo-7B, and the state-space model Mamba-2.8B. Benchmarks included:

  • Reasoning: MATH, AQuA, GSM8k, and PIQA.
  • Log-likelihood (MCQ): ARC-Challenge, HellaSwag, PAWSX, and TruthfulQA.

Key Results

Probabilistic Tokenization demonstrates substantial performance gains across all evaluated categories. On reasoning benchmarks, the "Probabilistic Majority" approach achieved an average improvement of +17.11% over the baseline, surpassing the standard CoT+SC method (+16.39%).

Performance of Probabilistic Tokenization on reasoning tasks across various models.

For log-likelihood tasks, where traditional self-consistency is not possible, the "Classifier" selection method yielded a massive average improvement of +26.32%. Notably, the "Oracle" potential—the accuracy if the model could perfectly select the best path from the samples—reached improvements as high as +71.40% on reasoning tasks, suggesting that correct solutions are frequently present in the sampled distribution.

Performance gains on log-likelihood (multiple-choice) tasks using different selection strategies.

Discussion and Insights

The authors identify several key advantages of input-level diversity:

  • Logical vs. Surface Diversity: Unlike temperature sampling, which often results in superficial paraphrasing, varying the input tokenization forces the model into different internal states. This leads to "logically diverse" reasoning paths—different mathematical or logical approaches to the same problem.
  • Sensitivity to Pre-training: The benefits of this method scale with model maturity. Models in the very early stages of training (<10B tokens) struggle with rare tokenizations, as these specific combinations have not been sufficiently represented in their training data.
  • Classifier Advantage: In MCQ tasks, a simple majority vote is effective, but a trained classifier can learn to ignore tokenizations that lead to high-entropy or "flat" probability distributions, further boosting accuracy.

Limitations and Future Work

While powerful, Probabilistic Tokenization requires a large, diverse corpus to estimate token probabilities, which may be a barrier in specialized domains. Additionally, like other self-consistency methods, it increases computational cost by requiring $m$ inference passes. Future research will focus on developing model-specific filters to automatically reject "noisy" tokenizations, aiming to close the gap between current performance and the theoretical "Oracle" limit.

Summary updated

BibTeX
@inproceedings{sathe2025improving,
  author = {Ashutosh Sathe and Divyanshu Aggarwal and Sunayana Sitaram},
  title = {{Improving Consistency in LLM Inference using Probabilistic Tokenization}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.findings-naacl.268},
}
Figure