arXiv:2610.39540stat.MLOct 2026

Manuscript Offprint

arXiv:2610.39540

The Cost of Working Memory in Streaming Mean Estimation

Zeyu Wu, Zihao Wang, Minghua Deng

Abstract

A streaming estimator must compute from the evidence that fits in memory. We determine when storing an accurate mean is easier than computing it. For Gaussian mean estimation over the Euclidean unit ball in RdR^{d}, we establish the minimax rate under squared error with K persistent states, a known horizon, and a public time index:

min⁡{1, K−2/d+dn(1+log⁡(ed)1+(log⁡K)/d)}.\min\left\{1,\ K^{-2/d}+\frac{d}{n}\left(1+\frac{\log(ed)}{1+(\log K)/d}\right)\right\}.

Unrestricted computation followed by K-level encoding has rate min⁡{1,d/n+K−2/d}\min\{1, d/n + K^{-2/d}\}. At a fixed sufficiently small error, statistically optimal sample size therefore requires order dlog⁡dd \log d working bits, while order dd bits suffice to store the answer. The lower bound tracks repeated state compression through an entropy potential obtained by Gaussian smoothing. A matching construction combines a multiscale modular counter with workspace reused across coordinate groups. In one dimension, it attains the terminal rate n−1+K−2n^{-1} + K^{-2}. Any fixed confidence requirement that the realized loss not exceed the zero baseline preserves these rates. Increasing confidence creates a further memory requirement: at fixed nontrivial risk in every fixed dimension, failure probability e−γne^{-\gamma n} requires and permits order log⁡n\log n working states for sufficiently small fixed γ>0\gamma > 0. In the scalar problem, a fixed terminal alphabet suffices under the same protection. These bounds separate the memory needed to represent an answer from the memory needed to accumulate evidence and validate a decision.

Keywords: inference with finite memory; Gaussian location model; minimax risk; quantization; tradeoff between sample size and memory.

1 Introduction

Streaming estimation supports decisions from continuously arriving data, as in quantitative trading, where online algorithms update statistics of liquidity and volatility (Loveless et al., 2013). A related need to process long streams with bounded retained information arises in language model inference, where the attention cache must remain manageable as the sequence grows (Xiao et al., 2024). A streaming estimator must extract information before each observation is discarded. Its retained state is the evidence available for the next update, so a memory constraint can change statistical accuracy as well as storage cost. A running average appears to need just one vector, but this description counts real numbers rather than bits. With a finite bit budget, the same state must represent the current

∗^{*}Corresponding author.

estimate and retain enough evidence to improve it. The space needed for an accurate final answer may therefore understate the space needed to compute that answer.

We ask when answer storage suffices for statistically efficient computation. We study independent observations Xt∼Nd(μ,Id)X_t \sim N_d(\mu, I_d) with ∥μ∥≤1\|\mu\| \leq 1, a known sample size nn, and at most K=2bK = 2^b persistent states at each time. The index tt is public, allowing scheduled measurements without a stored clock. All information obtained from the data passes through the current state. Comparing this model with unrestricted computation followed by a KK-level encoding isolates the statistical cost of working memory.

The main result separates that cost from sampling and answer representation:

K−2/d⏟answerrepresentation+dn⏟sampling+d2log⁡(ed)n(d+log⁡K)⏟workingmemory,(1.1)\underbrace{K^{-2/d}}_{answer representation}+\underbrace{\frac{d}{n}}_{sampling}+\underbrace{\frac{d^{2}\log(ed)}{n(d+\log K)}}_{working memory}, \tag{1.1}

with the total truncated at a constant. The last term is necessary for randomized procedures with arbitrary joint states and transitions that vary with time. A deterministic construction attains the same rate. Thus the memory budget determines how efficiently the stream can be converted into an estimate, even when the final answer already fits in that budget.

At a fixed sufficiently small target risk, the difference is an order log⁡d\log d factor in bits: order dd bits represent an adequate answer, whereas achieving that risk with order dd samples requires order dlog⁡dd \log d working bits. Corollary 3.3 gives the precise relationship between sample size and memory. The separation also persists when accuracy improves with dimension: Corollary 3.4 gives sequences for which both risks vanish but their ratio diverges. Working memory is therefore a statistical resource beyond the precision of the output.

The matching bounds explain how this resource is used. In one dimension, a modular counter measures the mean at decreasing frequencies. Its counter shrinks as the estimate label grows, keeping their joint state space within budget and attaining n−1+K−2n^{-1} + K^{-2}. In higher dimensions, completed coordinate estimates are encoded jointly while the workspace is reused for the next group. The lower bound tracks the information lost at each state update through an entropy potential obtained by Gaussian smoothing. Its cumulative accounting yields the last term of (1.1) for arbitrary joint states, matching the workspace allocation in the construction.

Confidence introduces a second reason to retain working memory. We require the terminal estimate to have loss greater than that of zero with probability at most δ\delta, uniformly over the mean. Fixed δ\delta changes the rates only by constants. As δ\delta decreases, validating a candidate introduces an asymmetric testing problem with its own tradeoff between sample size and the number of states. At fixed nontrivial risk, failure probability e−γne^{-\gamma n} requires and permits order log⁡n\log n states, or log⁡2log⁡n+O(1)\log_2 \log n + O(1) bits, for sufficiently small fixed γ>0\gamma > 0. We establish this law first in one dimension and then extend it to every fixed dimension by reusing the validation workspace across coordinates. Sections 3–5 develop the estimation cost; Section 6 explains the additional cost of confidence.