Table of Contents
Fetching ...

Generating Streamlining Constraints with Large Language Models

Florentina Voboril, Vaidyanathan Peruvemba Ramaswamy, Stefan Szeider

TL;DR

This work introduces StreamLLM, a neuro-symbolic framework that uses Large Language Models to generate streamlining constraints for MiniZinc constraint programs. By combining real-time prompt-driven generation with rapid empirical validation (and an offline training variant), StreamLLM achieves substantial runtime reductions across seven CSPs, including a novel Hypergraph Coloring problem, with some instances speeding up up to 99%. The study systematically interrogates memorization via disguised/obfuscated variants and demonstrates that combinations of streamliners often outperform single constraints, while offline training can yield even stronger gains. The results highlight the potential of AI-assisted constraint programming to generalize beyond known problem instances and suggest future directions in knowledge distillation, problem translations, formal soundness verification, and hybrid optimization workflows.

Abstract

Streamlining constraints (or streamliners, for short) narrow the search space, enhancing the speed and feasibility of solving complex constraint satisfaction problems. Traditionally, streamliners were crafted manually or generated through systematically combined atomic constraints with high-effort offline testing. Our approach utilizes the creativity of Large Language Models (LLMs) to propose effective streamliners for problems specified in the MiniZinc constraint programming language and integrates feedback to the LLM with quick empirical tests for validation. Evaluated across seven diverse constraint satisfaction problems, our method achieves substantial runtime reductions. We compare the results to obfuscated and disguised variants of the problem to see whether the results depend on LLM memorization. We also analyze whether longer off-line runs improve the quality of streamliners and whether the LLM can propose good combinations of streamliners.

Generating Streamlining Constraints with Large Language Models

TL;DR

This work introduces StreamLLM, a neuro-symbolic framework that uses Large Language Models to generate streamlining constraints for MiniZinc constraint programs. By combining real-time prompt-driven generation with rapid empirical validation (and an offline training variant), StreamLLM achieves substantial runtime reductions across seven CSPs, including a novel Hypergraph Coloring problem, with some instances speeding up up to 99%. The study systematically interrogates memorization via disguised/obfuscated variants and demonstrates that combinations of streamliners often outperform single constraints, while offline training can yield even stronger gains. The results highlight the potential of AI-assisted constraint programming to generalize beyond known problem instances and suggest future directions in knowledge distillation, problem translations, formal soundness verification, and hybrid optimization workflows.

Abstract

Streamlining constraints (or streamliners, for short) narrow the search space, enhancing the speed and feasibility of solving complex constraint satisfaction problems. Traditionally, streamliners were crafted manually or generated through systematically combined atomic constraints with high-effort offline testing. Our approach utilizes the creativity of Large Language Models (LLMs) to propose effective streamliners for problems specified in the MiniZinc constraint programming language and integrates feedback to the LLM with quick empirical tests for validation. Evaluated across seven diverse constraint satisfaction problems, our method achieves substantial runtime reductions. We compare the results to obfuscated and disguised variants of the problem to see whether the results depend on LLM memorization. We also analyze whether longer off-line runs improve the quality of streamliners and whether the LLM can propose good combinations of streamliners.
Paper Structure (35 sections, 7 figures, 1 table, 1 algorithm)

This paper contains 35 sections, 7 figures, 1 table, 1 algorithm.

Figures (7)

  • Figure 1: Histogram showing the number of instances for each problem, sorted by their original running times and partitioned into 20-minute intervals. Further, the total number of instances for each problem is shown next to the problem name in the legend.
  • Figure 2: Normalized saved times for different number of training instances for three problems
  • Figure 3: Percentage of reduction in solving time with both static and adaptive approaches using LLMs Claude and GPT across seven problems. Each bar and black line denotes, respectively, the mean and standard deviation of two runs.
  • Figure 4: Solving time reduction with respect to the original solving time when including streamliner generation time in the total streamlined running time.
  • Figure 5: Percentage of reduction in solving time for all seven original problems, as well as their disguised and obfuscated versions, with both static and adaptive approaches using LLMs Claude and GPT. The bars and black lines denote the means and standard deviations, respectively.
  • ...and 2 more figures