arXiv:2610.13625stat.MEOct 2026

Manuscript Offprint

arXiv:2610.13625

Kernel-based External Validity of Experimental Studies

Federico Matteucci, Gerhard Neumann

Abstract

The external validity of a study is the extent to which its findings generalize to unseen experimental conditions, such as datasets. We formalize the results of a study together with its research question, and define external validity as the probability that two independent and same-sized replications of the study produce results whose maximum mean discrepancy (MMD) is below a given tolerance. This approach, centered on the choice of a space of results and of an appropriate reproducing kernel for the MMD, is flexible enough to be deployed on multiple different types of results and research questions. Additionally, we establish an asymptotic power-law relation between the size of a study and the quantiles of the MMD, which we use to estimate the desired size of an externally valid study from a small-scale preliminary study. We deploy our framework to rankings with ties and discuss kernels suited to different research questions. Experiments on existing case studies and on a simulated newly designed study illustrate the applicability of the framework. We release our code as part of the genexpy Python module. 1^{1}

1 INTRODUCTION

Assessing the quality of an experimental study is a multi-faceted problem and depends on many independent aspects. Among these, its scope should be properly defined (Boulesteix et al., 2015; Bouthillier et al., 2021), its documentation should allow for independent reproducibility studies (Baker, 2016; Peng, 2011; Raff, 2021, 2023), its results should be sensibly analyzed to assess their significance (Benavoli et al., 2017; Corani et al., 2017; Demšar, 2006) and should be valid for a population extending beyond the original sample (Liao et al., 2021). External validity, which is sometimes referred to as reproducibility, replicability, or generalizability, is this last component.

Gerhard Neumann

Karlsruhe Institute of Technology

A study is deemed externally valid if repeating it under comparable experimental conditions, and in the absence of systematic changes to its design, yields similar results (National Academies of Sciences, Engineering, and Medicine, 2019; Findley et al., 2021; Pineau et al., 2021). External validity is assessed through the sign- and effect-generalization of a treatment on a numeric response in causal inference (Campbell, 1957; Egami and Hartman, 2023), psychology (Open Science Collaboration, 2015; Klein et al., 2018; Patil et al., 2016; Verhagen and Wagenmakers, 2014), economics (Camerer et al., 2016), the social sciences (Delios et al., 2022; Camerer et al., 2018), medicine (DerSimonian and Laird, 1986), human-AI interaction (Vaccaro et al., 2024), and chain-of-thought reasoning (Sprague et al., 2025). Generalizability theory (Cronbach et al., 1963; Brennan, 1992) quantifies the contribution of covariates to the variance of a numeric response.

It is well documented that significant findings often fail to hold beyond the study that produced them. In machine learning (ML) specifically, the results of experimental studies are well known to vary substantially with design choices (Boulesteix et al., 2017; Gundersen et al., 2022; Van Mechelen et al., 2023; Lu et al., 2023; Qin et al., 2023; McElfresh et al., 2022; Wainberg et al., 2016), be it an insufficient number of datasets (Dehghani et al., 2021; Alvarez et al., 2022; Boulesteix et al., 2015) or differences in hyperparameter tuning (Bouthillier et al., 2021), initialization seed (Gundersen et al., 2023), hardware (Zhuang et al., 2022), minor perturbations in the data (Alzahrani et al., 2024), or the inclusion of additional competitors (Zhang and Hardt, 2024). We refer to Liao et al. (2021) for a broader discussion. This motivates the search for alternative methods to assess the external validity of findings that are not restricted to numeric responses and apply to other types of data, such as rankings.

A natural tool for this purpose is the maximum mean discrepancy (MMD), which compares distributions by mapping them into an appropriate repro-ducing kernel Hilbert space (RKHS). Successful applications include testing (Gretton et al., 2012; Fernandez and Gretton, 2019; Liu et al., 2020; Wynne and Duncan, 2022; Chevyrev and Oberhauser, 2022; Schrab et al., 2023; Zhou et al., 2025b; Chatalic et al., 2026), generative modeling (Dziugaite et al., 2015; Li et al., 2015b; Sutherland et al., 2017; Li et al., 2017; Zhou et al., 2025a), quantization (Arbel et al., 2019; Gladin et al., 2024; Belhadji et al., 2026), subspace selection (Cribeiro-Ramallo et al., 2025), robust regression (Alquier and Gerber, 2024), learning world models (Balestriero and LeCun, 2025; Zimmermann et al., 2025), model selection (Brück et al., 2025), and online change detection (Li et al., 2015a, 2019; Kalinke et al., 2025; Kalinke and Gavioli-Akilagun, 2025). At the core of the MMD's flexibility are reproducing kernels, which have been defined on a variety of domains, including strings and graphs (Borgwardt et al., 2006; O'Bray et al., 2022), Riemannian manifolds (Cheng and Xie, 2024), Hilbert spaces (Wynne and Duncan, 2022), time series and stochastic processes (Chwialkowski et al., 2014; Laumann et al., 2021; Chevyrev and Oberhauser, 2022), persistence diagrams (Kwitt et al., 2015), and (partial) rankings (Mania et al., 2018; Lomeli et al., 2019). Rankings are particularly prominent in the analysis of experimental results, especially in non-parametric tests and procedures (Demšar, 2006; Benavoli et al., 2017). This work aims at applying the MMD to the issue of lack of external validity.

Our core contribution is a novel take on the problem of assessing the external validity of an experimental study. To this end, we propose a kernel-based framework for the formalization and analysis of experimental results, with only mild structural assumptions, and translate an existing natural-language definition of external validity into our statistic, which we call kernel external validity (KEV). We investigate the properties of our statistic and discuss how to set its parameters (the kernel k and a numeric threshold ε\varepsilon) in an interpretable and informed way. We discuss how the KEV can help assess the appropriate size of an experimental study, and apply it to a simulated study to show how it can be useful in practice. We show applications of the KEV to rankings and two case studies. Finally, we release our code as part of the genexpy 1^{1} Python module, which contains routines to handle rankings, implementations of kernels for rankings, and the MMD.

Outline Section 2 introduces our notation, formalizes experimental studies, and recalls the MMD. Section 3 discusses our KEV statistic and how to choose its parameters. Section 4 contains our experiments and case studies. Section 5 details limitations.

References (84)