Skip to main content
The FitnessEngine converts evaluation metrics into comparable fitness values for the evolutionary loop. It supports both single-objective scalar aggregation and multi-objective vector fitness. This page specifies the aggregation formulas, weighting schemes, and the critical isolation rule: fitness is computed only from the Optimization Set.

Fitness Computation Flow

Single-Objective Scalar Aggregation

The FitnessEngine combines multiple metrics into a single scalar value using weighted summation or target-relative scoring.

Weighted Sum

Weights are configurable per experiment. Default weights balance accuracy, efficiency, and safety:

Target-Relative Scoring

Each metric is scored relative to a target value:
Target values are set per benchmark or inherited from baseline models. Target-relative scoring makes fitness interpretable: 1.0 means all targets met.

Multi-Objective Vector Fitness

For multi-objective optimization, fitness is a vector rather than a scalar. The EvolutionEngine passes this vector to the non-dominated sorting algorithm (NSGA-II, Deb et al. 2002).
Each component is independently normalized. The Pareto front contains candidates where no other candidate dominates on all objectives.

Example Aggregation Formulas

Standard Accuracy-Weighted Fitness
Balanced Multi-Objective Vector
Target-Relative for Instruction Following

Metric Normalization

All metrics are normalized to [0, 1] before aggregation:
  • For metrics where higher is better: norm = (value - min) / (max - min)
  • For metrics where lower is better: norm = 1 - (value - min) / (max - min)
  • If max equals min: norm = 0.5
Min and max are computed from the current population’s Optimization Set results. This makes fitness relative to the current search progress.

Isolation Rule

Fitness is computed ONLY from the Optimization Set. The Validation Set and Hidden Test Set are never used during fitness calculation, ranking, or selection. This rule is enforced at the data layer. Any attempt to compute fitness from non-optimization splits triggers an error and halts the experiment.

Integration with EvolutionEngine

The FitnessEngine exposes:
All results are logged to the ExperimentTracker with the full metric dictionary and computed fitness values.