Methods: approximate models

This page covers the techniques that change the model, not only the linear solve: random Fourier features, the atomic inducing posterior, inducing-point derivative GPs, the far-field kernel and the local band. The entry form is the one on the section index. The solves are on the solvers page.

Status: explanation. Hashes are ancestors of origin/develop at e944f60acc unless the text says otherwise.

Random Fourier features, fixed count

What it is. RFFModel approximates the squared-exponential kernel on the inverse-distance descriptor with \(D_{\mathrm{rff}}\) random cosine features and solves Bayesian linear regression in feature space. The frequencies come from the spectral density with a fixed seed. Training costs \(O(ND\,D_{\mathrm{rff}}+D_{\mathrm{rff}}^{3})\) and a prediction costs \(O(D_{\mathrm{rff}}D)\) per point (gpr/ml/RFFModel.h). The design matrix has energy rows and gradient rows. A constant column carries the energy offset (9201873bc).

Status. On develop, opt-in. The default is 0 (off).

Use.

Surface

Name

CLI

--rff-features N in gprn and gprd

TOML

[uncertainty] rff_features

Python

GaussianProcess(..., uncertainty”laplace”, rff_features=N)=

C

gpr_model_config_t.rff_features, gpr_model_set_rff_features

C++

GaussianProcessRegression::setRFFFeaturesRequested

The model replaces the exact solve only when \(n(1+D)\ge2D_{\mathrm{rff}}\). Below that the exact path runs and the result is bit-identical (3b04607b1). The classic profiles chemgp and gprd_zbl reset a fixed count to 0, so use --gp-model-profile extended (docs/orgmode/howto/gp_settings.org).

Measured.

  • Two Ar atoms with 30 training configurations (design of 210 rows): the exact model has an energy error of 0.094 meV and a force error of 1.163 meV/A. With 64 features the errors are 1.799 meV and 27.066 meV/A. With 512 features the threshold of 1024 is not met, so the result equals the exact one (gp_settings.org).

  • PET-MAD d016, 4 ranks, 64 features in the dimer loop: wall 78.18 s and a NaN endpoint at the first version. After fixes the 64-feature run took 77.16 s and ended at -14.887, “a non-physical basin”. With 256 features it took 12.02 s and ended at -7.18578 (56ceb6425, ea1849406).

  • ChemGP quality bench, C2H4NO with 30 training points: “RFF gradient MAE plateaus at ~0.4 eV/A even at D_rff=400, vs exact GP gradient MAE 0.26 eV/A” (9201873bc).

Why it stays opt-in. “RFF – not applied to the dimer hot loop; stays as a primitive for post-training surrogates / large-N corpora” (9201873bc). A count that is too small gives a wrong surrogate, not a slow one (gp_settings.org).

Random Fourier features, automatic count

What it is. The count doubles from 1 through powers of two until the random-feature posterior matches the exact GP on a held-out set to within a fraction of the force tolerance of 0.0514221 eV/A. A count that misses is refused and no smaller count is installed (fe78e72c7). The acceptance test compares posteriors, not kernel samples.

Status. On develop, opt-in, landed 2026-11-17. The default stays 0. A run that does not ask for it keeps the exact posterior byte for byte.

Use. --rff-features auto, [uncertainty] rff_features = "auto", rff_features”auto”= in Python, gpr_model_set_rff_features(model, -1, f) in C. The report is gp.rff_selection in Python and gpr_model_get_rff_selection in C. See Choose the random-feature count automatically.

Measured.

  • PR 223, 811 geometries of 135 coordinates: the full Gram matrix has 110296 rows and 97321660928 bytes (90.64 GiB). The validation prefix fits 42 geometries, 5712 joint rows, with a count limit of 2048 (tests/gpr/ml/RFFFeatureSelectionTest.cpp).

  • A 4-geometry subsample of the same surface: 512 features gave an energy difference of \(1.90314\times10^{-4}\) eV and a force difference of 0.0362025 eV/A. 2048 features gave \(3.80218\times10^{-6}\) eV and 0.00250762 eV/A. 8192 features gave \(1.60674\times10^{-6}\) eV and 0.00142925 eV/A (gp_settings.org; ledger 2026-11-17 04:12).

  • No wall time or speed-up is recorded for the automatic rule.

A-priori bound

What it is. A uniform error bound that would tell the user how many features to use.

Status. Measured, not adopted. PR 223 was closed.

Measured. “Pull request 223 measured the mixed-second sufficient count at \(2.5250\times10^{19}\) on an 811-geometry, 135-coordinate gradient GP” (gp_settings.org). The header comment of RFFFeatureSelection.h gives \(10^{12}\) to \(10^{19}\) features. The ledger gives \(10^{12}\) for the kernel alone and notes that an exact out-of-core factor would need a new tiled abstraction, about 45 GiB packed and \(4.5\times10^{14}\) operations (ledger 2026-11-17 04:12).

Why. The bound is far larger than any usable count. The replacement is the held-out rule above.

Derivatives and curvature

The features carry the descriptor Jacobian, so energy, gradient and curvature come from the same feature map. The Hessian-vector product of a random-feature posterior mean is the exact cosine-feature curvature through that Jacobian, plus the inverse-distance descriptor curvature (gpr/ml/gp/ActivePosterior.cpp). MeanHessianVectorIsExactAndMakesNoPredictions checks it against a Richardson difference of the mean and against a frozen potential-call count. A ledger entry claims RFF derivatives on an ABI 1.3 branch (ledger 2026-11-13); those commits are not in the tree.

CUTLASS and GPU

What it is. An optional CUTLASS double-precision GEMM facade for the two normal-equation products of the random-feature fit (gpr/linalg/CutlassGemm.h). Cholesky and triangular solves stay in the KernelInverse implementations.

Status. On develop, opt-in at build time: -Duse_cutlass=true, default false. No workflow sets it. A KernelInverse with CUTLASS is design intent only, and CusolverInverse is built but unused by RFFModel::build (docs/orgmode/development/design/cutlass_rff_kernelinverse.org).

Measured. “The GPU tests have not been run for this page.” No speed-up is recorded.

Spectral approximation branch

Measured, not adopted. improve/spectral-approx (fbe3a09b0, not in the clone): “RFF with 4096 features has 0.02-0.05 kernel error; Sollya minimax exp is certified but slower than libm; dense factor of 4480 rows takes 0.366 s.” (ledger 2026-11-13 16:36).

Atomic inducing posterior

What it is. An experimental GP whose energy is a sum of atomic contributions with a species-aware SE kernel on normalised SOAP descriptors. The fit minimises the Titsias (2009) variational free energy on inducing “representative environments”, using energy and Cartesian derivative observations. Only inducing-sized matrices are factored. The predictive variance keeps \(K-Q\), so directions that the inducing set does not span keep the prior variance. The class is gpr::AtomicInducingPosterior (docs/atomic_environments.md).

The negative bound is \(\tfrac12\left[y^{T}(Q+D)^{-1}y+\log|Q+D|+n\log2\pi+\operatorname{tr}\{D^{-1}(K-Q)\}\right]\) with \(Q=CU^{-1}C^{T}\).

Status. On develop, opt-in, experimental (040c2128d, 2026-10-22). “The default is false. This model has no validated production speedup claim.”

Use. --gp-atomic-environments true in gprn and gprd; GPNEBConfig::atomic_environments; GaussianProcessRegression::setAtomicEnvironmentModel. It has no TOML key, no C or Fortran function and no Python name. It needs a build with featomic (-Duse_featomic). See Use the atomic inducing posterior.

Measured. No number recorded. The tests compare against a dense reference: objective agreement to \(2\times10^{-9}\) and values to \(10^{-12}\) (tests/gpr/ml/AtomicInducingPosteriorTest.cpp). Those are test bounds. The paper campaign does not use the model.

Inducing-point derivative GP on a branch

Status. Branch only. sparse-derivative-gp (a7e2b3ea, e906c7b4, bbef92ad, e81c25a5) is not in the clone or on develop. It is a separate design from the atomic inducing posterior, with a C API for the posterior and its Hessian.

Recorded numbers (ledger only; they cannot be reproduced from the tree).

  • The first commit “matches dense to 1e-8 when Z=X; train linear in n” (2026-11-12 20:42).

  • The second, with pivoted-Cholesky inducing selection and an analytic gradient: “n=2000 m=100 MB: 2.90 s vs dense 5.27 s, RMSE 1.8e-6/1.0e-5” (2026-11-12 21:02). The meaning of “MB” and of the two RMSE values is not explained.

  • An instanton study on the branch: “LJ75 tangent <0.15 on 12 seeds with 20 gradients vs 450 for a dense Hessian; not merged” (2026-11-13 17:59).

Other adjacent code that is built but unused

  • LowRankCholesky, DerivativeVecchia, DerivativeSKI and IterGP are on the solvers page.

  • A random Fourier or inducing route is open as a ledger task with no result: “inducing/Nystrom/D-SKIP with derivatives” and “principled RFF sizing + derivative RFF” (ledger task list).

Far-field kernel

What it is. With a positive far-field radius, a moving atom and a frozen atom farther apart than the radius are replaced in the inverse-distance feature by a dipole expansion about the moving atom (gpr/auxiliary/FarField.h, commit 284824ef5). The expansion is part of the model. It uses a fixed reference geometry and applies to every covariance block, to HS-SVD prediction and to the random features (b744bc5b3). Radius 0 keeps the exact pairs.

Status. On develop, opt-in, C++ only (1ef3f66ef, 2026-11-03). There is no flag, key, Python name or C function.

Use. gpr::SexpatCF::setFarFieldRadius(double), aux::Distance::setFarFieldRadius and aux::Gradient::setFarFieldRadius. The feature map needs fixed reference positions and an exclusive cutoff.

Measured. The tests bound the errors. The dipole distance and the covariance agree within a relative \(10^{-3}\), the slope within \(2\times10^{-3}\), and the gradient within \(3\times10^{-2}\), which the commit describes as “a few percent” (tests/gpr/auxiliary/FarFieldKernelTest.cpp, 14ac49078). No end-to-end search benefit is recorded.

Radial far-field list

What it is. An alternative assembly loop over a radial list instead of the direct loop.

Status. On develop, opt-in, off by default. Measured, not adopted.

Measured. The ladder log docs/verification/far-field-ladder.txt holds one session on one machine, with a radius of 6 and five repeats.

Kind

Atoms

Direct loop (s)

Radial list (s)

Worst relative error

silicon

63

2.125e-03

6.107e-02

7.67e-04

silicon

215

9.918e-03

7.021e-02

3.16e-05

silicon

511

2.391e-02

8.481e-02

1.27e-04

silicon

999

4.639e-02

1.075e-01

1.75e-04

silicon

1727

8.026e-02

1.485e-01

1.92e-04

silicon

4095

1.899e-01

2.731e-01

2.03e-04

silicon

7999

3.767e-01

4.711e-01

2.04e-04

lattice

8000

3.709e-01

4.189e-01

9.45e-04

lattice

16000

7.564e-01

8.423e-01

2.62e-03

lattice

32000

1.471e+00

1.688e+00

1.39e-03

The radial list is slower in every row. “The program that wrote the log is not in this repository, so the measurement cannot be repeated from the tree.” Nothing above 32000 atoms was measured (docs/verification/far-field-list.md).

Local band and the pair cutoff

What it is. A local Cartesian GP on the atoms that carry the path motion, on top of a cubic B-spline pair-additive baseline with a 9.5 A cutoff. The rest of the system relaxes on the baseline Hessian (docs/orgmode/explanation/gp_local_band.org).

Status. On develop, opt-in: --nebmode gp_local, gpr_neb_search_local. --gp-pair-cutoff A (default 0) with --gp-pair-cutoff-width adds compact pair features to the full GP. No benchmark number is recorded for either. The heptamer example in the page has 343 atoms, 175 in the band and 168 frozen.

Nystrom-sketched L-BFGS start matrix

What it is. A randomised Nystrom sketch of the chain Hessian used as the initial matrix of the band L-BFGS loop, built from \(k\) Hessian-vector probes on the GP mean (2a61a8d24, bebb908e1).

Status. On develop, opt-in: --neb-lbfgs-sketch-h0-rank N (default 0, bit-identical) and --neb-lbfgs-sketch-h0-eps. The SIDPP hybrid that used it was reverted (ba16e6426, no reason recorded). No benchmark number is recorded.