Back to AI Research

AI Research

Ballad switches language models during a search for better heuristics

Key Takeaways

  • Ballad selects language models as heuristic search runs.
  • Across five optimization problems, the authors report up to 65.6% lower API cost in their tests.
  • Ballad chooses among several models during a search for new heuristics.
  • Its authors test whether changing that choice can preserve solution quality and lower API cost.
  • Ballad is a routing method that decides which language model to use next while searching for better ways to solve an optimization problem.

Ballad is a routing method that decides which language model to use next while searching for better ways to solve an optimization problem. In the paper, the authors test the assumption that always calling the most capable or costly model produces the best heuristic. They report no consistent advantage for that approach across the problems they tested.

Why the choice changes during a run

Automated heuristic discovery asks models to generate and revise candidate solutions, then scores those candidates. An early call can produce an idea that a different model develops several steps later. The value of the model can therefore depend on where the search has reached and what the other models have contributed. Treating calls as independent decisions misses that connection.

How Ballad assigns credit

The method updates its model selection from evaluator scores during the search. It gives more weight to rare candidates with especially strong scores, traces credit back through the lineage of a heuristic and reduces the weight of older observations. Those choices reflect the aim of finding the best heuristic in the run rather than maximizing average quality on every call.

How it performed in the paper

The authors tested a pool of four models across five hard combinatorial optimization problems. They report that the ensemble matched the best individual model and, in several cases, did better than every individual model. Relative to always calling the strongest model, the largest reported reduction in API cost was 65.6%.
The savings depend on the problems, model pool and prices used for the comparison. They are not a fixed reduction for other optimization workloads. Teams with a way to score candidates can compare a routing policy with a fixed-model run while holding the evaluator and budget constant. Keep the best score and the total spend separate, since the cheaper path may also reach a different solution.

Comments