NeurIPS 2026Coming to NeurIPS in Sydney?Explore papers, orals & directions

Balancing Latin Rectangles with LLM-Generated Streamliners

Florentina Voboril, Vaidyanathan Peruvemba Ramaswamy, Stefan SzeiderCP 2025

TL;DR

This paper tackles the computationally challenging problem of finding optimally balanced Latin rectangles, crucial for experimental design. They introduce a novel approach that leverages Large Language Models (LLMs) to automatically generate "streamliner" constraints, significantly improving the efficiency and effectiveness of constraint solvers in finding high-quality solutions. This hybrid method achieves new best-known bounds for many Latin rectangle configurations.

What Problem Does This Paper Address?

Finding "balanced" Latin rectangles is a complex combinatorial optimization problem. A Latin rectangle is a grid where each row and column contains unique symbols. "Balanced" refers to minimizing the distance between occurrences of any two symbols across all rows. This balance is critical in experimental design (e.g., agriculture, drug testing) to minimize bias from spatial correlations and ensure statistically reliable results. While constraint programming has been used to tackle this, the problem's complexity has limited progress, especially for larger configurations. Manually designing effective "streamliner" constraints, which guide solvers to promising solution regions, is labor-intensive and requires deep domain expertise. This paper aims to automate the generation of these powerful streamliners using LLMs, overcoming the manual design bottleneck and pushing the state-of-the-art in finding balanced Latin rectangles.

Methods

The core innovation is the integration of LLMs with constraint programming for optimization problems. Building on prior work on LLM-generated streamliners for decision problems, this paper adapts the technique for optimization.

  • LLM-Generated Streamliners: The authors use various LLMs (GPT-4o, Claude 3.7 Sonnet, etc.) and prompt them with the MiniZinc model of the Latin rectangle problem. The LLMs are tasked with generating syntactically correct and creative constraints that can prune the search space.
  • Two Orchestration Strategies:
    1. Incremental Warmstart Approach: This method uses the best solution found so far to "warm-start" subsequent searches. In each iteration, an LLM generates new streamliners, which are then evaluated. If a streamliner leads to a better solution, it becomes the new benchmark. The process iteratively refines the solution and the training time increases if improvements slow down.
  • Evolutionary Approach: This strategy maintains a "population" of effective streamliners. Good streamliners are selected, combined, and "mutated" (via LLM generation inspired by existing streamliners) to create new, potentially more powerful ones. This approach aims to discover a diverse set of streamliners and explore the solution space more broadly.

Both approaches discard syntactically incorrect streamliners and rely on preliminary experiments to fix hyperparameters.

Datasets

The paper does not explicitly mention training datasets for the LLMs, as they leverage pre-trained, publicly available LLMs. The evaluation is performed on instances of the "Balanced Latin Rectangles" (BLR) problem. The paper refers to existing literature for known best results and uses Gurobi solver runs as a baseline. No new benchmark datasets are introduced.

Key Insights and Ideas

  • LLMs as Automated Constraint Engineers: The most significant insight is that LLMs can be effectively leveraged to automatically generate high-quality "streamliner" constraints for complex combinatorial optimization problems, bypassing the need for manual design and domain expertise.
  • Hybrid Approach Superiority: Combining LLMs with established constraint programming techniques (like warm-starting and evolutionary algorithms) yields superior results compared to traditional methods or LLMs alone.
  • Early Improvements are Key: The observation that significant improvements in optimization problems often occur early in the search process is exploited by the incremental warmstart approach, which quickly identifies and utilizes effective streamliners.
  • Diversity of LLM Outputs: The generated streamliners exhibit high diversity, with few appearing across multiple instances, suggesting that LLMs explore a wide range of potential solutions and constraint types.
  • LLMs Can Rediscover Known Techniques: Interestingly, LLMs can rediscover known, effective symmetry-breaking constraints from the literature, sometimes even formulating them in a slightly more performant way.

Key Results

The proposed approach significantly improves upon existing best-known bounds for balanced Latin rectangles.

  • Improved Bounds: The method outperforms previous approaches, improving upper bounds on imbalance for 32 out of 44 instances.
  • New Record Values: The paper establishes new record values for many instances, particularly for larger configurations (e.g., n=13).
  • Efficiency Gains: The incremental warmstart approach can achieve results comparable to or better than 4-hour Gurobi runs in much shorter timeframes (e.g., 1 minute initial run, with improvements over time).
  • Prompt Effectiveness: Detailed problem descriptions did not significantly boost LLM performance, but asking for combinations of streamliners was less effective than individual streamliners, possibly due to conflicting constraints.
  • LLM Performance: GPT-03 and GPT-4o were found to be the most effective LLMs in generating streamliners that led to improvements.

Limitations and Future Work

  • No Optimality Guarantees: The method cannot prove optimality. While it finds better solutions faster, it doesn't guarantee that the absolute best solution has been found. This is acknowledged as a trade-off for practical performance.
  • Dependence on Initial Solution: The incremental warmstart approach relies on finding an initial feasible solution quickly. This might be a limitation for problems where initial solutions are hard to find.
  • LLM Infallibility: LLMs can produce incorrect output, requiring robust filtering and verification mechanisms.
  • Future Work: The authors suggest exploring the effectiveness of this approach on other, potentially novel, optimization problems and with different solvers. They also envision future constraint solvers integrating LLM-generated streamliners for more intelligent and adaptive solving. The potential for using results from one instance to seed another is also highlighted.

Summary updated

BibTeX
@inproceedings{voboril2025balancing,
  author = {Florentina Voboril and Vaidyanathan Peruvemba Ramaswamy and Stefan Szeider},
  title = {{Balancing Latin Rectangles with LLM-Generated Streamliners}},
  booktitle = {CP},
  year = {2025},
  doi = {10.4230/lipics.cp.2025.36},
}
Figure