GAAVI: Global Asymptotic Anytime Valid Inference for the Conditional Mean Function Brian M Cho, Raaz Dwivedi, Nathan Kallus Abstract Inference on the conditional mean function (CMF) is central to tasks from adaptive experimentation to optimal treatment assignment and algorithmic fairness auditing. In this work, we provide a novel asymptotic anytime-valid test for a CMF global null (e.g., that all conditional means are zero) and contrasts between CMFs, enabling experimenters to make high confidence decisions at any time during the experiment beyond a minimum sample size. We provide mild conditions under which our tests achieve (i) asymptotic type-I error guarantees, (i) power one, and, unlike past tests, (iii) optimal sample complexity relative to a Gaussian location testing. By inverting our tests, we show how to construct function-valued asymptotic confidence sequences for the CMF and contrasts thereof. Experiments on both synthetic and real-world data show our method is well-powered across various distributions while preserving the nominal error rate under continuous monitoring. 1 Introduction Inference on the conditional mean function (CMF) is central to decision making in a wide range of modern applications, including public health ( Segal et al. 2023 ; Bellavia & Murphy 2024 ) , algorithmic monitoring ( Chugg et al. 2025a ) , and online platforms ( Johari et al. 2019 ) . In algorithmic audit applications, inference on conditional regression/classification outputs across sensitive attributes enables tests for fairness metrics such as statistical parity ( Dwork et al. 2011 ) . In randomized controlled trials, the conditional average treatment effect (CATE) plays a central role in assessing treatment effect heterogeneity ( Künzel et al. 2019 ) and learning optimal policies ( Athey & Wager 2020 ) . As online data collection and continuous monitoring become increasingly common ( Johari et al. 2019 ) , there is a growing need for sequential tests that provide online, flexible inference on CMFs for timely, high-confidence decision-making. In many settings, the ability to conduct inference on the CMF during the data collection process is particularly valuable ( Chugg et al. 2025a ; Adam et al. 2023 ) . For example, fairness constraints may require practitioners to halt deployment if a model’s output differs across sensitive attributes ( Chugg et al. 2025a ) . With sequential tests, practitioners can identify such disparities with high confidence as observations accumulate and halt deployment accordingly. Similarly, in clinical trials, sequential inference on the CATE can be critical for patient safety. For drugs such as warfarin, a positive average treatment effect may mask adverse effects for subgroups, such as elderly patients ( Shendre et al. 2018 ) . The ability to test the CATE function sequentially allows for early stopping, mitigating potential harm to negatively affected groups with high confidence. Despite its practical importance, existing works on CMF testing largely focus on (i) offline settings ( Liu et al. 2023 ; Arias-Castro et al. 2011 ) , where inference is conducted at a fixed sample size, and/or (ii) finite context sets, where the CMF is restricted to being a vector/matrix ( Howard et al. 2021 ; Cho et al. 2024a ) . In contrast, relatively little attention has been paid to sequential inference on the CMF in settings for more general, potentially finite conditioning sets, limiting the applicability of current methods. Without discretizations of the context/covariate space ( Ghosh et al. 2022 ) or parametric model projections ( Lindon et al. 2025 ) , existing methods fail to provide high-confidence conclusions for testing the CMF during data collection when covariates/contexts are continuous or high-dimensional. Contributions. We construct nonparametric asymptotic anytime-valid tests for the CMF/CATE under a general covariates/context space. Our tests are designed for the global null , which assesses whether the CMF/CATE is equal to a prespecified conditional mean function of interest. Building upon the asymptotic anytime validity framework, our tests use a novel weighted martingale that leverages flexible regression methods to maximize power against the specified global null. Using our tests, we also construct function-valued asymptotic confidence sequences for the CMF/CATE. Importantly, our tests are provably robust, achieving (i) asymptotic anytime valid error control even if no nuisances/regressors used in our test converge, (ii) power one under a mild positive covariance condition, (iii) and asymptotically optimal sample complexities when nuisances converge to the desired quantities. For global null testing, under suitable regularity, our results show nonparametric sequential testing with asymptotic error guarantees is no harder than non-asymptotic sequential testing for conditional Gaussian models with known variance. Our experiments show our method is well-powered across a variety of data generating processes relative to existing methods, while preserving error guarantees. Outline. The paper is organized as follows. In the remainder of this section, we briefly cover related works. In Section 2 , we formalize our problem for CMF and CATE testing, focusing on the global null hypothesis. In Section 3 , we introduce our approach for testing the global null and demonstrate how to leverage these tests for confidence sequences on the CMF/CATE. In Section 4 , we provide conditions under which our tests maintain error guarantees, obtain power one, and achieve optimal sample complexities. In Section 5 , we test our method against related approaches, empirically demonstrating robust detection power while maintaining error rates. We present our conclusions in Section 6 . 1.1 Related Works We provide a brief overview of related work, focusing on (i) asymptotic anytime validity and (ii) global null testing. Asymptotic Anytime Valid Inference. Recent years have seen the rise of anytime valid (AV) testing methods ( Ramdas et al. 2023 ; Ramdas & Wang 2025 ) . Our work most closely builds upon the line of work called asymptotic anytime-valid inference ( Bibaut et al. 2024 ; Waudby-Smith et al. 2024 ; Kilian et al. 2025 ; Cho & Kallus 2025 ) , which leverages strong invariance principles to obtain approximate time-uniform error control. Instead exact time-uniform control, asymptotic AV inference provide approximate error control over all times beyond a sufficiently large minimum sample size (i.e. burn-in time). While our work leverages similar tools to ensure asymptotic anytime validity, the focus of our work differs from the goals of existing work. Many asymptotic AV methods ( Bibaut et al. 2024 ; Waudby-Smith et al. 2024 ; Kilian et al. 2025 ) focus on point null tests for a univariate mean parameter, rather than for the entire conditional mean functions, and use their tests to form asymptotic confidence sequences for the mean of interest. The closest work to our testing procedure is Cho & Kallus 2025 , where the authors construct asymptotic AV tests identifying the highest mean treatment as opposed to inference on a scalar parameter. In contrast, our tests provide asymptotic AV error control for the global null and related hypotheses. Global Null Testing. Global null testing has a rich history in statistics, focusing on assessing whether conditional means are identically zero (or equal to a known function) across the entire context space ( Fisher 1932 ; Ingster 1989 ; Ingster & Suslina 2003 ) . Classical approaches for testing the global null in linear models include F -tests/ANOVA ( Fisher 1932 ) , higher criticism methods ( Donoho & Jin 2004 ) , and max tests based on multiple testing corrections ( Arias-Castro et al. 2011 ) . Beyond linear models, works such as Ingster & Sapatinas 2009 provide tests under more flexible, nonlinear regression setups. Our work is most connected to tests which combine information into a single test statistic ( Fisher 1932 ) , rather than multiple testing corrections ( Donoho & Jin 2004 ) . However, existing methods typically assume parametric assumptions (e.g. Gaussian error), require sample sizes to be fixed in advance, and do not provide guarantees under continuous monitoring. In contrast, our tests are fully nonparametric, do not require fixed sample sizes, and provide approximate guarantees under continuous monitoring for sufficiently large sample sizes. Anytime Valid Testing for the Global Null. While sequential global null tests with AV guarantees exist, they fail to accommodate fully nonparametric inference under general context spaces or differ substantially in aim. Works such as Chugg et al. 2025b ; Howard et al. 2021 enable nonparametric AV inference for finite context spaces, where martingale methods can be directly applied. While Lindon et al. 2025 provides AV inference for continuous, multivariate contexts, these methods focus on testing linear regression coefficients, reducing the problem to a finite dimensional setting and only providing inference on the best linear projection of the CMF/CATE. Lastly, while the work of Duan et al. 2021 also study sequential inference on the global null, they provide non-asymptotic AV inference under the generic setting where hypotheses arrive sequentially. In contrast to existing work, our work specifically focuses on the CMF/CATE, provides asymptotic AV error guarantees, allows for continuous/high dimensional contexts without parametric projections, and establishes conditions for achieving asymptotically optimal sample complexities. 2 Problem Setup and Preliminaries In our work, we assume that observations (O_{i})_{i\in\mathbb{N}} arrive sequentially, where O_{i} are i.i.d. observations from an unknown distribution P . To accommodate our examples, we provide two distinct data generating processes (DGPs) corresponding to (i) generic CMF testing, denoted as DGP1 and (ii) CMF contrast testing in online experiments with binary treatments, which we denote as CATE testing (DGP2). DGP1. We assume O_{i}=(X_{i},Y_{i}) and P=P_{X}\times P_{Y|X} , where X_{i}\in\mathcal{X} denotes the context (i.e. the conditioning variable) and Y_{i}\in\mathbb{R} denotes the outcome of interest. Our object of interest is the CMF \tau(x)=\mathbb{E}_{P_{Y|X}}[Y|X=x] . DGP2. We assume O_{i}=(X_{i},A_{i},Y_{i}) and P=P_{X}\times P_{A|X}\times P_{Y|A,X} . For each observation, the context X_{i}\in\mathcal{X} is generated i.i.d. from an unknown distribution P_{X} . After observing the context X_{i} , the experimenter assigns a binary treatment A_{i}\in\{0,1\} , where A_{i} is sampled according to a known policy \pi(X_{i},a)=P(A_{i}=a|X=X_{i}) , corresponding to a randomized experiment. The outcome of interest Y_{i}\in\mathbb{R} is then generated according to an unknown conditional distribution P_{Y|X,A} . We note that knowledge of the sampling policy \pi is a standard assumption in online experiments ( Cho et al. 2025 ; Adam et al. 2023 ) , and for simplicity, we assume that \pi is fixed over time. We denote the CATE function, our object of interest, as \tau(x)=\mu(x,1)-\mu(x,0) , where \mu(x,a)=\mathbb{E}_{P_{Y|A,X}}\left[Y|A=a,X=x\right] . 1 1 1 To enable valid causal interpretations under the Neyman-Rubin potential outcomes model, we require additional conditions such as consistency and SUTVA. Because our work is primarily focused on global null tests, we refer readers to Appendix B for more detailed discussion. For both DGPs, we define the conditional variance function \sigma^{2}(z)=\mathbb{E}_{P}\left[\left(Y-\mathbb{E}_{P}[Y|Z=z]\right)^{2}|Z=z\right], (1) where Z\coloneqq X and Z\coloneqq(X,A) for DGP1 and DGP2 respectively. As shorthand, we denote all observations up to time t as H_{t}=(O_{i})_{i\in[t]} , where [t]=\{1,\dots t\} . We use \mathcal{F}_{t}=\sigma(H_{t}) to denote the canonical filtration, with \mathcal{F}_{0} as the trivial, empty sigma field. We denote the set of functions L_{\infty}(B) as the set of all bounded functions f:\mathcal{X}\rightarrow[-B,B] . We make the following assumptions on both DGPs regarding variances and outcomes. Assumption 2.1 (Positive Conditional Variances) . There exists b>0 such that variances \sigma^{2}(z)\geq b for all z\in\mathcal{Z} . Assumption 2.1 ensures that our sample complexity bounds scale with our type I error tolerance and avoids degeneracy issues. Note that Assumption 2.1 also implies that marginal outcome variances are nonzero. We also assume that the outcome Y is bounded, formalized in Assumption 2.2 . Assumption 2.2 (Bounded Outcomes) . There exists a (potentially unknown) constant B such that |Y|\leq B . In most common applications, Assumption 2.2 is likely to hold, even if the maximum magnitude of the outcome variable is unknown. In contrast with nonasymptotic AV methods ( Chugg et al. 2025b ) , which require outcome bounds B (or moment bounds) to be known in advance, our tests do not require this constant B to be known or estimated. For DGP2, we also assume that the following holds. Assumption 2.3 (Strict Positivity) . There exists \kappa<\infty such that \pi(a,x)\geq 1/\kappa for all a\in\{0,1\} and x\in\mathcal{X} . Similar to the outcome bound B , the inverse propensity score upper bound \kappa does not need to be known apriori to data collection. Other than the assumptions provided above, we make no further assumptions on the DGP, allowing for highly nonparametric, complex outcome distributions. 2.1 Problem Statement The goal of our work is to construct asymptotic anytime-valid tests regarding CMF/CATE function \tau . To begin, we first define asymptotic anytime validity in Definition 2.4 . Definition 2.4 (Asymptotic Anytime Validity) . Let \mathcal{H}_{0} be a collection of distributions P , and let \xi:H_{\infty}\times(0,1)\rightarrow\{0,1\} be a mapping from the observed data stream and nominal error level to a binary output. Then, the function \xi:H_{\infty}\times(0,1)\rightarrow\{0,1\} is an \alpha -level asymptotic anytime-valid test for the null hypothesis \mathcal{H}_{0} if \forall P\in\mathcal{H}_{0} , \limsup_{t_{0}\rightarrow\infty}P\left(\exists t\geq t_{0}:\xi(H_{t},\alpha)=1\right)\leq\alpha. (2) Our definition ensures that error rate is approximately controlled uniformly over times t\geq t_{0} , where t_{0} denotes a burn-in time that specifies the minimum sample size before rejection. Tests satisfying Definition 2.4 enable real-time decision making: rejecting the null at any time t\geq t_{0} implies that, for sufficiently large t_{0} , the null is false with probability at least 1-\alpha , allowing experimenters to draw high-confidence conclusions throughout the experiment. In this work, we focus on constructing tests that satisfy Definition 2.4 for the global null hypothesis \mathcal{H}(f):\tau(x)=f(x) , which tests equivalence of \tau to a known function f . Below, we provide practical examples corresponding to the global null across various applications. Examples for DGP1. Let X\in[0,1] be predictive probabilities from a pretrained model \nu for a binary outcome Y\in\{0,1\} . The null hypothesis \mathcal{H}(x):\tau(x)=x corresponds to the hypothesis that model \nu is calibrated ( Dawid 1982 ; Guo et al. 2017 ) , i.e. the predicted probabilities from \nu match the expected frequency (w.r.t P ). Rejection of the null implies that the model \nu is not P -calibrated. Examples for DGP2. When \tau is the CATE, \mathcal{H}(0):\tau(x)=0 corresponds to the null that no X -defined subgroups have a treatment effect, matching the classical global null hypothesis setup ( Arias-Castro et al. 2011 ) . Rejection of the null implies there exists at least one subgroup with a treatment effect. In the setting of algorithmic fairness, where Y\in\{0,1\} is an algorithmic recommendation, A\in\{0,1\} denotes a sensitive attribute (with known conditional population prevalence), and X denotes factors of interest, \mathcal{H}(0) corresponds to the fairness notion of conditional statistical parity ( Dwork et al. 2011 ; Kamiran et al. 2013 ) . 3 Testing the Conditional Mean Function For both DGPs, we build sequential tests for the null \mathcal{H}(f) by constructing (\mathcal{F}_{t})_{t\in\mathbb{N}} -adapted martingales with zero mean increments under the null. We do so with the terms \phi^{CMF}_{i}=Y_{i},\quad\phi^{CATE}_{i}=\phi_{i,1}-\phi_{i,0}, (3) where \phi_{i,a}=g_{i}(X_{i},a)+\frac{\mathbf{1}[A_{i}=a](Y_{i}-g_{i}(X_{i},a))}{\pi(X_{i},a)} and g_{i} is an \mathcal{F}_{i-1} -measurable estimate of conditional means \mu(x,a) in DGP2. The terms \phi_{i}^{CMF} and \phi_{i}^{CATE} act as conditionally unbiased terms for point evaluations of the CMF/CATE respectively, i.e. \mathbb{E}_{P}\left[\phi_{i}|X_{i}=x,\mathcal{F}_{i-1}\right]=\tau(x) for their respective functions of interest. To ease exposition, we drop the superscripts on \phi_{i} to refer to either DGP1 and DGP2, and provide a unified exposition for constructing our test. Leveraging the conditional unbiased property, we construct the process \psi_{t}(f) by taking weighted sums of the difference between \phi_{i} and the null CMF/CATE function f , \psi_{t}(f)=\sum_{i=1}^{t}w_{i}(X_{i},f)\left(\phi_{i}-f(X_{i})\right), (4) where w_{i}(x,f) is an \mathcal{F}_{i-1} -measurable weight function. As shorthand, we denote \bar{\psi}_{t}(f)=\psi_{t}(f)/t as the time-normalized process. Note that by the conditional unbiased property, for any distribution P\in\mathcal{H}(f) , each term w_{i}(X_{i},f)\left(\phi_{i}-f(X_{i})\right) in our running sum \psi_{t} has zero conditional mean for any choice of weights w_{i} , ensuring that the process \psi_{t} is a martingale w.r.t. (\mathcal{F}_{t})_{t\in\mathbb{N}} and P\in\mathcal{H}(f) . We leverage the fact that process \psi_{t} has zero conditional mean for any P\in\mathcal{H}(f) to reject the null. To obtain the desired error control in Definition 2.4 , we construct asymptotic AV bounds L_{t}(f) for the average conditional mean of the increments of process \psi_{t} . Similar to other asymptotic AV approaches ( Bibaut et al. 2024 ; Waudby-Smith et al. 2024 ; Cho & Kallus 2025 ) , we leverage bounds based on the Gaussian mixture martingale, which includes (i) parameter \rho>0 , corresponding to a prespecified time t^{*} where L_{t}(f) is tightest 2 2 2 We provide standard choices of \rho>0 in Appendix B.3 . , and (ii) variance term \hat{V}_{t}(f) , which aims to estimate the average conditional variance of the martingale difference terms w_{i}(X_{i},f)\left(\phi_{i}-f(X_{i})\right) in our process \psi_{t} : \displaystyle L_{t}(f,\alpha,\rho)=\bar{\psi}_{t}-\ell_{t,\alpha\rho}\left(\hat{V}_{t}(f)\right), (5) \displaystyle\ell_{t,\alpha,\rho}(x)=\sqrt{\frac{2(tx\rho^{2}+1)}{t^{2}\rho^{2}}\log\left(1+\frac{\sqrt{tx\rho^{2}+1}}{2\alpha}\right)}. (6) Beyond sufficiently large burn-in times t_{0} , the lower bound sequence \left(L_{t}(f,\alpha,\rho)\right)_{t\in\mathbb{N}} serves as a time uniform 1-\alpha lower bound for the average conditional means of terms w_{i}(X_{i},f)\left(\phi_{i}-f(X_{i})\right) . If L_{t} crosses above zero at any time t\geq t_{0} , the asymptotic anytime valid guarantees of L_{t} ensure the cumulative average drift of \psi_{t}(f) is positive and nonzero with probability at least 1-\alpha . Because the drift of \psi_{t}(f) is strictly zero when P\in\mathcal{H}(f) , the probability that the lower bound L_{t}(f,\alpha,\rho) rises above zero beyond sufficiently large t_{0} for any P\in\mathcal{H}(f) is less than \alpha . Thus, our sequential test \xi_{t}(f,\alpha,\rho,t_{0}) is simply \xi_{t}(f,\alpha,\rho,t_{0})=\mathbf{1}\left[\max_{t_{0}\leq i\leq t}\ L_{i}(f,\rho,\alpha)>0\right], (7) i.e. reject the null \mathcal{H}(f):\tau(x)=f(x) as soon as the lower bound process L_{t}(f,\rho,\alpha) crosses above zero for t\geq t_{0} . In Figure 1 , we visualize our testing procedure for clarity. Figure 1 : Visualization of our method for one instance with t_{0}=200 (grey region). The red dotted line indicates time of rejection. 3.1 Predictable Weights for GAAVI Our choice to track lower bounds, rather than a two-sided confidence sequence for the average conditional drift of \psi_{t}(f) , follows from our predictable weight function w_{i} . The predictable weights w_{i} take the form \displaystyle w_{i}(X_{i},f)=\text{sgn}(\tilde{w}_{i} \displaystyle(X_{i},f))\max\left\{\epsilon_{i},|\tilde{w}_{i}(X_{i},f)|\right\}, (8) \displaystyle\tilde{w}_{i}(X_{i},f) \displaystyle=\frac{\hat{\tau}_{i}(X_{i})-f(X_{i})}{\hat{v}_{i}(X_{i})}, (9) where \hat{\tau}_{i}(x) and \hat{v}_{i}(x) denote \mathcal{F}_{i-1} -measurable estimates of our function of interest \tau and the X -conditional variance of the terms \phi_{i} respectively. The weight function \tilde{w}_{i} corresponds to the difference between \hat{\tau}_{i}(x) , an estimate of \tau(x) with data H_{i-1} , and f(x) , the value of \tau(x) under our null, divided by an estimate of conditional variances {v}_{i}(x)=\mathbb{E}_{P}\left[(\phi_{i}-\tau(x))^{2}|X=x,\mathcal{F}_{i-1}\right] . The weight function w_{i} then thresholds the magnitude of \tilde{w_{i}} , ensuring that the weight magnitudes remain larger than \epsilon_{i} . Our weights directly correspond to our choice to only track the lower bound on the average drift of \psi_{t}(f) . Consider an oracle version of our weight \hat{w}_{i} with \hat{\tau}_{i}(X_{i})=\tau(X_{i}) in the numerator, \hat{v}_{i}(X_{i})=v_{i}(X_{i}) in the denominator, and \epsilon_{i}=0 . Then, the conditional drift \mathbb{E}\left[\psi_{i}(f)-\psi_{i-1}(f)|\mathcal{F}_{i-1}\right] with our oracle weights has nonnegative drift at time i , i.e. \mathbb{E}_{P_{X}}\left[\frac{(\tau(X)-f(X))^{2}}{v_{i}(X)}\big|\mathcal{F}_{i-1}\right]\geq 0. (10) If there exists some \hat{\mathcal{X}}\subseteq\mathcal{X} with positive measure (w.r.t. P_{X} ) where \tau(x) and f(x) differ, then the conditional drift is strictly positive. Thus, our weight scheme aims to add nonnegative drift to \psi_{t}(f) when the null is false, corresponding to our choice to construct lower bounds for our test \xi_{t} . Remark 3.1 (On Thresholds and Variance Weighing) . While the numerator of w_{i}(X_{i},f) justifies our choice to track lower bounds, our weights also involve (i) an inverse estimated variance term \hat{v}_{i}^{-1} and (ii) magnitude thresholds. The former corresponds to our optimal sample complexity results in Theorem 4 , Section 4 . The latter corresponds to a technical condition that ensures cumulative variances diverge, enabling Gaussian asymptotic approximation. We provide guidance on the choice of our weight magnitude bounds \epsilon_{i} in Theorem 4.2 , Section 4 . 3.2 Variance Estimation for Sequential Testing In the design of our test, we leverage two distinct variance estimates: (i) the term \hat{V}_{i}(f) , which estimates the average conditional variance of the martingale difference terms w_{i}(X_{i},f)(\phi_{i}-f(X_{i})) , and (ii) the \mathcal{F}_{i-1} -measurable variance function \hat{v}_{i}(X) used for our predictable weights w_{i} . To estimate these quantities, we use empirical counterparts that center terms \phi_{i} using an estimated function \hat{\tau}_{i} , rather than centering using the null f . For the average conditional variance terms \hat{V}_{t}(f) , we estimate this quantity with \hat{V}_{t}(f)=\frac{1}{t}\sum_{i=1}^{t}w_{i}^{2}(X_{i},f)r_{i}^{2},\quad r_{i}=(\phi_{i}-\hat{\tau}_{i}(X_{i})). (11) Our running estimate \hat{V}_{t}(f) is simply the squared sum of terms \phi_{i} centered with an \mathcal{F}_{i-1} -measurable estimate \hat{\tau}_{i} of function \tau . Similarly, to obtain our \mathcal{F}_{i-1} -measurable estimator \hat{v}_{i} , we construct the function \tilde{v}_{i}(x) by regressing the squared estimated residual terms \{r_{j}^{2}\}_{j0 is a small constant that bounds estimated conditional variances \hat{v}_{i} away from zero. Table 1 : Parameters/Nuisances for \xi_{t} and their roles. Variable Role \alpha\in(0,1) error tolerance \rho\in\mathbb{R}_{++} tightening parameter for L_{t} at t^{*} t_{0}\in\mathbb{N} minimum sample size / burn-in time g_{t}:(\mathcal{X},\{0,1\})\rightarrow\mathbb{R} \mathcal{F}_{t-1} -measurable regression function for estimating \mu(x,a) in DGP2 \hat{\tau}_{t}:\mathcal{X}\rightarrow\mathbb{R} \mathcal{F}_{t-1} -measurable regression function for estimating CMF/CATE \tau \hat{v}_{t}:\mathcal{X}\rightarrow\mathbb{R} \mathcal{F}_{t-1} -measurable regression function for estimating conditional variance \mathbb{E}[(\phi-\tau(x))^{2}|X=x] \epsilon_{t}\in\mathbb{R}_{++} magnitude bound for sequential weights w_{t}(X_{t},f) in Equation ( 8 ) l\in\mathbb{R}_{++} lower bound on variance function \hat{v}_{t} Remark 3.2 (Comparisons with Sample Variance) . Standard methods that leverage asymptotic AV lower bounds ( Bibaut et al. 2024 ; Cho & Kallus 2025 ) use the sample variance of the martingale difference terms to construct \hat{V}_{t}(f) . In our work, the choice of \hat{V}_{t}(f) differs due to the fact that we wish to estimate the variance as if the null were true , even if P\not\in\mathcal{H}(f) . While the sample variance converges to variance under the null when P\in\mathcal{H}(f) , the limit of sample variance is larger than the variance under the null when P\not\in\mathcal{H}(f) by the factor \mathbb{E}[(\tau(x)-f(x))^{2}] , the average squared difference between \tau and f . By centering the \phi_{i} terms with running estimates of \tau , \hat{V}_{t}(f) converges to the desired variance under the null if \hat{\tau}_{i} converges to \tau , and provides a conservative (i.e. larger) estimate otherwise. To enumerate the necessary parameters and conditional regression functions (i.e. nuisances) used for our test \xi_{t} , we provide Table 1 , which specifies parameter values, nuisance mappings, and their role in our testing procedure \xi_{t} . 3.3 Generalization to Confidence Sequences Using the tests for the null \mathcal{H}(f) , we construct asymptotic confidence sequences for the CMF/CATE function. Our sequences C_{t}(\rho,\alpha,t_{0}) are simply inversions of our tests \xi_{t} , C_{t}(\rho,\alpha,t_{0})=\{f\in L_{\infty}(B):\xi_{t}(f,\alpha,\rho,t_{0})=0\}, (13) where C_{t}(\rho,\alpha,t_{0}) is the set of bounded functions f\in L_{\infty}(B) that have not yet rejected by time t by \xi_{t} . When \mathcal{X} is finite and bounds B are known, C_{t}(\rho,\alpha,t_{0}) can be constructed by explicitly sweeping over the hypothesis space L_{\infty}(B) . However, when \mathcal{X} is continuous or high-dimensional, explicitly tracking confidence sequences is generally infeasible or computationally prohibitive. In such settings, rather than forming confidence sequences, our tests most naturally apply to pre-specified candidate CMF/CATEs or tracking whether C_{t} intersects with nulls of interest, such as \tau(x)=c for some constant c . The latter example can be efficiently implemented with univariate function minimizers readily available in standard software, such as Brent 1973 . Remark 3.3 (Choice of Regression Functions) . Our testing procedure involves multiple sequential regressors/nuisances. For both DGP1 and DGP2, we require leverage \mathcal{F}_{t-1} -measurable regressors \hat{\tau}_{t} and \hat{v}_{t} that aim to estimate conditional means \tau(X_{i})=\mathbb{E}[\phi_{i}|X=X_{i}] and variances v(X_{i})=\mathbb{E}[\left(\phi_{i}-\tau(X_{i})\right)^{2}|X=X_{i},\mathcal{F}_{i-1}] respectively. For DGP2, we require \mathcal{F}_{t-1} -measurable regression functions \hat{g}_{t} that aims to estimate conditional means \mu(X_{i},a)=\mathbb{E}[Y|X=X_{i},A=a] in order to construct \phi_{i} . Our test accommodates a broad class of sequential regression estimators for estimating \hat{\tau}_{t} , \hat{v}_{t} , and g_{t} , including flexible nonparametric methods such as k -NN ( Yang & Zhu 2002 ) , kernel methods ( Qian & Yang 2016 ) , random forests ( Wager & Athey 2018 ) , and neural networks ( Schmidt-Hieber 2020 ) . Simpler parametric approaches such as linear/logistic regression may also be used. In Section 4 , we provide sufficient conditions on our regression functions for error control, power one, and optimal sample complexity. 4 Theoretical Guarantees We provide sufficient conditions under which our tests \xi_{t} achieve (i) asymptotic AV error control (as in Definition 2.4 ), (ii) power one, and (iii) optimal sample complexities relative to a Gaussian shift model. We first introduce mild regularity condition regarding the boundedness of our sequential regressors sufficient for type I error control. Assumption 4.1 (Boundedness of Nuisances) . For all t\in\mathbb{N} , x\in\mathcal{X} , and a\in\{0,1\} , there exists some constant B<\infty such that |\hat{\tau}_{t}(x)|\leq B , |g_{t}(x,a)|\leq B , and \hat{v}_{t}(x)\leq B^{2} . Assumption 4.1 naturally follows from our bounded outcome assumption in Assumption 2.2 . Similar to the role of the bounds in Assumption 2.2 , we note that this constant B does not need to be known or estimated, and only plays a role in our theoretical guarantees. Under the boundedness conditions of Assumption 4.1 , our tests \xi_{t} provide asymptotic AV error guarantees for their respective nulls. Theorem 4.2 (Asymptotic Anytime Validity of \xi_{t} ) . Let Assumptions 2.1 - 2.3 and 4.1 hold. Then, for fixed error tolerance \alpha\in(0,1) , \rho>0 , conditional variance threshold l>0 (as defined in Equation ( 12 )), and weight bounds \epsilon_{t}=\Omega(t^{-\gamma}) for \gamma\in[0,1/4) (as defined in Equation ( 8 )), \lim_{t_{0}\rightarrow\infty}P\left(\exists t\geq t_{0}:\xi_{t}(f,\alpha,\rho,t_{0})=1\right)\leq\alpha (14) for all distributions P\in\mathcal{H}(f) and f\in L_{\infty}(B) . Likewise, under the same conditions on parameters \alpha , \rho , l , and \epsilon_{t} , \lim_{t_{0}\rightarrow\infty}P\left(\exists t\geq t_{0}:\tau\not\in C_{t}(\rho,\alpha,t_{0})\right)\leq\alpha, (15) where C_{t}(\rho,\alpha,t_{0}) is as defined in Equation ( 13 ). Theorem 4.2 establishes that our tests \xi_{t} satisfy the asymptotic AV error guarantee in Definition 2.4 under mild boundedness assumptions (Assumptions 2.1 – 2.3 and 4.1 ) and the condition that the weight bounds \epsilon_{t} decay at rate \Omega(t^{-1/4}) . In particular, the constraints on variance bound sequence (\epsilon_{t})_{t\in\mathbb{N}} ensure our process \psi_{t} is (i) well approximated by a scaled Wiener process ( Strassen 1964 ) , allowing the Gaussian mixture martingale L_{t} to provide asymptotic guarantees, and (ii) polynomial rates of estimation for the running variance \hat{V}_{t} , which ensures our bounds protect the error rate. Notably, the results of Theorem 4.2 do not require convergence of sequential regressors \hat{\tau}_{t} , \hat{g}_{t} , or \hat{v}_{t} , demonstrating that \xi_{t} protects type I error under very general conditions. 4.1 Tests of Power One While Theorem 4.2 ensures that our tests satisfy Definition 2.4 , it does not ensure that our test rejects the null when it is false. To provide guarantees on the power of our test, we introduce sufficient conditions under which our tests for \mathcal{H}(f) are tests of power one, i.e. rejects the null \mathcal{H}(f) in finite time when \tau , the CMF/CATE of P , differs from f . Assumption 4.3 (Positive Covariance) . Assume that there exists \tau_{\infty} , v_{\infty} such that \|\hat{\tau}_{t}-\tau_{\infty}\|_{L_{2}(P_{X})}=o(1) and \|\hat{v}_{t}-v_{\infty}\|_{L_{2}(P_{X})}=o(1) almost surely, and \exists c>0 such that \mathbb{E}_{P_{X}}\left[\frac{\left(\tau_{\infty}(X)-f(X)\right)(\tau(X)-f(X))}{v_{\infty}(X)}\right]\geq c. (16) Assumption 4.3 requires that sequence of sequential regressors (\hat{\tau}_{t},\hat{v}_{t})_{t\in\mathbb{N}} has almost-sure L_{2}(P_{X}) limits \tau_{\infty} and \hat{v}_{t} , and the limiting weight function (\tau_{\infty}(x)-f(x))/v_{\infty}(x) is positively correlated with the differences between the CMF/CATE \tau and null f . Note that Assumption 4.3 requires \tau(x)\neq f(x) in order to hold, implying that P\not\in\mathcal{H}(f) , and does not require g_{t} to converge in the setting of DGP2. Leveraging Assumption 4.3 , we formalize the conditions under which our test achieves power one in Theorem 4.4 . Theorem 4.4 (Test of Power 1) . Let Assumptions 2.1 - 2.3 and 4.1 hold. Then, for any distribution P\not\in\mathcal{H}(f) and regressors (\hat{\tau}_{t},\hat{v}_{t})_{t\in\mathbb{N}} that satisfy Assumption 4.3 , P\left(\exists t\in[t_{0},\infty):\xi_{t}(f,\rho,\alpha,t_{0})=1\right)=1 (17) for any fixed \alpha\in(0,1) , \rho>0 , l>0 , t_{0}\in\mathbb{N} , f\in L_{\infty}(B) , and sequence of weight magnitude bounds (\epsilon_{t})_{t\in\mathbb{N}} . The results of Theorem 4.4 follow directly from Assumption 4.3 . In particular, Assumption 4.3 ensures that the expected drifts of our process \psi_{t}(f) are positive as t\rightarrow\infty , leading to almost-sure rejection and our test of power one result. Note that our tests do not require \tau_{\infty}=\tau or v_{\infty} to converge to the conditional variance of \phi terms in order to achieve power one, ensuring rejection of the null under mild conditions. Beyond rejection almost surely, our choice of weights for our test \xi_{t}(f,\alpha,\rho,t_{0}) enables our testing procedure to obtain optimal sample complexities with respect to a Gaussian location shift model. Below, we provide sufficient conditions under which our tests achieve this notion of optimality. 4.2 Achieving Optimal Sample Complexities To achieve our desired sample complexities, we require our sequential regressors \hat{\tau}_{t} , \hat{v}_{t} , and g_{t} converge almost surely in L_{2}(P_{X}) to their corresponding values under P . Assumption 4.5 (Consistency) . Assume that as t\rightarrow\infty , the (random) regression sequence processes (\hat{\tau}_{t},\hat{v}_{t},g_{t})_{t\in\mathbb{N}} satisfy the following almost surely: (i) \|\hat{\tau}_{t}-\tau\|_{L_{2}(P_{X})}=o(1) , (ii) \|g_{t}(\cdot,a)-\mu(\cdot,a)\|_{L_{2}(P_{X})}=o(1) for a\in\{0,1\} for DGP2, where \mu(x,a) is as defined in Section 2 , and (iii) \|\hat{v}_{t}-{v}_{*}\|_{L_{2}(P_{X})}=o(1) , where v_{*}(x)=\sigma^{2}(x) as in Equation ( 1 ) for DGP1, and v_{*}(x)=\frac{\sigma^{2}(x,1)}{\pi(x,1)}+\frac{\sigma^{2}(x,0)}{\pi(x,0)} with \sigma^{2}(x,a) and \pi(x,a) defined in Equation ( 1 ) and Section 2 respectively for DGP2. Assumption 4.5 requires our sequential regression functions \hat{\tau}_{t} , g_{t} , and \hat{v}_{t} converge almost surely in L_{2}(P_{X}) to their corresponding values under P . In particular, note that v_{*} corresponds to the conditional variance \mathbb{E}[(\phi_{t,*}^{CATE}-\tau(x))^{2}|X=x] for DGP2, where \phi_{t,*} is as defined in Equation ( 3 ) with g_{i}=\mu . To obtain expected sample complexity results, we rely on the following technical condition that Assumption 4.6 (Near Square Summability of Drifts) . Let \tau_{\infty} and v_{\infty} be as defined in Assumption 4.3 , and assume that there exists a function g_{\infty}(\cdot,a) such that as t\rightarrow\infty , \|g_{t}(\cdot,a)-g_{\infty}(\cdot,a)\|_{L_{2}(P_{X})}=o(1) almost surely. Define the (random) drift as d_{t}\coloneqq\mathbb{E}_{P}\left[w_{t}(X,f)(\phi_{t}-f(X))\right] , with d_{\infty} being the corresponding limit drift with functions \tau_{\infty},v_{\infty} and g_{\infty} in DGP2. Then, \exists p>1 , \zeta\in(1/p,1) such that the sum \sum_{t=1}^{\infty}t^{p\zeta}\mathbb{E}_{P}\left[\left(d_{t}-d_{\infty}\right)^{p}\right] is finite. Assumption 4.6 controls the deviations of drifts d_{t} of our process \psi_{t}(f) from its limit drift d_{\infty} such that our almost sure limit and expected limit coincide. To interpret our condition, consider the case where p=2 : if \zeta=1/2 , then our condition is simply that expected squared deviations of drifts d_{t} from d_{\infty} are summable. Because we require \zeta>1/p , this condition is a slightly stronger version of square summability for the deviations of the drift ( Hall et al. 2014 ) . We note that other works ( Bibaut et al. 2024 ; Polyak & Juditsky 1992 ) use similar conditions to establish limit results for expected convergence rates. Using Assumptions 4.5 and 4.6 , we establish asymptotic bounds (in the regime \alpha\rightarrow 0 ) on the sample complexity of our tests that match the optimal complexities for global null testing under a Gaussian shift model. Theorem 4.7 (Sample Complexities Bounds) . Let Assumptions 2.1 - 2.3 and 4.1 hold. Let t_{0}(\alpha) denote a sequence of burn-in times \{t_{0}(\alpha)\}_{\alpha\in(0,1)} such that t_{0}(\alpha)=o(\log(1/\alpha)) and \lim_{\alpha\rightarrow\infty}t_{0}(\alpha) diverges. Denote N_{f}(\alpha)=\inf\{t\geq t_{0}(\alpha):\xi_{t}(\mathcal{H},\alpha,\rho,t_{0}(\alpha))=1\} as the first time we reject the null \mathcal{H}(f) for our \alpha -indexed sequence of tests \xi_{t}(\mathcal{H},\alpha,\rho,t_{0}(\alpha)) . Let \Gamma(\tau,f) denote \mathbb{E}_{P_{X}}\left[\frac{(\tau(X)-f(X))^{2}}{2\sigma^{2}(X)}\right] for DGP1, and \inf_{\mu_{0}\in\mathcal{P}(f)}\mathbb{E}_{P_{X}}\left[\sum_{a\in\{0,1\}}\pi(X,a)\frac{\left(\mu(X,a)-\mu_{0}(X,a)\right)^{2}}{2\sigma^{2}(X,a)}\right], (18) in the setting of DGP2, with \mathcal{P}(f) denoting the set of distributions P with \mu_{0}(x,a)=\mathbb{E}[Y|X=x,A=a] such that \mu_{0}(x,1)-\mu_{0}(x,0)=f(x) P_{X} -almost surely. For any distribution P such that \Gamma(\tau,f)>0 and sequential regressors (\hat{\tau}_{t},\hat{v}_{t},g_{t})_{t\in\mathbb{N}} such that Assumption 4.5 holds, for all fixed \rho>0 , l>0 , \alpha\in(0,1) , null function f\in L_{\infty}(B) , and sequences (\epsilon_{t})_{t\in\mathbb{N}} , P\left(\limsup_{\alpha\rightarrow 0}\frac{N_{f}(\alpha)}{\log(1/\alpha)}\leq\Gamma^{-1}(\tau,f)\right)=1 (19) Furthermore, if Assumption 4.6 also holds, then we obtain \limsup_{\alpha\rightarrow 0}\frac{\mathbb{E}[N_{f}(\alpha)]}{\log(1/\alpha)}\leq\Gamma^{-1}(\tau,f), (20) i.e. the expected sample complexity \mathbb{E}[N_{f}] is upper bounded by the same constant as the almost sure limit as \alpha\rightarrow 0 . Theorem 4.7 demonstrates that as error tolerance \alpha\rightarrow 0 , the rejection time for \mathcal{H}(f) is upper bounded almost surely and in expectation by the term \Gamma^{-1}(\tau,f) . In addition to our convergence assumptions, our result requires that \alpha -indexed tests \xi_{t}(f,\rho,\alpha,t_{0}(\alpha)) leverages burn-in times t_{0}(\alpha)=o(\log(1/\alpha)) . The order of t_{0}(\alpha) ensures that our burn-in times do not affect rejection time bounds, while allowing burn-in times t_{0}(\alpha) to diverge to infinity. Remark 4.8 (Optimality Bound for Gaussian Testing) . The bound \Gamma(\tau,f) corresponds to the smallest possible sample complexity for sequentially testing the null \mathcal{H}(f) , where outcomes Y\sim N(\mu(x),\sigma^{2}(x))|X=x and Y\sim N(\mu(x,a),\sigma^{2}(x,a))|X=x,A=a for DGP1 and DGP2 respectively with known conditional variance function \sigma^{2} ( Agrawal & Ramdas 2025 ; Garivier & Kaufmann 2016 ) . 3 3 3 We provide a precise characterization in Appendix B . Under an asymptotic relaxation of error control and consistent nuisances, Theorem 4.7 demonstrates that our test recovers the optimal sample complexity for parametric Gaussian testing, even in highly nonparametric settings. Figure 2 : Scatterplot and conditional means (red lines) of Y with respect to latent variable \zeta for each of our synthetic examples. Figure 3 : Cumulative density functions for the first time of rejection N_{f} . Shaded region denotes pointwise 95% confidence interval. 5 Experiments To test our approach, we test the efficacy of our method on both synthetic and real world datasets. For all experiments, we set \rho=0.06 , l=0.01 , \epsilon_{t}=t^{-0.24}/10 , and \alpha=0.1 , where our choices satisfy the conditions of Theorem 4.2 . We set the burn-in time t_{0} as 250 and 2000 for our synthetic and real world datasets respectively. 4 4 4 We discuss our choices for burn-in times t_{0} in Appendix C . For \hat{\tau}_{t},\hat{\sigma}^{2}_{t},g_{t} , we use an online variant of neural network (3 hidden layers) implemented in the river package in Python ( Montiel et al. 2021 ) . We provide additional details, including additional hyperparameter testing, in Appendix B . 5.1 Setup. In our synthetic setups, we focus on testing the null \mathcal{H}(f) in the setting of DGP1, where f=0.5 is a constant function. For all synthetic examples, the context vector X\in\mathbb{R}^{10} is generated with i.i.d. X_{i}\sim\text{Unif}[0,1] . To generate outcomes, we sample Y from a Beta distribution with conditional means \tau(x)=f(\zeta) , where \zeta=\Phi\left(\frac{2}{\sqrt{10}}\sum_{i=1}^{10}(X_{i}-0.5)\right) , where \Phi(\cdot) denotes the standard normal CDF. To assess error control and power against nonparametric alternatives, we test 4 synthetic conditional mean examples: (i) the null distribution, (ii) a step function, (iii) a bump function, and (iv) a sine curve. We visualize Y with respect to the latent \zeta in Figure 2 . For our real-world setup, we investigate the use of asymptotic AV inference for detecting CATE heterogeneity (e.g. f(x)=0 ) with data from a randomized controlled trial (setting of DGP2). The French jobs dataset (Jobs) contains 33,797 observations of unemployed individuals participating in a large-scale randomized experiment comparing assistance programs ( Behaghel et al. 2014 ) . Our contexts X\in\mathbb{R}^{41} contains both discrete and continuous demographic data for each individual, Y corresponds to the (binary) outcome of reemployment in six months. The control group ( A=0 ) receives a privately-run counseling program, while the treatment group ( A=1 ) receives a publicly-run counseling program. To conduct multiple simulations, we bootstrap 10,000 observations with population weights. Baseline Approaches. As baselines for our approach, we include the asymptotic anytime valid F -test ( Lindon et al. 2025 ) and Bonferroni-corrected asymptotic AV tests across conditions means under a discretized covariate space \tilde{X} ( Waudby-Smith et al. 2024 ; Chugg et al. 2025a ) ( Bin ). Note that our latter approach mimics an asymptotic AV version of the max test ( Arias-Castro et al. 2011 ) . For our F -test baseline, we test the null that all coefficients (including intercept) are equal to zero for the synthetic setup. For the real-world setup, we test the null that the coefficients corresponding to the treatment indicator A and all interaction terms X\cdot A are equal to zero. For our synthetic setup, we bin based on the L_{2} norm \|X\|_{2} of context vectors and centered context vectors. For our real-world setup, we construct bins based on the age, education, and gender attributes of the context vector, constructing natural, interpretable bins for each conditional mean. 5.2 Discussion of Results. To evaluate each method, we estimate the cumulative density function (CDF) for N_{f} , the first time in which we reject the null, up to time T=10,000 (Figure 3 ). In the null plot, our CDFs demonstrate that all methods controls error uniformly at level \alpha=0.1 throughout the horizon. Even with relatively small t_{0}=250 , all methods provide AV error control, demonstrating asymptotic relaxations minimally affect error rates in practice. In examples where \tau\not\in\mathcal{H}(f) , our CDF plots characterize the power of our test. Among all approaches, only our method consistently achieves high rejection probability by T=10,000 . Among all tested methods, our approach achieves either the highest or second highest probability of rejecting the null across all examples uniformly over times t\geq 3000 . The F -test baseline achieves high power when linear projections of X capture variations in \tau from f (Step, Jobs), achieving rejection probabilities near one for sample sizes as small as t=1000 in our Step example. However, its performance degrades rapidly when such projections fail to distinguish \tau from f (Bump, Sine), with rejection probabilities less than 0.2 by T=10,000 . By leveraging flexible regression estimates, our method avoids linear projection limitations and adapts to shape of \tau across our examples. Our binning baseline (e.g. Bonferroni correction across binned X ) suffers from (i) fixed discretizations of the covariate space and (ii) conservative performance for large bin numbers due to multiple testing corrections. When the bins closely correspond to regions of the covariate space where either \tau(x)>f(x) or \tau(x)