AI Glossary · Letter G

Genetic Algorithm.

An optimization technique inspired by natural selection that evolves a population of candidate solutions through repeated cycles of selection, crossover, and mutation. Genetic algorithms are a specific and widely deployed instance of the broader evolutionary algorithm family, applied in media mix optimization, hyperparameter search, and creative variation generation where the solution space is too large or non-differentiable for gradient-based methods.

Also known as GA, evolutionary optimization, evolutionary search

What it is

A working definition of the genetic algorithm.

A genetic algorithm encodes candidate solutions as strings of values, the “chromosomes,” and maintains a population of these candidates. At each generation, solutions are evaluated on an objective function and assigned fitness scores. High-fitness solutions are selected with greater probability for reproduction. Crossover combines two parent solutions by swapping segments of their chromosomes to produce offspring that inherit characteristics of both parents. Mutation randomly modifies individual values in a solution with a small probability, introducing variation that prevents the population from converging prematurely on a locally optimal region. After many generations, the population shifts toward high-fitness solutions, converging on a near-optimal answer to the optimization problem.

The encoding of solutions as chromosomes makes genetic algorithms flexible across problem types. A media allocation problem might encode each candidate as a vector of budget percentages across channels. A hyperparameter optimization problem might encode each candidate as a combination of learning rate, model depth, and regularization strength. A creative variant selection problem might encode each candidate as a combination of headline type, image category, and call-to-action format. The algorithm operates the same way regardless of what the chromosome represents, evaluating fitness, selecting parents, crossing over, and mutating, as long as an objective function can be computed for each candidate.

Genetic algorithms are most valuable when the solution space is discrete or combinatorial, when the objective function is non-differentiable or expensive to differentiate, or when the optimization landscape has many local optima that gradient descent would get trapped in. They are less computationally efficient than gradient methods when gradient information is available, because they evaluate many full candidate solutions rather than following the gradient of the objective function directly. The practical tradeoff is between the broader exploration that genetic algorithms provide and the faster convergence that gradient methods offer when the problem structure permits their use.

Why ad agencies care

Why genetic algorithms matter more in agency work than in most industries.

Budget allocation, creative variation selection, audience targeting configuration, and campaign parameter optimization are all problems with discrete combinatorial structure and non-differentiable or stochastic objective functions. A working ad agency solving these problems with manual iteration or grid search is exploring a tiny fraction of the solution space. Genetic algorithms automate the exploration of that space systematically, finding better solutions than manual search without requiring the practitioner to know in advance which part of the space is most promising.

Media mix optimization is a textbook genetic algorithm application. Allocating budget across channels, formats, and timing windows to maximize a business outcome involves a combinatorial space that grows rapidly with the number of variables. The objective function, campaign performance simulated or measured, is not differentiable with respect to budget allocations when it is computed from real-world data. Genetic algorithms navigate this space by generating many candidate allocations, evaluating each using the attribution or simulation model, and evolving toward better allocations over multiple generations. Several commercial media mix optimization platforms use genetic algorithms in their optimization engines.

Creative testing at scale is an evolutionary process whether it is formalized or not. Most agencies run iterative creative testing where high-performing variants influence the design of the next round of creative. Formalizing this as a genetic algorithm, encoding creative attributes as the chromosome and campaign performance as the fitness function, produces more systematic exploration of the creative space and faster convergence on high-performing configurations than ad hoc creative iteration driven by intuition.

Hyperparameter optimization for client models benefits from evolutionary search. When an agency builds custom predictive models for clients, the model configuration, learning rate, regularization, architecture depth, requires optimization that manual search handles poorly at scale. Genetic algorithm-based hyperparameter search, alongside Bayesian optimization, consistently finds better configurations than grid search or random search on the same computational budget, improving model quality without proportionally increasing the configuration time investment.

In practice

What genetic algorithm looks like inside a working ad agency.

An agency is optimizing media allocation for a direct response client across nine channels including search, social, video, display, connected TV, streaming audio, influencer, email, and SMS. The client’s attribution model scores each conversion path across the nine channels. Budget reallocation decisions must satisfy several constraints: minimum and maximum spend per channel, total budget ceiling, and a requirement that no more than four channels receive a budget decrease relative to the prior period. Manual optimization by the media team has been cycling through a small neighborhood of familiar allocations without meaningful improvement for three quarters. The agency implements a genetic algorithm that generates 300 candidate allocations per generation, evaluates each using the attribution model, selects the top 60 for reproduction, and runs 200 generations. The best allocation found by the genetic algorithm projects 19% more attributed conversions than the current allocation at the same total budget. The allocation is tested in a holdout market before full rollout, and the holdout result validates the projected improvement at 16%.

Build the optimization capability that finds better campaign allocations and model configurations than manual search through The Creative Cadence Workshop.

The automations and agents module covers how to build AI-powered optimization workflows for media allocation and model configuration, including the evolutionary approaches that work on the combinatorial, non-differentiable problems advertising presents.