Nearest-Neighbor Radii under Dependent Sampling

Yuanyuan Gao, Yilong Hou, Zhexiao LinNeurIPS 2026

TL;DR

Almost all classical theory about nearest-neighbor algorithms assumes your data points are independent—a luxury rarely afforded in a real world full of sequential time series and dynamic environments. This paper investigates what happens to the geometry of nearest-neighbor neighborhoods when data points depend on one another. Reassuringly, as long as that dependence fades fast enough over time, the fundamental scale of your local neighborhood stays exactly the same as in the independent case, governed by the data's true intrinsic dimension rather than its ambient space.

What Problem Does This Paper Address?

Whether you are running a classic $k$-nearest-neighbor ($k$-NN) classifier, estimating probability densities, or doing modern retrieval-augmented generation, one geometric quantity quietly runs the show: the $k$-NN radius. That’s simply the distance from a query point $x$ to its $k$-th closest neighbor in a sample of size $n$.

This radius controls the bias–variance tradeoff of local methods. Too big, and you average over distant, irrelevant points (high bias); too small, and you rely on too few effective observations (high variance). In an idealized world of independent and identically distributed (i.i.d.) data, we know this radius scales canonically as $(k/n)^{1/s}$, where $s$ is the local intrinsic dimension of the data.

But real-world data is messy—collected sequentially over time, across space, or by interacting with an environment. Once observations are dependent, standard probability tools (like binomial tail bounds for counting points in a ball) break down. Prior work has analyzed specific estimators built on dependent data, leaving a foundational geometric question unanswered: Does dependence fundamentally warp the scale of nearest-neighbor neighborhoods?

Methods

Instead of studying a specific downstream algorithm, the authors zoom in on the $k$-NN radius itself as the primary mathematical object.

  • Triangular-Array Strong Mixing: They model dependent observations using a general "triangular array" where points share a marginal distribution $\mu$, and dependence decays with the index gap between observations ($\alpha$-mixing, where two chunks of data separated by $m$ steps become nearly independent as $m$ grows). This generalizes standard stationary time series.
  • Inverting Dependent Counts: In the i.i.d. world, bounding the radius means counting how many independent points land inside a ball $B(x, r)$ using binomial distributions. Under geometric $\alpha$-mixing (exponentially fast correlation decay), those counts are coupled. The authors apply blocking arguments—chopping the dependent sequence into blocks of length $\asymp \log n$ so non-adjacent blocks act nearly independent—to establish sharp non-asymptotic tail bounds, which they then integrate to get exact moment bounds.
  • Intrinsic Local Mass: Rather than tying their math to the ambient dimension $d$, they characterize the probability mass near $x$ as growing like $r^s$ ($\mu(B(x,r)) \asymp r^s$). This naturally adapts the proofs to high-dimensional data living on lower-dimensional manifolds.

Datasets

The authors test their theory on both synthetic generators and real-world time-series benchmarks (no new datasets are introduced):

  • Synthetic Models: 1) Linear Gaussian state-space models, 2) Hidden Markov models, and 3) FFT-generated stationary Gaussian processes (RBF-like kernel) for moment scaling; plus a latent $s$-dimensional Gaussian AR(1) process linearly embedded into $\mathbb{R}^{20}$ for entropy estimation.
  • Real-World Benchmarks: Taken from the Time Series Pile, spanning the Informer datasets (long-horizon forecasting like Weather, Electricity, Traffic, ETT), the Monash Time Series Forecasting Archive (M3 and M4 short-horizon forecasting), and the UCR Time Series Archive (classification).

Key Insights and Ideas

  • Geometry and dependence play completely separate roles: Local geometry (the intrinsic exponent $s$) dictates the fundamental scaling rate $(k/n)^{1/s}$. Dependence does not alter this exponent; it only degrades constants and adds a $\log n$ concentration penalty in the tail exponent—the mathematical "tax" paid for blocking dependent data.
  • Consistency requires almost nothing: Even under relatively slow, polynomial $\alpha$-mixing, as long as $k/n \to 0$, the $k$-NN radius converges almost surely to the distance from $x$ to the support of the distribution. No density or smoothness assumptions required.
  • Intrinsic dimension beats the curse of ambient dimension: If 20-dimensional time-series data actually lives on a 3-dimensional subspace, the $k$-NN radius scales according to $s=3$, not $d=20$, even under temporal dependence.
  • Lower bounds are completely immune to dependence: Proving that the $k$-NN radius cannot shrink faster than $(k/n)^{1/s}$ requires only an upper limit on local probability mass—no mixing or independence assumptions whatsoever!

Key Results

  • Theoretical Bounds: Under geometric mixing and $k \gtrsim \log n$, the $p$-th moment of the $k$-NN radius satisfies the exact-order characterization $\mathbb{E}[R_{n,k}(x)^p] \asymp (k/n)^{p/s}$.
  • Synthetic Moment Rates: Across dimensions $d \in \{1, 3, 5\}$, weak dependence closely tracks the theoretical slope $p/d$ and the i.i.d. baseline. Strong dependence diverges in finite samples simply because the effective sample size collapses (e.g., at $n = 6400$, strong dependence had $n_{\text{eff}} \le 90$, whereas runs with $n_{\text{eff}} \gtrsim 2500$ matched i.i.d. slopes).
Figure 1: Slope summary for Experiment 1: rows correspond to d = 1, 3, 5, columns correspond to the three dependent model classes, and the shared legend compares the theoretical line p/d, the i.i.d. benchmark, and weak/medium/strong dependence.
  • Entropy & Intrinsic Dimension: Using a Kozachenko–Leonenko entropy estimator on 20D data with intrinsic dimension $s \in \{1, 3, 5\}$, both an oracle estimator and a PCA-projected estimator converge toward the true analytical entropy as $n$ grows across i.i.d., weak ($\rho=0.3$), and strong ($\rho=0.6$) AR(1) dependence.
Figure 2: Experiment 2 entropy estimation. The dotted horizontal line is the true entropy. Colors encode the dependence level and markers distinguish the oracle intrinsic estimate from the PCA estimate.
  • Real-Data Time Series: Simple Raw-kNN and PCA-kNN baselines remain surprisingly competitive against MOMENT (a pre-trained time-series transformer family). On long-horizon forecasting, Raw-kNN (0.628 MSE) and PCA-kNN (0.627 MSE) sit right behind MOMENT (0.617 MSE). On UCR classification, both achieve 0.748 mean accuracy vs. MOMENT's 0.794. Projecting inputs via PCA preserves neighborhood predictive power.

Limitations and Future Work

  • Fixed vs. Uniform Queries: The main theorems hold for a fixed query point $x$. Extending this to uniform convergence over an entire query set introduces covering-number penalties, and handling sample-dependent queries requires a broader uniform theory left for future work.
  • Learned Representations: While fixed bi-Lipschitz encoders preserve mixing rates and local mass exponents, these theoretical guarantees do not automatically carry over to encoders (like PCA or neural nets) trained on the same dependent sample.
  • Mixing Obstructions & Thresholds: Because indicator functions for Euclidean balls have sharp, discontinuous boundaries, the proofs do not directly extend to $\mathcal{C}$-mixing (which relies on smooth functions like Lipschitz classes). Also, while the blocking proof requires $k \gtrsim \log n$, the authors leave open whether this threshold is strictly necessary.

Summary updated

BibTeX
@inproceedings{gao2026nearest,
  author = {Yuanyuan Gao and Yilong Hou and Zhexiao Lin},
  title = {{Nearest-Neighbor Radii under Dependent Sampling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=e6OkacBDBI},
}

Loading related content...

Figure