Batch Universal Prediction

Marco Bondaschi, Michael Gastpar · DOI

Introduction

In classical information theory, universal prediction focuses on estimating the probability of future data without prior knowledge of the underlying distribution. Traditionally, performance is measured by regret—the additional loss incurred by a predictor compared to an omniscient model that knows the true distribution. However, a significant gap exists between this classical theory and the reality of modern Artificial Intelligence.

While classical theory assumes a single, continuous stream of data, Large Language Models (LLMs) are trained and evaluated on batches: independent snippets of text such as individual Wikipedia articles, code files, or books. This paper introduces batch regret, a theoretical framework designed to account for this batch-wise training paradigm, providing the first asymptotic bounds for this metric.

The Problem: Sequential vs. Batch Realities

In sequential prediction, a model observes a long sequence and gradually improves its internal representation. Over time, the influence of the sequence's starting state diminishes. In contrast, LLMs face a "fresh start" with every new batch. Because each batch is independent, the predictor must be highly efficient at estimating the initial distribution of the data, as this initial state plays a disproportionately large role in the total error.

To address this, the authors ask a fundamental question: If a model is trained on $n$ batches of length $\ell$, how much regret does it incur when predicting a completely new, unseen test batch?

Methodology

The research focuses on add-constant predictors (Laplace smoothing). These are fundamental estimators that add a small value $\beta$ to observed counts to prevent the model from assigning zero probability to unseen events. The study analyzes these predictors across two synthetic probabilistic models:

  1. Binary Memoryless Sources: Sequences of bits (0s and 1s) generated independently with a fixed probability $\theta$.
  2. Binary First-Order Markov Sources: Sequences where the probability of the next bit depends on the current bit, governed by a transition matrix.

Using analytical tools such as Gamma function properties and Binomial distribution bounds, the authors examine how batch regret behaves as both the number of batches ($n$) and the batch length ($\ell$) approach infinity.

Key Insights

The Scaling of Regret

For memoryless sources, the authors found that batch regret scales approximately as $\frac{1}{2} \log(1 + 1/n)$. This is a critical finding because it demonstrates that the error is primarily dominated by the number of batches ($n$) rather than the total number of individual samples ($n \times \ell$). This suggests that seeing a diverse variety of batches is more impactful for reducing regret than simply increasing the length of those batches.

Boundary vs. Interior Dynamics

The "penalty" for prediction varies depending on the true probability of the source. If the probability is in the "interior" (e.g., a 50/50 coin flip), the regret follows a specific curve. However, if the probability is at the "boundary" (e.g., a source that almost always produces 1s), the behavior of the regret changes, requiring specific mathematical treatments provided in the paper.

Markov Complexity

In Markov sources, the regret is bifurcated into two components: the error in estimating how a sequence begins and the error in estimating how it transitions between states. The authors prove that both components are roughly proportional to $1/n$, establishing a clear benchmark for how simple learners should improve as they encounter more data.

Key Results and Theorems

  • Theorem 1 (Memoryless Sources): The maximum average regret for a smoothed predictor is $\frac{1}{2} \log(1 + \frac{1}{n}) + o(\frac{1}{n\ell})$. This provides a concrete upper bound for optimal simple learners in a batch setting.
  • Theorems 3 & 5 (Markov Sources): The authors established that the regret for transition probabilities in Markov chains is upper-bounded by $\frac{1}{2n}$.
  • Optimal Smoothing: The research indicates that the "best" constant $\beta$ for smoothing depends on the specific data source. While $\beta=1/2$ (Krichevsky-Trofimov) is standard for sequential settings, the batch setting may require different constants to minimize regret effectively.

Limitations and Future Directions

While this work provides a foundational step toward understanding batch-wise learning, it currently focuses on binary alphabets and simple sources. Real-world language is significantly more complex than first-order Markov chains, involving higher-order dependencies and intricate structures.

Future research is needed to generalize these results to larger vocabularies (similar to the thousands of tokens used by LLMs) and more complex data structures. Additionally, the authors conjecture that no predictor can decay faster than $1/n$, but a formal proof for the absolute lower bound in the Markov case remains an open challenge in the field.

Summary updated

BibTeX
@inproceedings{bondaschi2024batch,
  author = {Marco Bondaschi and Michael Gastpar},
  title = {{Batch Universal Prediction}},
  booktitle = {ISIT},
  year = {2024},
  doi = {10.1109/isit57864.2024.10619270},
}
Figure