Minimax Optimal Kernel Two-sample Testing in Sub-quadratic Time
Ikjun Choi, Shourya Pandey, Purnamrita Sarkar
Hypothesis Testing @ ICML 2026
TL;DR. Sub-quadratic minimax optimal two sample MMD testing
Abstract. Kernel two-sample tests based on Maximum Mean Discrepancy (MMD) are widely used, but the standard quadratic time MMD statistic requires evaluating kernel pairs where is the pooled sample size. Several subquadratic approximated MMD tests have been proposed to alleviate this issue, but the existing methods either compromise the test power or assume additional distributional constraints to achieve power comparable to the quadratic-time MMD test.
Motivated by this gap, we propose a sub-quadratic time computational method to approximate the MMD test, achieving minimax rate-optimal power with minimal distributional assumptions. Building on ideas in fast kernel density estimation and exponentially convergent trapezoidal rule in numerical analysis, our approximation reduces all-pairs kernel summation to fast Fenwick-tree prefix-sum queries.
For fixed dimension, this yields subquadratic-time algorithms for product kernels on constructed from common characteristic kernels, including Laplace, Mat'ern, Gaussian, and inverse multiquadric kernels. The approximation error is controlled tightly enough to have the same power as the minimax-optimal quadratic-time unapproximated MMD test. The same implementation remains subquadratic for the dimension , and can be paired with dimensionality-reduction algorithms when the signal is low-dimensional.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
NeurIPS 2026
Accept (poster) · 3 reviews · OpenReview
Updated 25 Nov 2026, 03:48 UTC.
- Decision
- Accept (poster)
Read decision
Meta-review
This paper proposes a sub-quadratic time method for approximating MMD kernel two-sample tests by leveraging fast Fenwick-tree prefix-sum queries. The theoretical goal is to maintain minimax rate-optimal power without imposing restrictive distributional assumptions. Reviewers appreciate the significance and originality of achieving sub-quadratic complexity with minimal distributional constraints, as well as the runtime-power trade-offs demonstrated in the low-dimensional experiments. However, several clarifications are required for this paper:
-
Comparison with Prior Work & Theoretical Framing: Clarify the precise theoretical and empirical differences between your approach and Chatalic et al. (2025) / Schrab et al. (2023). Specifically, what are the precise advantages of your error control and minimax optimality guarantees compared to theirs? Also, please clarify the exact scope of applicable kernels (e.g., separable vs.$$-approximately separable kernels) and address Reviewer CoNr’s notation/definition concerns regarding Euclidean space dependencies and line 78/79 parameter definitions.
-
Dimensionality Scaling and Approximate Separability Constraints: Reviewers 1bAB and GfR4 point out that the error bound grows exponentially with dimension for approximately separable (AOS) kernels, rendering the applicability unclear for . How severe is this degradation in practice, and can the error be controlled or mitigated (e.g., via rescaling) in higher dimensions?
-
Practicability of Bandwidth and Approximation Parameters: How robust is the method to misspecified smoothness or choices of approximation budget ? Please provide a brief explanation or ablation guidance regarding how these heuristics should be chosen in practice without compromising power or runtime guarantees.
Large scale experiments, while helpful, should be lower priority. The authors should prioritize experiments that address the issues above. Also, if the authors write a rebuttal, they should consider addressing any other questions raised by the reviewers.
Final justification
I have read through the rebuttal and discussion. The authors have addressed the core concerns and all reviewers recommend/lean towards acceptance. The authors should carefully include all of the new experiments and clarifications in the final version of the paper.
Read meta-review
Meta-review
This paper proposes a sub-quadratic time method for approximating MMD kernel two-sample tests by leveraging fast Fenwick-tree prefix-sum queries. The theoretical goal is to maintain minimax rate-optimal power without imposing restrictive distributional assumptions. Reviewers appreciate the significance and originality of achieving sub-quadratic complexity with minimal distributional constraints, as well as the runtime-power trade-offs demonstrated in the low-dimensional experiments. However, several clarifications are required for this paper:
-
Comparison with Prior Work & Theoretical Framing: Clarify the precise theoretical and empirical differences between your approach and Chatalic et al. (2025) / Schrab et al. (2023). Specifically, what are the precise advantages of your error control and minimax optimality guarantees compared to theirs? Also, please clarify the exact scope of applicable kernels (e.g., separable vs.$$-approximately separable kernels) and address Reviewer CoNr’s notation/definition concerns regarding Euclidean space dependencies and line 78/79 parameter definitions.
-
Dimensionality Scaling and Approximate Separability Constraints: Reviewers 1bAB and GfR4 point out that the error bound grows exponentially with dimension for approximately separable (AOS) kernels, rendering the applicability unclear for . How severe is this degradation in practice, and can the error be controlled or mitigated (e.g., via rescaling) in higher dimensions?
-
Practicability of Bandwidth and Approximation Parameters: How robust is the method to misspecified smoothness or choices of approximation budget ? Please provide a brief explanation or ablation guidance regarding how these heuristics should be chosen in practice without compromising power or runtime guarantees.
Large scale experiments, while helpful, should be lower priority. The authors should prioritize experiments that address the issues above. Also, if the authors write a rebuttal, they should consider addressing any other questions raised by the reviewers.
Final justification
I have read through the rebuttal and discussion. The authors have addressed the core concerns and all reviewers recommend/lean towards acceptance. The authors should carefully include all of the new experiments and clarifications in the final version of the paper.
2 comments
Summary of Revisions and New Experiments Addressing the Reviews
Dear AC,
Thank you for the careful metareview and for identifying the issues that should be prioritized. To make it easier to assess our response, we summarize the additional experiments and briefly respond to your questions.
Summary of new experiments:
-
Power comparison with other methods, including Nyström, RFF, CTT (Q1)
-
PCA experiments with increasing (Q1)
-
Robustness of AOS approximation to increasing (Q2, 3)
Q1: Comparison with Prior Work
Theoretical differences
Schrab et al. (2023) showed that quadratic-time MMD tests based on tensor-product kernels are minimax optimal under separation. In the same setting, we show that Fenwick MMD achieves both minimax optimality and subquadratic time, uniformly over distributions, for arbitrary products of Laplace, Gaussian, half-integer Matérn, and inverse multiquadric kernels. We also establish the same guarantee under MMD separation.
Chatalic et al. (2025) establish minimax optimality under MMD separation for a Nyström-based MMD test applicable to a broader class of characteristic kernels. However, the computational cost required by their guarantee depends on the spectral decay of the pooled covariance operator, and hence on the kernel and . As far as we understand, it remains unclear whether their analysis provides a uniform subquadratic-time guarantee over arbitrary and .
Empirical differences
We added Nyström-MMD, RFF-MMD, and CTT baselines. On a two-dimensional Gaussian-mixture benchmark, Fenwick MMD closely matches the power of Full MMD and shows a smaller power gap than the other scalable methods.
At the same time, in higher-dimensional settings, unless is sufficiently large, other scalable methods without exponential dependence may be more practical than the Fenwick algorithm. We therefore view these methods as complementary tools rather than uniformly ordered competitors. We will also augment our existing experiments with these additional baselines.
We further added experiments with increasing ambient dimension and latent low-dimensional structure, where PCA is applied before Fenwick MMD. We consider one setting in which the latent signal dimension is smaller than the number of retained PCA components, and another in which it is larger. As expected, PCA-Fenwick retains power more effectively in the former setting, whereas its power decays more rapidly in the latter.
Scope of kernels
We clarify that our current theoretical results apply to arbitrary tensor products formed from Laplace, half-integer Matérn, Gaussian, and inverse multiquadric kernels. Laplace and half-integer Matérn kernels admit exact finite separable representations and incur no power loss, while Gaussian and inverse multiquadric kernels admit controlled -separable approximations that preserve the minimax separation rate.
Other concerns
We will also revise the paper to address the Euclidean-space dependence, notation and definition issues, and other concerns raised in the metareview.
Q2: Dimensionality Scaling and Approximate Separability
We agree that, for a fixed approximation budget, the worst-case AOS error bound grows exponentially with dimension. We therefore added experiments varying both and the approximation budget, and report power, relative statistic error, and permutation -value error.
Although the relative error increases with , we observe that the corresponding degradation in power and -values is substantially less pronounced in practice. A modest increase in the approximation budget also mitigates the degradation over the tested range.
Q3: Bandwidth and Approximation Parameters
Bandwidth selection
Our minimax analysis assumes oracle knowledge of the unknown smoothness , but our algorithm can be incorporated into an adaptive procedure. The aggregated MMD test of Schrab et al. (2023) attains minimax optimality without knowing using bandwidths. Running the Fenwick algorithm separately for each bandwidth introduces only an additional multiplicative overhead, so the resulting aggregated procedure remains subquadratic.
Because the primary goal of our paper is to develop a fast method for computing the MMD statistic that simultaneously achieves minimax optimality and subquadratic runtime, we focused our analysis and experiments on establishing this statistical–computational guarantee. We will add an appendix explaining how our method can be combined with an aggregation framework to obtain an adaptive test.
Approximation budget
Our additional experiments show that even yields power comparable to Full MMD, while increasing to makes the approximation error nearly negligible; please refer to the dimensionality-scaling section above.
We will also add plots showing how the approximated kernel and its deviation from the original kernel change with .
- Rating
- 5/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- theory
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
Authors propose a subquadratic estimator for the MMD, valid for a small collection of kernels. This estimator achieves a complexity while sacrificing no testing power for separable kernels (leading to minimax optimality), while controlling the error for almost separable kernels (leading to minimax optimality, under certain conditions). They also studied the minimax optimality under the growing dimensionality regime, and modeled a latent low-dimensional setting. In their experiment section authors showcase their approach against a collection of baselines, where they achieved equal power to the V-estimator, while being significantly faster.
Strengths and weaknesses
Strengths
-
The fast computation of the MMD is an important and non-trivial problem. Providing a subquadratic estimator that does not require any distributional conditions would be valuable to the community.
-
The authors introduce a new definition of kernels [separable and -separable kernels] for which their estimator is suited. While very restrictive, they show that many of the popular kernels are in the class.
-
The experiment section checks some of the theoretical results [mainly, that -APS/AOS kernels achieve the same power as the V-statistic in low-dimensional settings].
-
The paper is well written and is clear. It is easy to follow and understand the author's arguments.
Weaknesses
While I am favorable towards the content and theoretical derivations of this manuscript, I believe that it contains certain weaknesses that pull it below the acceptance threshold.
-
While authors prove (Theorem 2) that one may achieve minimax optimality for large enough (and a precisely chosen kernel), the test error is separated to that of the V-statistic by a value . This does not scale with the number of samples, but it does (exponentially so) with the number of dimension in the case of -AOS kernels (see Theorem 1). Authors do not justify the use of these approximately separable kernels in practice, neither by proving that the can be controlled theoretically, nor by showing that in practice one may mitigate this scaling (more about the experiments later). This is very important, as the class of PS and OS separable kernels seem to be very small (the only known is the Laplace kernel), and there is no characterization available.
-
The experimental evaluation is lacking. While authors have experimented on small toy datasets, they only tested their results from Lemma 1 ( test error control using APS and AOS kernels). The (very important) questions regarding the scaling with dimensionality (see above) and its suitability in the growing dimensionality regime (Lemma 2) are left unchecked. The lack of proper evaluation is aggravated by the fact that the code is not available.
-
The limitations where not properly addressed. More about that in the Limitations section.
Questions
I believe this article could be raised above the threshold of acceptance if the authors tackle the following questions.
Q1) The scaling in dimensionality plays a heavy roll in the test error in the case of AOS kernels (as we can see in Lemma 1). When one construct the AOS kernels via the product kernel, we can see how this error scales exponentially with the dimensionality (see Theorem 1). While there are experiments, these are limited to kernels in and . Could the authors extend their experiments from Section 5 to test a growing dimensionality setup (say, )? Would the performance of AOS kernels greatly deteriorate, or can it be controlled (via rescalling tricks)?
Q2) Why did the authors leave out important baselines like the Nyström MMD [1] or the RFF MMD [2]? These Nyström/RFF-accelarated estimators are used extensively in the kernel literature.
Q3) The baselines included in the experiments are not completely clear. What is the "full MMD" and how it relates with the V-statistic ("linear MMD")?
Q3) The limitations are under-reported. Could the authors consider introducing them more in detail (see next section)?
Limitations
While the theoretical results are solid, this paper has clear limitations that are not properly addressed with the corresponding severity in the article, nor addressed in their conclusion (no limitations section is available). For instance,
-
The total amount of kernels that are APS or AOS is very limited. This paper's selling point is that it does not have strict distributional assumptions unlike other estimators [1]. However, while the estimator may be free of severe distributional limitations, the number of kernels that can be coupled with it is limited. This can pose a great limitation if this estimator is to be used outside of two sample testing (like in g.o.f. testing, where one employs a Stein kernel [3]).
-
No known way of characterizing separable (of any kind) kernels exists. This greatly limits the applicability of this estimator due to the aforementioned scarcity of such kernels.
Minor comment: Some references seem to have formatting issues ([27], for instance).
References
[1] Antoine Chatalic, Marco Letizia, Nicolas Schreuder, and Lorenzo Rosasco. A scalable Nyström based kernel two-sample test with permutations, 2025, ArXiV.
[2] Soumya Mukherjee, and Bharath Sriperumbudur. Minimax Optimal Kernel Two-Sample Tests with Random Features, 2025, ArXiV.
[3] Florian Kalinke, Zoltán Szabó, and Bharath Sriperumbudur. Nyström Kernel Stein Discrepancy, 2025, AIStats.
Final justification
I believe the authors answered my concerns and have greatly improved the manuscript by adding the extra experiments showing the usability of the approach. Given this, and the other positive reviews and rebuttals, I lean towards acceptance.
Formatting concerns
None
4 comments
Rebuttal
We greatly appreciate the reviewer for the positive assessment of the paper’s theoretical contributions and constructive comments. We clarify below the dimensional dependence, kernel scope, experiments, baselines, and limitations.
W1: Control on
We first clarify that the error in approximating the MMD U-statistic is tunable rather than fixed independently of . In Theorem 2, we choose and show that the required number of separable components remains polylogarithmic in for fixed . Our class is not limited to Laplace: half-integer Matérn kernels admit exact finite separable representations, while Gaussian and inverse multiquadric kernels admit exponentially accurate, kernel-specific approximations that need not take the Laplace-kernel form.
W2: Lack of experiments
Please see Q1 below.
Q1: Error scaling with dimension
We thank the reviewer for suggesting this experiment. We added a growing-dimensional stress test with and , with the null being the standard Gaussian and mean-shift alternative affecting every coordinate. We compare with full Gaussian MMD (unapproximated kernel matrix) with approximation budgets . We note that the variance-shift alternative gave similar results.
Even when the statistic has large relative error for small , power and -value errors remain small because the relative error need not translate into permutation-test error; for example, positive kernel rescaling changes relative error yet leaves the permutation test unchanged.
The dimensional degradation is observable when the approximation budget is too small, but a modest increase in the budget controls it well through in these experiments. We will add these results and clarify that they provide empirical evidence over the tested range rather than removing the worst-case exponential dependence on .
Mean-shift by — Power
| Method | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0.180 | 0.360 | 0.350 | 0.600 | 0.610 | 0.720 | 0.670 | 0.770 | 0.830 | 0.810 | |
| 0.190 | 0.360 | 0.370 | 0.600 | 0.630 | 0.750 | 0.670 | 0.760 | 0.830 | 0.830 | |
| 0.190 | 0.360 | 0.370 | 0.600 | 0.620 | 0.750 | 0.670 | 0.760 | 0.830 | 0.830 | |
| Full MMD | 0.190 | 0.360 | 0.370 | 0.600 | 0.620 | 0.750 | 0.670 | 0.760 | 0.830 | 0.830 |
Mean-shift by — Relative error in the statistic
| Method | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0.1552 | 0.1137 | 0.1440 | 0.1856 | 0.1876 | 0.2689 | 0.3606 | 0.4393 | 0.4906 | 0.5661 | |
| 0.0073 | 0.0086 | 0.0118 | 0.0142 | 0.0181 | 0.0215 | 0.0267 | 0.0287 | 0.0332 | 0.0363 | |
| 0.0012 | 0.0009 | 0.0009 | 0.0012 | 0.0008 | 0.0011 | 0.0019 | 0.0020 | 0.0022 | 0.0025 |
Mean-shift by — -value error
| Method | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0.0096 | 0.0092 | 0.0085 | 0.0062 | 0.0075 | 0.0049 | 0.0076 | 0.0057 | 0.0047 | 0.0041 | |
| 0.0008 | 0.0004 | 0.0002 | 0.0004 | 0.0006 | 0.0000 | 0.0002 | 0.0005 | 0.0000 | 0.0000 | |
| 0.0002 | 0.0000 | 0.0001 | 0.0001 | 0.0002 | 0.0000 | 0.0001 | 0.0002 | 0.0000 | 0.0000 |
As an extension of the Section 5 experiments, we evaluate the practical power of PCA-Fenwick as the ambient dimension increases. Under the null, both samples follow a product of standard Gaussians, with . The first alternative changes the variance to in the first three coordinates, while the second changes it to in the first eight coordinates. We retain four PCA components. As expected, PCA-Fenwick maintains high power in the first setting, where the retained subspace contains the signal, but its power decreases more rapidly in the second, where the signal dimension exceeds the number of retained components.
PCA experiment (=3, =1.2)
| Method | 8 | 16 | 24 | 32 | 40 |
|---|---|---|---|---|---|
| Full MMD | 1.000 | 0.990 | 0.990 | 0.920 | 0.900 |
| RFF MMD | 0.950 | 0.370 | 0.280 | 0.170 | 0.070 |
| Nyström AKRLS | 1.000 | 0.970 | 0.920 | 0.790 | 0.600 |
| PCA-Fenwick | 1.000 | 1.000 | 1.000 | 0.980 | 0.970 |
| CTT (g=3) | 1.000 | 0.950 | 0.950 | 0.850 | 0.730 |
| Linear MMD | 0.060 | 0.050 | 0.080 | 0.060 | 0.120 |
| Block MMD | 0.410 | 0.230 | 0.190 | 0.070 | 0.130 |
| Incomplete U | 0.630 | 0.330 | 0.280 | 0.250 | 0.220 |
PCA experiment (=3, =1.1)
| Method | 8 | 16 | 24 | 32 | 40 |
|---|---|---|---|---|---|
| Full MMD | 1.000 | 1.000 | 0.990 | 0.940 | 0.900 |
| RFF MMD | 1.000 | 0.500 | 0.450 | 0.100 | 0.090 |
| Nyström AKRLS | 1.000 | 1.000 | 0.990 | 0.940 | 0.760 |
| PCA-Fenwick | 1.000 | 0.920 | 0.710 | 0.570 | 0.380 |
| CTT (g=3) | 1.000 | 0.980 | 0.910 | 0.860 | 0.770 |
| Linear MMD | 0.100 | 0.070 | 0.050 | 0.030 | 0.120 |
| Block MMD | 0.430 | 0.220 | 0.140 | 0.070 | 0.160 |
| Incomplete U | 0.860 | 0.400 | 0.250 | 0.210 | 0.220 |
Q2. Comparison with Nyström MMD [1] or the RFF MMD [2]
We have now added comparisons to both [1] and [2]. Nyström and RFF apply more broadly and are better suited to high-dimensional settings (where our algorithm would run slow in practice), whereas our method requires low-dimensional OS/AOS structure. Nyström may lose power with too few landmarks relative to the effective dimension, while RFF may lose power with too few features to capture the relevant spectrum. In contrast, our method is exact for OS kernels and deterministically controlled by for AOS kernels. In our new Gaussian-mixture experiment, Fenwick tracks full MMD while both Nyström and RFF show a power gap. We therefore view these methods as complementary rather than uniformly ordered.
For this comparison, we use the two-dimensional Gaussian-grid benchmark of Gretton et al. (2012b): equally weighted mixtures on a grid with spacing , covariance under the null, and covariance under the alternative, so the difference is only in the local correlation structure. We follow their bandwidth choice.
| Method | 500 | 1000 | 1500 | 2000 | 2500 | 3000 | 3500 | 4000 | 4500 |
|---|---|---|---|---|---|---|---|---|---|
| Full MMD | 0.230 | 0.530 | 0.470 | 0.580 | 0.620 | 0.670 | 0.610 | 0.640 | 0.760 |
| RFF MMD | 0.090 | 0.290 | 0.250 | 0.360 | 0.450 | 0.400 | 0.390 | 0.370 | 0.500 |
| Nyström AKRLS | 0.030 | 0.220 | 0.260 | 0.410 | 0.480 | 0.450 | 0.460 | 0.440 | 0.550 |
| Fenwick MMD | 0.250 | 0.550 | 0.480 | 0.570 | 0.640 | 0.670 | 0.620 | 0.650 | 0.760 |
| CTT (g=3) | 0.136 | 0.145 | 0.422 | 0.516 | 0.513 | 0.490 | 0.445 | 0.393 | 0.660 |
| Linear MMD | 0.040 | 0.080 | 0.060 | 0.070 | 0.070 | 0.040 | 0.070 | 0.070 | 0.140 |
| Block MMD | 0.070 | 0.120 | 0.100 | 0.250 | 0.200 | 0.270 | 0.280 | 0.300 | 0.400 |
| Incomplete U | 0.160 | 0.370 | 0.290 | 0.400 | 0.480 | 0.420 | 0.360 | 0.430 | 0.540 |
Q3: "full MMD" and "linear MMD"?
In our experiments, “Full MMD” denotes the standard quadratic-time unbiased MMD U-statistic defined in Section 2.2. “Linear MMD” denotes the linear-time unbiased estimator obtained by retaining only a linear number of disjoint pair terms from the full quadratic U-statistic, see e.g., Gretton et al. (2012a).
Limitations
We agree that our method imposes a structural requirement on the kernel, and is limited to . Our current results cover Laplace, half-integer Matérn, Gaussian, and inverse multiquadric kernels, and as the reviewer points out, we do not claim analogous approximation guarantees for an arbitrary characteristic kernel. We focus on these four kernels because we restrict our attention to , where they are among the popular characteristic kernels commonly used in practice (see, e.g., Muandet et al., 2017, Table 3.1). Our theoretical guarantees allow arbitrary product kernels formed from these kernels. Extending the framework to additional characteristic kernels on , or obtaining a more general characterization of kernels admitting efficient separable approximations, would be an interesting future direction. We also clarify that our method can be applied straightforwardly to MMD-based GoF testing, which is minimax optimal in . Li and Yuan, 2024 show that an MMD test using its asymptotic distribution is minimax optimal, and the analysis on the permutation procedure in Schrab et al. (2023) can be used for goodness-of-fit testing (also, see the comments in Hagrass et al. (2025, page 3)). We expect that our fast kernel-sum computation could apply to such MMD permutation GoF testing. KSD is also widely used for goodness-of-fit testing, but since the present paper focuses on MMD rather than Stein kernels, extending our approximation framework to KSD is left for future work.
References
Muandet, K., Fukumizu, K., Sriperumbudur, B. K., and Schölkopf, B. Kernel Mean Embedding of Distributions. Foundations and Trends in Machine Learning (2017).
Schrab, A., Kim, I., Albert, M., Laurent, B., Guedj, B., and Gretton, A. MMD Aggregated Two-Sample Test. JMLR (2023).
Gretton, A., Borgwardt, K. M., Rasch, M. J., Schölkopf, B., and Smola, A. A Kernel Two-Sample Test. JMLR (2012a).
Gretton, A., Sejdinovic, D., Strathmann, H., Balakrishnan, S., Pontil, M., Fukumizu, K., and Sriperumbudur, B. K. Optimal Kernel Choice for Large-Scale Two-Sample Tests. NIPS (2012b).
Hagrass, O., Sriperumbudur, B. K., and Li, B. Spectral Regularized Kernel Goodness-of-Fit Tests. JMLR (2024).
Li, T., and Yuan, M. On the Optimality of Gaussian Kernel Based Nonparametric Tests against Smooth Alternatives. JMLR (2024).
I thank the authors for their reply and for their thorough evaluation of my concerns. I do believe that the experimental results provided for Q1 and Q2, as well as the Limitation discussion, could greatly improve the document if included in the final version. Hence, I will increase my rating accordingly, under the premise of these being included in the final version of the article.
We appreciate your positive comment. We will include these results in the final version of the article.
Dear Reviewer GfR4,
Thank you again for your positive response. We noticed that the numerical rating displayed on OpenReview still appears unchanged, so we wanted to check whether the update may not have gone through. When convenient, could you please verify it? If this is simply a display delay, please disregard.
We remain committed to including the new experiments and expanded limitations discussion in the final version. Thank you again for your time.
- Rating
- 5/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 4/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
The paper proposes to accelerate the computation of maximum mean discrepancy (MMD) on Euclidean space (usually ; with the number of samples) by using Fenwick trees. The approach works for kernels that are "separable" or "almost separable", meaning that the underlying kernel can be (approximately) decomposed into a specific form; the frequently used Laplace and Gaussian kernels are shown to fall within the framework. The approximation procedure is independent of the typical random Fourier feature-, Nyström-, or incomplete Cholesky decomposition-based approaches. The authors show that the approximate decomposition preserves minimax optimality (w.r.t. L2 separation) when used for two-sample testing while enjoying computational gains.
Strengths and weaknesses
The article is well written overall, albeit, by spanning 57 pages, too long for a conference submission to study in full detail. Therefore, my reading focused on the main part of the manuscript and I recommend submitting works of this length to an appropriate journal in the future, e.g., JMLR. This would also allow to merge results such as the optimality w.r.t. MMD separation, currently in the appendices, with the main part.
Strengths
- The results are overall clearly presented.
- The authors propose an original method of approximating MMD together with an analysis in the case of two-sample testing, highlighting the enjoyable statistical-computational tradeoff of the method.
Weaknesses
- The main issue is the (missing) placement w.r.t. related work.
- The cited Chatalic et al. (2025) ([6] in the manuscript) studies the same problem of accelerated MMD-based two-sample testing, also giving minimax results on their accelerated procedure. However, the authors of the present work claim that "their computation-power tradeoffs are less fully characterized". A clear comparison (theoretically and experimentally) is missing.
- While the source of Lemma 4 is made explicit, overall related proof techniques (also for the following parts) seem to have been employed in Schrab et al. (2023) ([27] in the manuscript) Section D or Li & Yuan (2024). Such connections should be made clear.
- Next to this primary weakness, the authors fail to make their dependence on Euclidean space fully explicit early on. As kernels are known on many domains, I feel that this limitation should be part of the abstract and the introduction.
- Notations are incomplete/difficult to parse.
- in line 78 is not defined, rendering the definition worthless.
- The norms could be made explicit (e.g., could be the supremum or the essential supremum).
- , in line 79 is undefined.
- should be included.
- The description of the minimax testing framework (line 90f.) lacks dependence throughout (lines 93 and 94). Also the missing dependence of renders the definitions of and unclear (l.h.s. depends on , r.h.s. does not).
- I think that does not depend on .
- After having defined everything in terms of , the authors suddenly switch to .
- sometimes has an index , sometimes not (e.g., line 105 vs. 113).
- A "proper kernel" (line 130) has not been defined.
- vs. .
- I feel that the beginning of Section 3.2 should have some more details, e.g,. by formalizing the recursive structure of the -s.
Typos/Grammar
Line 51: n->N. Line 56: closing ')' missing. Line 247: 'except'. Line 259: . Line 280: x->X. Line 328: 'In' superfluous. Line 337: 'multiquadric'->'multiquadratic'.
The references are not properly capitalized (HSIC, Nyström, MMD, Fourier, neural information processing); some names do not print correctly (e.g., [27]). The authors should polish the references.
References
Antoine Chatalic, Marco Letizia, Nicolas Schreuder, Lorenzo Rosasco: An Efficient Permutation-Based Kernel Two-Sample Test. CoRR abs/2502.13570 (2025)
Antonin Schrab, Ilmun Kim, Mélisande Albert, Béatrice Laurent, Benjamin Guedj, Arthur Gretton: MMD Aggregated Two-Sample Test. J. Mach. Learn. Res. 24: 194:1-194:81 (2023)
Tong Li, Ming Yuan: On the Optimality of Gaussian Kernel Based Nonparametric Tests against Smooth Alternatives. J. Mach. Learn. Res. 25: 334:1-334:62 (2024)
Questions
- What is the precise relationship to [6]?
- What is the gain over [3] in terms of analysis (besides lifting to )?
- For the theory to hold, the kernel must depend on the sample size (interestingly, it doesn't in the experiments). Can the authors comment on this choice, is there related work on this?
- In Remark 1, the authors claim that related work imposes tail conditions on the kernels. Do the kernels considered by the authors of the present work satisfy these tail constraints, i.e., are the existing results transferable?
- What is the purpose of Section 5? It seems to be largely independent of the MMD approximation studied in this work.
- Is Algorithm 8 applied to the pooled sample?
- In Section 5, Assumption 1 is phrased in terms of , then somehow used in terms of and in Lemma 3 and remarked upon in terms of in Remark 3. Can the authors please clarify this?
Limitations
The constraint of Euclidean space should be emphasized.
Final justification
The manuscript was already in good shape and I feel that the inclusion of the clarifications resulting from the rebuttal further improves its quality; I have bumped my score (4->5) accordingly.
Formatting concerns
N/A.
4 comments
Rebuttal
Thank you for the careful and constructive reading, and for recognizing the originality and clarity of the work. We will address all identified notation, typographical, and minor presentation issues, and will thoroughly polish the bibliography formatting in the revision.
W1: Comparison with [6] Chatalic et al. (2025)
We will revise the comparison. The two approaches have complementary strengths. Chatalic et al. apply to a substantially broader class of kernels and are better suited to high-dimensional settings (where our algorithm would run slow in practice), whereas our method requires low-dimensional OS/AOS approximately separable structure.
Within this more restricted regime, however, our guarantees are stronger relative to the full MMD test: for OS kernels, we compute exactly the same statistic and incur no power loss; for AOS kernels, Lemma 1 gives a direct deterministic comparison with the full permutation test through the approximation error . Building on these results, we establish minimax optimality under both$L^2$ and MMD separation, together with subquadratic-time guarantees, for a specified class of kernels and arbitrary underlying distributions. In contrast, Chatalic et al. (2025) establish minimax optimality under MMD separation, subject to a polynomial spectral decay condition on the pooled covariance operator. Their sufficient landmark budget, and hence the resulting computational complexity, depends on the spectral decay parameter , which is determined by the kernel and the distributions and . Thus, in settings where a Nyström approximation loses power because its landmark budget is insufficient, our method would remain closer to full-MMD power whenever the AOS error is controlled. We therefore view the methods as complementary tools rather than uniformly ordered competitors, and will add both a concise theoretical comparison and Nyström baselines to the experiments.
For this comparison, we use the two-dimensional Gaussian-grid benchmark of Gretton et al. (2012b): equally weighted mixtures on a grid with spacing , covariance under the null, and covariance under the alternative, so the difference is only in the local correlation structure. We follow their bandwidth choice.
| Method | 500 | 1000 | 1500 | 2000 | 2500 | 3000 | 3500 | 4000 | 4500 |
|---|---|---|---|---|---|---|---|---|---|
| Full MMD | 0.230 | 0.530 | 0.470 | 0.580 | 0.620 | 0.670 | 0.610 | 0.640 | 0.760 |
| RFF MMD | 0.090 | 0.290 | 0.250 | 0.360 | 0.450 | 0.400 | 0.390 | 0.370 | 0.500 |
| Nyström AKRLS | 0.030 | 0.220 | 0.260 | 0.410 | 0.480 | 0.450 | 0.460 | 0.440 | 0.550 |
| Fenwick MMD | 0.250 | 0.550 | 0.480 | 0.570 | 0.640 | 0.670 | 0.620 | 0.650 | 0.760 |
| CTT (g=3) | 0.136 | 0.145 | 0.422 | 0.516 | 0.513 | 0.490 | 0.445 | 0.393 | 0.660 |
| Linear MMD | 0.040 | 0.080 | 0.060 | 0.070 | 0.070 | 0.040 | 0.070 | 0.070 | 0.140 |
| Block MMD | 0.070 | 0.120 | 0.100 | 0.250 | 0.200 | 0.270 | 0.280 | 0.300 | 0.400 |
| Incomplete U | 0.160 | 0.370 | 0.290 | 0.400 | 0.480 | 0.420 | 0.360 | 0.430 | 0.540 |
Lemma 4
We agree and will make these connections explicit.
W2: Euclidean space
We agree and will state this explicitly in the abstract and introduction.
W3,4: Notations, Section 3.2
We greatly appreciate these comments, and we will incorporate all of the suggested corrections and clarifications into the revised manuscript.
Q1: Relationship to [6]
Please see above.
Q2: Gain over [3]
We build directly on [3] and will make this connection clearer. Beyond extending the computation from to , our contributions include the OS/AOS framework and approximation bounds, non-asymptotic approximation-to-power and minimax guarantees, lower and upper bounds for the minimax separation rate when grows with , and a theoretical analysis of PCA-MMD under a latent low-dimensional signal model. In contrast, [3] develops the exact univariate computation and projection-based multivariate extensions, but does not provide these approximation, minimax, growing-dimensional, or PCA guarantees.
Q3: Theoretical vs empirical bandwidth
We clarify that our experiments are not intended to verify the theoretical minimax rate under shrinking alternatives. Since our method approximates the full MMD statistic, their primary purpose is to evaluate whether it can closely retain the power of full MMD under a practical bandwidth choice while reducing computational cost. We therefore use the median heuristic, a standard practical choice for MMD tests; for further discussion of practical bandwidth selection, we refer to Gretton et al. (2012).
If one seeks an experimental setup more closely aligned with the minimax analysis, the bandwidth should vary with the sample size. In our Theorem 2, the minimax-optimal bandwidth for separation is , although this oracle choice depends on the unknown smoothness parameter . A practical way to avoid this dependence is to use the aggregated test of Schrab et al. (2023), which combines tests over a collection of bandwidths selected independently of . While bandwidth selection is an important problem, the main novelty of our work is the efficient approximation of the full MMD statistic, and we therefore adopted a simple bandwidth rule in the current experiments. Nevertheless, our method can be applied separately to each bandwidth in the aggregation procedure with only a logarithmic computational overhead, while retaining subquadratic runtime.
Q4: Kernel tail constraints
We thank the reviewer for this clarification. There is substantial overlap: [9] covers Gaussian, Matérn, and IMQ kernels when its accompanying assumptions on the data distributions and auxiliary kernel are satisfied, so its results are transferable in those regimes. Our distinction is not a disjoint kernel family, but that our MMD-separation result removes distribution-tail assumptions at the cost of requiring OS/AOS product structure and low dimension. We will revise Remark 1 to state this more accurately.
Q5: Section 5 purpose
Purpose and formulation of Section 5
Section 5 is a modular extension rather than part of the core OS/AOS approximation analysis. Its purpose is to address the complementary setting where the ambient dimension is large but the distributional difference lies in a low-dimensional subspace: PCA reduces the problem to dimension , after which the same fast MMD procedure is applied.
In Algorithm 8, PCA is fitted to the pooled, unlabeled split , and testing is performed on the held-out projected observations. In the experiments, PCA is instead fitted to the full pooled sample. This remains label-invariant and hence preserves permutation validity; sample splitting is used in the theorem to simplify the power analysis. We will make this distinction explicit.
Assumption 1 notation
Assumption 1 is intended as a generic strong-regularity condition, imposed on both latent variables and . Under independent isotropic Gaussian noise, the observed variables and inherit this condition up to constants, which enables the covariance-estimation argument. The reference to in Remark 3 is only a generic placeholder. We will restate the assumption for a generic random vector, correct Lemma 3 to refer explicitly to , and make the inheritance to explicit.
References
Schrab, A., Kim, I., Albert, M., Laurent, B., Guedj, B., and Gretton, A. MMD Aggregated Two-Sample Test. JMLR (2023).
Gretton, A., Sejdinovic, D., Strathmann, H., Balakrishnan, S., Pontil, M., Fukumizu, K., and Sriperumbudur, B. K. Optimal Kernel Choice for Large-Scale Two-Sample Tests. NIPS (2012).
Dear Reviewer CoNr,
Thank you once again for your thoughtful feedback. In our rebuttal, we have addressed your comments by including empirical and theoretical comparisons with prior work, details regarding the choice of kernel bandwidth and tail constraints, and clarification on Section 5 (PCA).
As the discussion period comes to an end, we would greatly appreciate it if you could let us know whether our responses have addressed your concerns or if there are any remaining issues that you would like us to clarify. If you find our rebuttal satisfactory, we would also be grateful if you could reflect this in your final evaluation.
Thank you again for your time and consideration.
I thank the authors for the additional clarifications. The manuscript was already in good shape and I feel that the inclusion of these clarifications further improves its quality; I have bumped my score (4->5) accordingly.
We thank the reviewer for the encouraging comments. We are pleased that the additional clarifications addressed the reviewer's concerns, and we appreciate the reviewer's updated assessment of our work.
- Rating
- 4/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper studies how to make the other-wise quadratic kernel MMD two-sample testing computationally cheaper while maintaining minimax optimal sample complexity rates. By exploiting structural property found in common kernels, the MMD distance can be reduced to a small number of lower-triangular kernel sums and computed efficiently. For general kernels, approximations with separable kernels can be made with explicit error bounds.
Strengths and weaknesses
Strengths:
-
The studied problem is not only theoretically motivated but also practically relevant. Speeding up MMD calculation while maintaining minimax optimal sample complexity has many potential applications in scaling up large statistical tests.
-
The experiment message is clear and significant: the proposed method stands at the frontier in the runtime-power tradeoff.
Weaknesses:
-
The dependence on the dimension is exponential. Furthermore, the discussion of time focuses on the cost of computing one MMD statistic, omitting the end-to-end cost (in time) of the permutation test, which may be significant depending on the value of alpha (because B needs to be lower bounded).
-
The main results still rely fairly critically on the assumptions on the kernel: in particular that it must have a low orthantwise-separation rank. The claims of the paper are more accurately over a family of tensor-product kernels, not over characteristic kernels generally.
Questions
Q1: The theory depends on bandwidth choices of smoothness s: what are the costs with misspecified s? In practice, beyond the median heuristics what other ways can one choose the bandwidth practically? Can you elaborate on the tradeoff between power vs. runtime when choosing approximation budget? Without systematic testing and ablation of these heuristic choices in experiments (e.g. why are R_i=3) I feel like the practical message may not be as strong as advertised.
Q2: With your techniques, does there exist online-analogs of any flavor?
Limitations
yes
Final justification
This paper studies how to make the other-wise quadratic kernel MMD two-sample testing computationally cheaper while maintaining minimax optimal sample complexity rates. The results are nicely presented, and the authors have made many efforts in addressing my comments in the rebuttal.
Formatting concerns
N/A
3 comments
Rebuttal
We thank the reviewer for the positive assessment and constructive questions. We agree that the end-to-end permutation cost, dimensional dependence, kernel scope, and practical parameter choices should be stated more clearly. We address each point below.
W1: End-to-end permutation cost and dimensional dependence
We agree that reporting only the cost of one MMD statistic understates the cost of the complete permutation test. We will therefore report the time for the end-to-end time for the full permutation test, for both the existing and future experiments. In addition, we discuss the theoretical computational complexity as follows. Let denote the total number of orthantwise-separable terms. Using the improved Fenwick construction, one statistic costs ; hence, a test with permutations costs
The pooled coordinate ranks, auxiliary ranks, kernel-expansion coefficients, and compressed-tree geometry are label-independent and can be reused across permutations. The pooled sum can also be computed once. However, the label-dependent within-sample sums must be recomputed for each permutation.
For fixed , this bound is independent of and , so it does not change the asymptotic exponent in . We will revise the experiments to report the end-to-end runtime of the full permutation test with the stated value of .
W2: Scope of the kernel class
Indeed, the exact algorithm applies to orthantwise-separable kernels, and the approximate algorithm applies to -almost orthantwise-separable kernels. We do not claim that arbitrary characteristic kernels admit our acceleration. We will revise the paper to clarify that our theory covers tensor-product kernels constructed from several popular characteristic kernels for which we establish exact or controlled separable approximations, rather than generic characteristic kernels.
Q1: Misspecified
Theory: We agree that our current theory is developed under oracle knowledge of the unknown smoothness parameter . A fully rigorous adaptive guarantee would require additional work, but we can outline how our framework may extend to unknown . The aggregated MMD test in Schrab et al. (2023, Sections 3.5-3.6 and Corollary 10) considers bandwidths chosen independently of and achieves the minimax rate up to logarithmic factors. Running our Fenwick algorithm separately for each test with different bandwidth adds an multiplicative overhead to the single Fenwick computation time; hence, the resulting aggregated procedure remains subquadratic. In addition, our Theorem 2 controls the kernel approximation error by requiring . One may instead use the more conservative, -independent choice . The required number of separable terms still remains polylogarithmic in , so the approximation step also preserves the subquadratic runtime.
Practical: Beyond the median heuristic, several practical bandwidth-selection approaches are compatible with our computational framework and do not violate subquadratic complexity. For the aggregated test, Schrab et al. (2023) construct a bandwidth grid from inter-point distances computed using a fixed subsample (at most approximately 500 observations from each sample) so this preprocessing cost does not grow with the full sample size. For a single-bandwidth test, one can instead use the max-ratio criterion of Gretton et al. (2012), which selects the candidate bandwidth maximizing the estimated MMD relative to its estimated standard deviation and can outperform the median heuristic in practice.
Q1-2: Ablation studies
For the Gaussian kernel, increasing reduces the approximation error exponentially, so a modest increase in can make the approximated MMD substantially closer to the full MMD. However, once the approximation error is below the statistical error scale, further increasing is unlikely to yield meaningful power gains and mainly increases runtime. Across our experiments, already appeared sufficient to closely match the power of full MMD, so we used it as a computationally inexpensive practical operating point rather than as a theoretically optimal choice.
We added a growing-dimensional stress test with and , with the null being the standard Gaussian and mean-shift alternative affecting every coordinate. We compare with full Gaussian MMD (unapproximated kernel matrix) with approximation budgets . We note that the variance-shift alternative gave similar results. Even when the statistic has large relative error for small , power and -value errors remain small because the relative error need not translate into permutation-test error; for example, positive kernel rescaling changes relative error yet leaves the permutation test unchanged. The dimensional degradation is observable when the approximation budget is too small, but a modest increase in the budget controls it well through in these experiments. We will add these results and clarify that they provide empirical evidence over the tested range rather than removing the worst-case exponential dependence on .
Mean-shift by — Power
| Method | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0.180 | 0.360 | 0.350 | 0.600 | 0.610 | 0.720 | 0.670 | 0.770 | 0.830 | 0.810 | |
| 0.190 | 0.360 | 0.370 | 0.600 | 0.630 | 0.750 | 0.670 | 0.760 | 0.830 | 0.830 | |
| 0.190 | 0.360 | 0.370 | 0.600 | 0.620 | 0.750 | 0.670 | 0.760 | 0.830 | 0.830 | |
| Full MMD | 0.190 | 0.360 | 0.370 | 0.600 | 0.620 | 0.750 | 0.670 | 0.760 | 0.830 | 0.830 |
Mean-shift by — Relative error in the statistic
| Method | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0.1552 | 0.1137 | 0.1440 | 0.1856 | 0.1876 | 0.2689 | 0.3606 | 0.4393 | 0.4906 | 0.5661 | |
| 0.0073 | 0.0086 | 0.0118 | 0.0142 | 0.0181 | 0.0215 | 0.0267 | 0.0287 | 0.0332 | 0.0363 | |
| 0.0012 | 0.0009 | 0.0009 | 0.0012 | 0.0008 | 0.0011 | 0.0019 | 0.0020 | 0.0022 | 0.0025 |
Mean-shift by — -value error
| Method | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0.0096 | 0.0092 | 0.0085 | 0.0062 | 0.0075 | 0.0049 | 0.0076 | 0.0057 | 0.0047 | 0.0041 | |
| 0.0008 | 0.0004 | 0.0002 | 0.0004 | 0.0006 | 0.0000 | 0.0002 | 0.0005 | 0.0000 | 0.0000 | |
| 0.0002 | 0.0000 | 0.0001 | 0.0001 | 0.0002 | 0.0000 | 0.0001 | 0.0002 | 0.0000 | 0.0000 |
Q2: Online analogs
Our fast computation for separable kernels relies on coordinate-wise comparisons between data points. In the current implementation, the Fenwick tree requires rank compression as a preprocessing step, and is therefore naturally suited to the offline setting. We expect that a computational online analogue may be possible by replacing the Fenwick tree with a dynamic range tree, which can support insertions and coordinate-wise range queries without access to the full dataset in advance. We emphasize, however, that this would address only the online computation of the MMD statistic. Since our current test is calibrated through permutations of the pooled sample, establishing a valid testing procedure in the online setting would require a different calibration argument. We view this as an interesting direction for future work beyond the scope of the present paper.
References
Schrab, A., Kim, I., Albert, M., Laurent, B., Guedj, B., and Gretton, A. MMD Aggregated Two-Sample Test. JMLR (2023).
Gretton, A., Sejdinovic, D., Strathmann, H., Balakrishnan, S., Pontil, M., Fukumizu, K., and Sriperumbudur, B. K. Optimal Kernel Choice for Large-Scale Two-Sample Tests. NIPS (2012).
Thank you for your careful response. I will maintain my score.
We thank the reviewer for the careful evaluation and thoughtful comments. We are pleased that our responses were helpful, and we appreciate the reviewer's continued positive assessment of our work.
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
Repost of Our Response to the AC Meta-Review
We realized that the comments we posted during the author rebuttal period in response to the AC's meta-review are not visible to the other reviewers. Therefore, to share our response with everyone, we are reposting it here as an official comment.
The official comment below is a copy of the response that we originally posted under the meta-review. If there are any additional questions that we can help address, please feel free to let us know.