
This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.
(L, V)
and the stage’s differentiable constraints (compiled with
compile_gradient_providers) return the weighted gradient
d(energy)/d(logits). Substituting new at position i is estimated
to change the energy by grad[i, new] - grad[i, current]. masking_strategy
sets the substitution count and fixed positions; that many substitutions at
distinct free positions are drawn from a softmax over
-estimate / (relative_temperature * std), where std is the spread of the estimates
over the allowed substitutions, so the draw does not depend on the energy’s scale. The draw
is uniform when the spread is at float32 rounding level relative to the largest gradient
entry, which includes every estimate being equal. The owning optimizer supplies its
constraints via _bind_constraints; non-differentiable ones are ignored.
Unlike the temperature of the other generators, which divides a model’s log-probabilities,
and of MCMCOptimizer, which divides raw energy differences, relative_temperature is in
units of the estimates’ spread. Constraint energies are weighted [0, 1] scores, not
log-probabilities, and their per-substitution estimates span orders of magnitude across
constraints, so no single raw-unit default suits them. Gibbs-with-gradients samplers divide
raw estimates instead (Grathwohl et al., 2021).
API Reference
Configuration for gradient-guided substitution sampling.
Usage
python