10

Designing a Blueprint for Bilevel Optimization Experiments

AI999第5课:方法演化:从优化解到优化算法本身
00:00

A bilevel optimization experiment blueprint must answer one concrete question:what value should the mutation factor F of Differential Evolution (DE) actually be set to. Its approach is not to keep hand-tuning, but to elevate F from a fixed hyperparameter intoan evolvable outer-layer object, while treating "running a DE solve task with a given F setting" as theinner-layer evaluation process; the outer layer then updates configurations based on the inner layer's task performance. This blueprint is feasible because it is built on EvoX's modern computational foundation: populations, evaluation results, and algorithm state are organized as holistically computabletensors, allowing candidate configurations to be mutated and evaluated in batches and routed through a computation graph for compiler optimization, after which the Runtime schedulerdispatches the computation to GPUs, accelerators, or distributed clusters, compressing what would otherwise be a long serial experiment cycle into an acceptable time window.

Bilevel Optimization Experiment BlueprintOuter layer evolves the F strategy · Inner layer evaluates DE task performanceTensorized batch evaluation · Runtime dispatchFOuter LoopEvolve the F strategy, updating the configuration each generation1F Genotype EncodingConstant / staged / scheduling function2Selection · Mutation · Crossover · UpdateThe outer population iterates generation by generation, updating the F configuration3Outer Fitness AggregationMean / median / variance penaltyDEInner TaskEvaluate DE performance under this F setting1Fix benchmarks, dimensions, and seed setLock the DE structure; only vary the F passed in by the outer layer2DE Run + GPU Batch EvaluationTensorized parallel dispatch of candidate configurations3Metrics SummaryBest value / convergence / success rate / varianceConfiguration MappingGenotype → Runtime FMetrics → Outer fitnessTask FeedbackBilevel LoopRequired Blueprint FieldsRequired logs: seed · budget · task ID · hardware · stopping conditionInner Task ObjectiveBenchmark · budget · seed setOuter Strategy ObjectConstant · staged · stateF Mapping MethodExplicit · reproducibleEvaluation MetricsMean · quantile · hypervolumeParallelism & BudgetGPU batch evaluationBaselines & AblationFixed F = 0.5Classic adaptive DE

Inner Task: Turning Performance into a Comparable Signal

The inner layer is areproducible experiment. First select an optimization task or set of benchmark functions, then lock down the DE main structure, dimensions, evaluation budget, and random seed set—the only quantity that varies is the F configuration passed in by the outer layer. Each run must record: best value, convergence speed (number of generations to reach the threshold), success rate, constraint violations, multi-objective metrics (such as hypervolume), and candidate diversity. These records are all the information the outer layer can "see," and the only basis on which it judges quality. Evaluation is performed in batches in a tensorized manner, with the same batch of candidates sharing a single computation graph, avoiding the overhead of serial individual-by-individual evaluation.

Outer Strategy Object: F Is No Longer a Constant

What the outer layer searches is not a single value, but an F strategy. There are three common types of encoding: constant F; staged constants, such as the gene [F1, F2, F3] switching across generation intervals; and scheduling functions controlled by a small number of genes, for example triggering different F values based on the current success rate, population variance, or generation ratio. For strategy-type encodings, in addition to the genes themselves, the input features and output rules must be specified; otherwise the same gene segment would produce entirely different results under different implementations.

Mapping Method: Genotype to Runtime Configuration

The mapping from the outer-layer genotype to the inner-layer runtime configuration must beexplicit and reproducible. For example, the gene [F_start, F_end, decay] maps to a schedule that decays with generations: F(t) = F_start + (F_end − F_start) × e^(−decay × t / T), where t is the current generation and T is the total number of generations; the gene [F1, F2, F3] maps to a three-stage constant switching. The same genotype must always map to the same runtime configuration; otherwise the "good genes" learned by the outer layer cannot be explained, nor can they be transferred to new tasks.

Closed-Loop Process and Required Logs

The complete loop is: the outer population generates a batch of F configurations → the Runtime scheduler dispatches inner-layer DE tasks in parallel by tensorized batches → GPU batch evaluation → metrics aggregation → outer-layer selection, mutation, crossover, and update → proceed to the next round. This follows EvoX's layered organization: the algorithm layer carries both the outer-layer evolution and the inner-layer DE logic, the problem module supplies benchmark tasks, the Runtime scheduler handles dispatching batch computations to GPUs or distributed clusters, and the monitoring module collects metrics. The loop must leave behind replayable records: random seed, evaluation budget, task ID, hardware model, and stopping condition. Any conclusion of "the outer layer wins" should be reproducible under the same conditions.

Boundary Conditions and Baselines: Three Layers of Defense

Noise protection:When inner-layer evaluations fluctuate heavily, the result of a single run is unreliable; you must run multiple independent trials and report confidence intervals. Fitness can be aggregated using the mean, median, or worst-case quantile, and training tasks must be separated from validation tasks to prevent the outer layer from overfitting to a few lucky seeds.Cost protection:When inner-layer tasks are expensive, first use low-fidelity models or surrogate evaluations for coarse screening, then perform high-fidelity re-evaluation on a small number of candidates.Baseline protection:Fixed F = 0.5 and classic adaptive DE must be compared on the same footing, with ablation experiments confirming that the gains come from the outer-layer evolution itself rather than from more evaluation counts. If the outer-layer search space is too small, bilevel optimization degenerates into manual tuning; in that case you should expand the encoding space rather than simply increasing the budget.