TPE acquisition for GP-OIE oracle targeting¶
Status: implemented, and the default. --acquisition tpe selects it, GPNEBConfig::acquisition defaults to AcquisitionType::TPE (gpr/neb/GPNEB.h), and the schema field NebParams.acquisition defaults to tpe (schema/params.capnp). The policy is in gpr/neb/oie/AcquisitionPolicy.h and gpr/neb/oie/AcquisitionPolicy.cpp, and gpr/neb/GPNEB.cpp calls it. The page replaces an earlier design draft; the last section lists where the code departs from that draft.
What it decides¶
The GP-OIE outer loop of gprn spends oracle calls on interior images of the band. Each outer iteration needs a target: the image that gets the next true energy and force. The policy picks that image from the posterior of the per-image GP. It uses a Tree-structured Parzen Estimator (TPE, Bergstra et al. 2011, as in Optuna’s TPESampler) over the discrete interior image index. A utility scores each interior image. The pick is the image with the largest log density ratio of the best-scoring images to the rest.
The policy takes four whole-band vectors, indexed 0 .. n_images-1: the posterior energies, the posterior energy variances, the NEB force norms and the posterior force variances. The endpoints are never targets.
Where it runs in the outer loop¶
gpr/neb/GPNEB.cpp first builds a target decision with OieOracleTargetPlanner (declared in gpr/neb/GPNEB.h). Each decision carries an OieOracleSelectionArm: RejectedProposal, ActivationPriority, CurrentChainPriority, CertificateDeficit, AcceptedDrift, PredictionKernelDrift, FrozenSweep, CurrentClimbingImage, Variance, FirstUnobserved or RecoveryModelGrowth. A posterior acquisition may replace only the arms Variance, FirstUnobserved and CertificateDeficit (OieOracleTargetDecision::replaceableByPosteriorAcquisition). The other arms keep their target.
When config.acquisition = AcquisitionType::TPE= and the decision is replaceable, or the planner is idle while the band force is still unresolved, the loop does the following:
It builds the eligibility mask: an interior image is eligible when neither
image_evaluatednorimage_observed_currentis set for it and its posterior variance exceeds the likelihood noise floorgp.getSigma2(). A noise floor that is not positive disables the variance test.It picks the objective with
tpeObjectiveForSaddleState(ci_active, ci_candidate_posterior_confident, chain_certificate_met). The result isSaddleIdentitywhen the climbing image is active, its candidate is not yet confident and the chain certificate deficit is within its threshold. In every other case it isForceAccuracy.It calls
AcquisitionPolicy::selectTpeOracleTargetwith the outer iterationouter + 1 + config.acquisition_seed_offset. The offset is nonzero only for restarts after an unconverged attempt, so that restart \(k\) takes a different deterministic path than restart \(k-1\).It passes the picked image to
OieOracleTargetPlanner::selectPosteriorAcquisitionTargetwith the armTPE. The planner returns the earlier decision unchanged when the sweep is frozen, when a rejected proposal owns the target, or when the image already has true current oracle data.
The fixed-point proposal path calls the free function oie::selectTpeOracleTarget (every interior image eligible) to choose a preferred image for the proposal.
--acquisition also accepts ucb, imspe, ei, max_variance, thompson, priorityCascade and psbax (parseAcquisitionType in main_neb.cpp); AcquisitionType::PriorityCascade is the name of the earlier hand-ordered selector. gpr/neb/AcquisitionStrategy.cpp scores each unevaluated image for TPE by jointVarianceTrace, the trace of the joint energy and gradient variance; that function does not run the chain-level policy.
The utility¶
The policy standardizes each channel over the interior images: \(z(a)_i = (a_i - \bar a)/\sigma_a\), with the population standard deviation. A constant channel becomes zero. Let \(M\) be the number of interior images and \(t\) the outer iteration used by the schedule, at least 1. The exploration weight is the square root of the GP-UCB schedule of Srinivas et al. (2010) for a finite decision set of size \(M\), with \(\delta = 1/t\):
This is ucbBeta(outer_iter, n_candidates), which returns the square root. It grows with the iteration and the band size, and there is no \(\kappa\) to set.
Force-accuracy objective¶
The objective is the accuracy of the NEB force. The squared force error splits into a bias term and the force posterior variance. The predicted force norm \(|F|\) stands in for the bias, because an unrelaxed or extrapolating GP gradient is what the oracle has to correct. The derivation is in scripts/oie_acquisition_accuracy_derivation.py. The utility for image \(i\) is
When the band is confident (next section), the energy joins it:
The energy variance does not enter either form. A call with an empty force-variance vector uses zeros for that channel (oieUtility).
Saddle-identity objective¶
With TpeObjective::SaddleIdentity, the utility measures how likely each image is to change which interior image has the highest energy (saddleIdentityUtility). For the current maximum \(c\) and a challenger \(i\), the policy computes the probability that the challenger energy reaches the maximum energy, under independent Gaussian marginals:
The utility of the challenger is \(p_i\) times its posterior standard deviation. The utility of the current maximum adds \(p_i\) times its own standard deviation for every interior challenger, and the same product for each endpoint taken as a challenger. This objective never takes the interior-maximum pick below. The gate is still computed and reported in TpePickResult.
The confidence gate and the climbing-image pick¶
saddleExists(energies) is true when the largest interior energy is strictly above both endpoint energies. No single-hump shape is assumed.
confidenceMet is true when posterior uncertainty no longer reaches across the barrier being resolved:
The maximum runs over the interior images. The right side is the prominence of the interior maximum above the higher endpoint. The gate is false when the prominence is not positive, so confidence implies saddleExists. The prominence is the yardstick, and the band span is not: on an exothermic band the span includes the reaction energy and would pass the gate before the barrier top is resolved.
In the force-accuracy objective, a confident band with saddleExists returns the interior image with the highest energy (from_ci_saddle = true), when that image is eligible. In every other case the policy continues to the TPE pick.
The TPE pick¶
tpePick works on the utilities of the eligible interior images and returns an interior index.
Sort the \(n\) eligible images by utility. The best \(\gamma = \min(\lceil 0.1\, n \rceil, 25)\) images, and at least one, form the good set. The rest are the bad set. This is Optuna’s default quantile split. With one eligible image, that image is the pick.
Fit a Parzen estimator \(l\) to the good set and \(g\) to the bad set over the index range \(0 .. M-1\). Each estimator is a Gaussian mixture with one kernel per image and one prior kernel at the middle of the range with a bandwidth equal to the range width.
The bandwidth of an image kernel is the larger gap to its two neighbours in the sorted index list, padded with the range ends, and is clipped to \([\,w / \min(100,\, 1 + n_k),\; w\,]\), where \(w\) is the range width and \(n_k\) the kernel count including the prior. For the good estimator, the kernels at the ends of the sorted list take the gap to their interior neighbour only, and a lone kernel takes the smallest allowed bandwidth.
Kernel weights: the good estimator weights each image kernel by \(\exp(U_i - U_{\max})\), normalized to \(n\) pseudo-counts, and gives the prior one count. The bad estimator weights its image kernels equally, with the same prior.
The pick is the eligible index that maximizes \(\ln l(x) - \ln g(x)\), the first one on a tie.
The constants 0.1, 25 and 100 are the reference algorithm’s own definitions. No numeric option of the policy is exposed.
Interfaces¶
All of these are in the namespace gpr::neb::oie (gpr/neb/oie/AcquisitionPolicy.h).
Symbol |
Role |
|---|---|
|
Holds the eligibility mask and the objective; |
|
|
|
|
|
Chooses the objective from the climbing-image and certificate state. |
|
Free function; every interior image eligible, force-accuracy objective. |
|
The two utilities. |
|
The gate, the predicate and the schedule. |
|
The density-ratio pick over interior utilities. |
|
One joint posterior draw, for the PS-BAX acquisition. It is not part of the TPE pick. |
Configuration¶
gprn --acquisition tpe ...
The TOML key is acquisition.kind = "tpe", and the key reference lists the other values. The enum AcquisitionType in schema/params.capnp lists every value; tpe is ordinal 7.
Tests¶
tests/gpr/neb/AcquisitionPolicyTest.cpp, the meson test test_neb_acquisition_policy, covers the policy with these cases:
Test |
Checks |
|---|---|
|
An unconfident band picks the image with the largest variance and no climbing image. |
|
A confident band with a saddle picks the interior energy maximum. |
|
A confident band with no interior maximum above the endpoints commits no climbing image. |
|
The gate uses the prominence, not the span, on an exothermic band. |
|
The pick comes from the eligible set only. |
|
The saddle-identity objective picks the ambiguous saddle where the force-accuracy objective picks a force outlier. |
|
|
|
|
|
The schedule grows with iteration and band size and is finite at \(t = 1\). |
|
The pick works when the saddle sits at the first or last interior image. |
Differences from the earlier design draft¶
The first draft of this page proposed the policy before it existed. The implementation differs in these ways:
The force-accuracy utility has no energy-variance term. The draft combined energy variance, force variance, energy and force norm.
The confidence gate compares against the barrier prominence. The draft compared against the whole energy span.
The policy replaces the replaceable planner arms only. The draft described a policy that took over all of
selectOieOracleTarget, and the planner arms that must come first (rejected proposals, certificates, drift) remain in front.The eligibility mask, the saddle-identity objective and the noise-floor test are additions.
The comments in
AcquisitionPolicy.handAcquisitionPolicy.cppcite a Python prototype,refs/tpe_oie_prototype.py. That file is not in the repository, and neither is the Optuna source tree that the draft cited by file and line. The draft’s prototype output, its Optuna line references and its Baker-set barrier figure were not kept, because none can be reproduced from the repository.