arXiv:2609.35177cs.LGSep 2026

Manuscript Offprint

arXiv:2609.35177

Subgroup Rank-1 Lattice for Practical High-dimensional Black-box Integral Approximation

Yueming Lyu

Abstract

Estimating integrals of black-box, high-dimensional functions (expectations, normalizing constants, kernel mean embeddings, or the softmax kernel inside the self-attention of large language models) is a basic subroutine in machine learning. Rank-1 lattice rules suit this setting because they query the integrand only at a point set fixed in advance and need no gradients. When the nn lattice points are also used as a design matrix X∈Rn×dX \in \mathbb{R}^{n \times d} for a feature map, however, applying an elementwise nonlinearity Ψ\Psi and then aggregating, Y=Ψ(X)⊤vY = \Psi(X)^\top v, or expanding, u=Ψ(X)wu = \Psi(X)w, costs O(nd)O(nd) time and O(nd)O(nd) memory for any standard quasi-Monte Carlo point set. This becomes prohibitive when nn and dd are both large. We study subgroup rank-1 lattices, whose Korobov power-form generator (1,t,…,td−1)(1, t, \ldots, t^{d-1}) uses a scalar tt of fixed, nn-independent multiplicative order mm. Splitting Fn×\mathbb{F}_n^\times into the cosets of ⟨t⟩\langle t \rangle reduces both maps to short cyclic correlations evaluated by FFT, so YY and uu are computed exactly, for an arbitrary Ψ\Psi, in O(nlog⁡m)O(n \log m) time (O(nlog⁡d)(O(n \log d) when m=Θ(d)m = \Theta(d)) and O(n)O(n) memory, without ever forming XX. Fixing mm places the rule outside the classical component-by-component averaging theory, so we prove convergence directly: using resultants with the cyclotomic polynomial Φm\Phi_m, we show that for prime m≥d+1m \geq d+1 the squared worst-case error in the Korobov space decays as O(n−(α−1)/(m−1))O(n^{-(\alpha-1)/(m-1)}), and that this threshold is exact, since for m≤dm \leq d the error has an nn-independent floor. Using the complete splitting of nn in Q(ζm)\mathbb{Q}(\zeta_m), we further show that averaging over the m−1m-1 admissible generators improves the constant by a factor Θ(m−1)\Theta(m-1). Empirically, the subgroup lattice is more accurate than Gaussian random features, orthogonal random features, and scrambled Sobol' and Halton points in 49 of 54 synthetic kernel-estimation settings and in all 45 softmax-attention settings on nine real embedding datasets. At d=2048d = 2048 and n≈4.1×107n \approx 4.1 \times 10^7 it builds its sample set in 2.3 ms, against 0.55 s for Gaussian sampling and minutes to hours for the other baselines.

Keywords: quasi-Monte Carlo, rank-1 lattice rules, elementwise nonlinear feature maps, Korobov space, worst-case error, fast Fourier transform, cyclotomic polynomials, numerical integration

1 Introduction

Many computations in machine learning reduce to estimating an integral of a black-box function over a high-dimensional domain: an expectation under a model, a normalizing constant, a kernel mean embedding, or a shift-invariant kernel written as an expectation over random frequencies (Rahimi and Recht, 2007). The last case now sits inside large language models, where linear-time attention mechanisms replace the softmax kernel exp⁡(x⊤y)\exp(\mathbf{x}^\top \mathbf{y}) by a Monte Carlo average of random features (Choromanski et al., 2021). In this setting the integrand can be queried only through its values: gradients are unavailable or expensive, and

© Yueming LYU.

License: CC-BY 4.0, see https://creativecommons.org/licenses/by/4.0/.

no tractable density is exposed. Sampling-based methods such as Langevin and stochastic-gradient Monte Carlo (Roberts and Tweedie, 1996; Welling and Teh, 2011) rely on exactly this missing gradient information, and gradient-free Metropolis–Hastings samplers (Robert and Casella, 2004) return a correlated, sequentially generated chain rather than a fixed design. Quasi-Monte Carlo (QMC) quadrature needs neither. It evaluates the integrand on a deterministic point set fixed in advance, so the evaluations are embarrassingly parallel and the same points can be reused across many integrands. Among QMC constructions, the rank-1 lattice rule is one of the simplest and most widely used: its nn points {lz/n}\{l\mathbf{z}/n\}, l=0,…,n−1l=0,\ldots,n-1, are determined by a single generating vector z∈(Z/nZ)d\mathbf{z}\in(\mathbb{Z}/n\mathbb{Z})^d, and a well-chosen z\mathbf{z} attains a squared worst-case error of order n−α+δn^{-\alpha+\delta}, for any δ>0\delta>0, in the Korobov space of smoothness α\alpha (Sloan and Reztsov, 2002; Kuo, 2003; Dick et al., 2013).

In machine learning, however, a QMC point set is rarely used only to average function values. Its nn points form a design matrix X∈Rn×dX \in \mathbb{R}^{n \times d} that is passed through a scalar nonlinearity Ψ\Psi applied entrywise and then combined linearly with data. A QMC feature map for a shift-invariant kernel (Avron et al., 2016) is the standard example, and the positive random features used for softmax attention (Choromanski et al., 2021) have the same form. Two operations recur: aggregating nn per-point values into dd per-coordinate summaries, Y=Ψ(X)⊤vY = \Psi(X)^\top v, and expanding dd coefficients to all nn points, u=Ψ(X)wu = \Psi(X)w. Computed from their definitions, both cost O(nd)O(nd) time, O(nd)O(nd) evaluations of Ψ\Psi, and O(nd)O(nd) memory to hold XX or Ψ(X)\Psi(X). This is the cost for every standard point set, whether a Halton or Sobol' sequence (Halton, 1960; Sobol', 1967) or a rank-1 lattice with a generating vector found by the component-by-component (CBC) algorithm (Sloan and Reztsov, 2002; Kuo, 2003; Nuyens and Cools, 2006a), because none of these constructions relates its dd coordinates to one another in a way the computation could exploit. The product ndnd is the problem. Accurate estimates in high dimension need both nn and dd large at once, and at d=2048d = 2048 with n≈4.1×107n \approx 4.1 \times 10^7, the largest setting in our experiments, XX has about 8.4×10108.4 \times 10^{10} entries, roughly 670 GB in double precision. Direct evaluation is then not slow but impossible, and even generating the point set takes minutes to hours for scrambled Sobol', Halton, or orthogonal random features (Section 8.1.2).

This paper shows that a specific structured rank-1 lattice removes the factor of dd from both time and memory. We use the classical Korobov power-form generator z(t)=(1,t,…,td−1) mod n\mathbf{z}(t) = (1, t, \ldots, t^{d-1}) \bmod n (Korobov, 1959), with nn prime, and require the scalar t∈Fn×t \in \mathbb{F}_n^\times to have a small multiplicative order m∣n−1m \mid n - 1 that is fixed independently of nn. We call the result a subgroup rank-1 lattice. The restriction organizes Fn×\mathbb{F}_n^\times into q=(n−1)/mq = (n - 1)/m cosets of the order-mm subgroup H=⟨t⟩H = \langle t \rangle. Multiplication by tt acts on each coset as a cyclic shift, so every coordinate of every lattice point is an entry of one of qq short sequences of length mm, and the elementwise transform on each coset becomes a single length-mm cyclic correlation, which an FFT evaluates in O(mlog⁡m)O(m \log m) time. Processing the cosets one at a time gives YY and uu exactly, for an arbitrary Ψ\Psi, in O(nlog⁡m)O(n \log m) time and O(n)O(n) memory, which is O(nlog⁡d)O(n \log d) time when m=Θ(d)m = \Theta(d). The matrix XX is never formed.

The restriction has a price that the classical theory does not cover. As nn grows, only the φ(m)\varphi(m) elements of order mm are admissible values of tt, a pool that stays fixed while Fn×\mathbb{F}_n^\times grows. CBC would not select such a generator, and the averaging arguments behind CBC error bounds, which average over a candidate pool that grows with nn, cannot be applied. Whether a subgroup rank-1 lattice converges at all is therefore a genuine question. We answer it directly. Writing the aliasing condition h⋅z(t)≡0(modn)\mathbf{h} \cdot \mathbf{z}(t) \equiv 0 \pmod{n} as the vanishing of an integer polynomial at a root of the cyclotomic polynomial Φm\Phi_m modulo nn, and bounding the corresponding resultant, we show that for prime m≥d+1m \geq d+1 the squared worst-case error decays as O(n−(α−1)/(m−1))O(n^{-(\alpha-1)/(m-1)}) for every admissible tt, and that for m≤dm \leq d it is bounded below by a constant for all nn. This exponent is weaker than the one CBC certifies for a generic generating vector. What the theorem establishes is that the structure needed for the fast transform is compatible with convergence, and it identifies the exact dimension threshold at which convergence is lost. Using the complete splitting of nn in the cyclotomic field Q(ζm)\mathbb{Q}(\zeta_m), we then show that averaging over the m−1m-1 admissible generators improves the constant by a factor Θ(m−1)\Theta(m-1), which justifies choosing the best member of this small pool.

Empirically, the subgroup rank-1 lattice is both faster and more accurate than the feature-map constructions in common use. With the best of the m−1m-1 generators selected once on a held-out batch and cached, it gives the lowest error of five constructions in 49 of 54 synthetic kernel-estimation settings and in all 45 softmax-attention settings on nine real embedding datasets, and it builds its complete sample set at d=2048d = 2048 and n≈4.1×107n \approx 4.1 \times 10^7 in 2.3 ms.

References (51)