Algorithm Overview and Reproducibility Guarantees¶
This document formally details the central algorithmic workflow of the EZGA framework, addressing the deep connections between modules and the mathematical guarantees for reproducibility.
1. The Key Logic: A Temperature-Coupled Framework¶
The core innovation of EZGA is the tight coupling of Selection, Variation, and Sampling Depth through a singular, shared adaptive signal: the global exploration temperature $T(g)$. Rather than treating parameters as independent, they are co-modulated by a centralized thermostat that adapts to real-time convergence diagnostics.
1.1. Algorithmic Pseudocode¶
The generational loop implements a synchronized pipeline where $T(g)$ regulates the exploration-exploitation balance:
Algorithm: Adaptive Evolutionary Structure Explorer
Input: Initial Population P, Max Generations G_max
Output: Pareto-optimal structures
For g = 1 to G_max do:
// 1. Thermostat Update: T(g) reflects search health
convergence_signals = Convergence.evaluate(P)
T_g = Thermostat.update(g, convergence_signals)
// 2. Selection: Softness modulated by T(g)
F = Evaluator.compute_features_and_objectives(P)
P_selected = Selector.boltzmann_select(P, F, T_samp=T_g)
// 3. Variation: Mutational depth m_i scaled by T(g)
Operator_Probs = Variation.get_reweighted_probabilities()
P_offspring = Variation.mutate_and_cross(P_selected, Operator_Probs, T_g)
// 4. Physics Simulation: Asynchronous execution
P_evaluated = Simulator.run_physics(P_offspring)
// 5. Operator Reweighting & Transition
Variation.update_thompson_sampling_rewards(P_selected, P_evaluated)
P = TransitionKernel.accept_or_reject(P_selected, P_evaluated, T_g)
if Convergence.is_stalled():
break
End For
2. Core Mathematical Relationships¶
2.1. The Adaptive Thermostat (The Global Signal)¶
The thermostat continuously computes $T(g)$ by blending a deterministic baseline with an adaptive feedback signal smoothed via Exponential Moving Averages (EMA).
Deterministic Baseline with Stall Pulses: $$T_{\text{det}}(g) = \exp(-\gamma g) \cdot \cos\left(\frac{2\pi g}{P}\right) + S(c)$$ The stall coefficient $S(c)$ grows with the number of generations $c$ since the last Pareto improvement, providing periodic "escape pulses" to push the search out of local minima.
Adaptive Pressure Signal: $$T_{\text{adapt}}(g) = \frac{1}{3} \sum \left[ \text{EMA}(\text{stall_fraction}), (1 - \text{EMA}(\text{progress})), (1 - \text{EMA}(\text{discovery})) \right]$$
2.2. Selection and Diversity Coupling¶
The sampling temperature $T_{\text{samp}}$ is directly coupled to the global signal: $T_{\text{samp}}(g) = \alpha T(g)$.
Pareto-Boltzmann Sampling: $$p_i \propto \exp \left( \frac{-(F_i + \lambda R_i + \Psi(c_i))}{T_{\text{samp}}(g)} \right)$$ Where: - $F_i$ is the Pareto-fused objective score. - $R_i = \ln(1/d_{\min})$ is the feature-space repulsion term for diversity. - $\Psi(c_i) = \tanh(\beta c_i)$ is the repetition penalty for individuals selected $c_i$ times.
2.3. Sampling Depth and Transition Kernels¶
The number of sequential mutations $m_i$ for an individual $i$ is dynamically allocated: $$m_i = \max \left( m_{\min}, \lfloor T(g) \cdot \zeta(F_i, T(g)) \cdot m_{\text{initial}} \rfloor \right)$$ where $\zeta$ is a fitness factor. This ensures high-temperature exploration triggers deep mutational walks.
Metropolis-Hastings Acceptance: The transition between generations is statistically grounded in detailed balance: $$A(x \to y) = \min\left(1, \exp\left( \frac{-\Delta \Phi}{T(g)} + \log \frac{q_{\text{rev}}}{q_{\text{fwd}}} \right)\right)$$
3. Testing and Reproducibility Guarantees¶
3.1. Determinism and Environment Control¶
- Seed Propagation: Every module receives a unique child generator derived from the master PRNG seed using independent streams.
- Numerical Stability: The engine enforces
OMP_NUM_THREADS=1to prevent non-deterministic floating-point reduction errors common in parallelized linear algebra.
3.2. Restart and Snapshot Integrity¶
The framework guarantees that a resumed run is mathematically equivalent to an uninterrupted run. This is achieved by serializing the complete internal state: 1. Operator States: Success/failure counts for Thompson sampling. 2. Thermostat States: Decay phase and stall counters. 3. Lineage and Hashes: Historical record of structural discovery.
Mathematical Verification: $$ \forall g \in [1, G_{\max}]: \text{State}{g} = \mathcal{F}(\text{State}{g-1}, \text{Seed}_{g}) $$ The state at generation $g$ is a deterministic function $\mathcal{F}$ of the previous state and the generational seed. Continuous Integration (CI) tests explicitly assert this property across diverse chemical systems.