stat.MLSep 17, 2026

Next-token functional estimation

Authors: Milind NakulVidya MuthukumarAshwin Pananjady

Abstract

Suppose we observe the first nn points of a sequence of random variables having length n+1n+1, and wish to estimate a functional of the unobserved final point and the empirical measure of the nn observed training points. Such next-token functionals include the probability that the next token is novel (also known as the surprise probability), the tail probability of the minimum distance between the next token and training points, and the test error of a classifier trained on the observed points. All of these quantities are classically estimated by the leave-one-out method, which is inconsistent under temporal dependence. We propose a leave-a-window-out estimator, which deletes a window of length ττ after each index before forming the empirical measure and reduces to leave-one-out at τ=1τ= 1. Under natural assumptions, we show that the error of our estimator decays at a parametric rate for any stationary ββ-mixing process that also admits a Marton coupling. Our results thus cover several natural functionals on a large class of stochastic processes. We complement these upper bounds with a sharp minimax lower bound for estimating the surprise probability on mixing Markov chains. Simulations on Markov chains, moving-average processes, and autoregressive processes show that our estimator succeeds in many scenarios where leave-one-out and add-constant baselines fail.

Explore similar work

Apr 22, 2026cs.LG

Relative Entropy Estimation in Function Space: Theory and Applications to Trajectory Inference

Trajectory Inference (TI) seeks to recover latent dynamical processes from snapshot data, where only independent samples from time-indexed marginals are observed. In applications such as single-cell genomics, destructive measurements make path-space laws non-identifiable from finitely many marginals, leaving held-out marginal prediction as the dominant but limited evaluation protocol. We introduce a general framework for estimating the Kullback-Leibler divergence (KL) divergence between probability measures on function space, yielding a tractable, data-driven estimator that is scalable to realistic snapshot datasets. We validate the accuracy of our estimator on a benchmark suite, where the estimated functional KL closely matches the analytic KL. Applying this framework to synthetic and real scRNA-seq datasets, we show that current evaluation metrics often give inconsistent assessments, whereas path-space KL enables a coherent comparison of trajectory inference methods and exposes discrepancies in inferred dynamics, especially in regions with sparse or missing data. These results support functional KL as a principled criterion for evaluating trajectory inference under partial observability.
Chao Wang, Luca Nepote, Giulio Franzese +1
May 28, 2026stat.ML

Leave a Window Out: Modifying the Jackknife for Predictive Inference in Time Series

Conformal prediction methods enjoy strong theoretical and empirical predictive inference performance, provided the data is exchangeable and is treated symmetrically during training. However, these assumptions are impractical in many settings, such as time series, where temporal dependence violates exchangeability and it is preferable to use predictors that leverage dependence by treating data asymmetrically. Recent work shows that split conformal prediction is robust to these issues, but sample splitting can reduce accuracy, motivating the study of methods that do not rely on data splitting in the time series setting. In this work, we show that the vanilla leave-one-out jackknife can suffer arbitrary loss of coverage even in canonical time series models with mild temporal dependence. As a remedy, we propose a modification tailored to such settings, which we term the leave-a-window-out (LWO) method, and show that it can achieve valid coverage provided that the model-fitting procedure satisfies mild stability properties. Our proofs are based on quantifying the degree to which the data departs from cyclic exchangeability, which we introduce new coefficients to measure. Experiments on time series demonstrate that our method often enjoys valid coverage when the vanilla jackknife fails to cover, while producing much narrower intervals than split conformal prediction.
Hanyang Jiang, Rina Foygel Barber, Ashwin Pananjady +1
Jun 22, 2026cs.LG

Dynamic estimation of slowly varying sequences

We consider the problem of sequentially approximating functions of each element in a slowly-varying sequence, i.e. one where the magnitude αiα_i of the difference between the elements at positions ii and i1i-1 is small. Recent work on implicit trace estimation shows that when αtα_t is small, reusing queries to past sequence elements can reduce the overall cost [Dharangutte & Musco, NeurIPS2021; Woodruff et al., NeurIPS2022]. We introduce a framework generalizing this to a variety of linear and nonlinear functions on diverse vector spaces, obtaining novel sequential estimation results for matrix powers, spectral densities, Monte Carlo integration, and a boundary value problem from partial differential equations~(PDEs). Furthermore, we develop a novel algorithm for use with this framework that locally scales the estimation budget with αtα_t, obtaining sharper path-length-style variation bounds of form O(i=1mαi)\mathcal O(\sum_{i=1}^mα_i) on the cost of estimating a sequence of length mm. This improves upon the previous implicit trace estimation bound of O(mmaxiαi)\mathcal O(m\cdot\max_iα_i) [Dharangutte & Musco, NeurIPS~2021], which is achieved by fixing the query budget using the worst-case αiα_i and is thus inefficient for stable sequences with rare bursts. Lastly, while all past work assumes a known bound on αiα_i, we show in certain cases how the changes can be estimated on-the-fly with (nearly) no added cost. In summary, our framework makes the sequential approximation toolkit general-purpose and adaptive while improving upon state-of-the-art-guarantees for dynamic trace estimation.
Prashant Gokhale, Mikhail Khodak, Sandeep Silwal