Neuro-Symbolic Verification and Refinement for LLM-Based Optimisation Modelling
Neuro-Symbolic Verification and Refinement for LLM-Based Optimisation Modelling
Pivithuru Thejan Amarasinghe, Su Nguyen, Yuan Sun, Damminda Alahakoon
AbstractOptimisation supports decision-making across diverse domains, yet translating real-world problems into mathematical models remains expertise-intensive. Large language models (LLMs) offer opportunities to automate this process, but verifying model correctness remains challenging. Manually verifying an entire mathematical model requires significant optimisation expertise, while automated verification often relies on ground-truth models or optimal objective values, which are typically unavailable for real-world problems. Here we propose a neuro-symbolic framework for verifying and refining LLM-generated mathematical models. Problem-specific requirements are extracted as simple textual rules that a human can easily verify, and then transformed into symbolic rules. Each symbolic rule is then checked against the mathematical model using a satisfiability solver. When a rule is violated, the solver identifies the semantic inconsistency and returns a counterexample, which guides the LLM in refining the model iteratively. Experiments on two benchmark datasets show that the framework identifies semantic modelling errors and increases the accuracy of generated models from 82.3% to 96.8% and from 30.9% to 49.1%. Furthermore, the framework also outperforms four existing feedback-based refinement methods on both datasets.