Introduction
Operations Research (OR) models are increasingly automated using Large Language Models (LLMs), but they often act as black boxes when users ask complex "what-if" questions. This paper introduces Explainable Operations Research (EOR), a novel framework that uses bipartite graphs to mathematically quantify changes in an OR model and leverages a multi-agent LLM system to provide deep, actionable explanations for how and why a solution changed.
The Explainability Gap in Operations Research
Operations Research is the mathematical backbone of modern industry, optimizing everything from supply chain logistics to financial portfolios. Recently, researchers have started using LLMs to automatically write the code that solves these complex OR problems.
However, a major gap remains: explainability. In the real world, decision-makers constantly ask "what-if" questions. What if transportation costs increase by 15%? What if we have to close a warehouse? Current LLM-based OR tools (like Microsoft's OptiGuide) can handle simple parameter tweaks but struggle with complex structural changes, like adding or deleting entire constraints. Worse, when they do output a new solution, they usually just provide a superficial summary of the new result without explaining the underlying mathematical rationale. This lack of transparency makes it hard for stakeholders to trust automated decisions.
The EOR Framework: Methods and Architecture
To solve this, the authors propose the EOR Framework, which shifts the focus from merely modeling a problem to explaining it. The system relies on two main innovations: a multi-agent workflow and a mathematical quantification of changes.
1. Multi-Agent Workflow
The system uses three LLM agents built on the AutoGen framework to process queries and generate code safely:
- Commander: The central hub that interprets the user's query and routes information.
- Writer: Modifies the OR code (e.g., Python code for the Gurobi solver) based on the query and later generates human-readable explanations.
- Safeguard: A security agent that verifies the generated code is safe and syntactically sound before execution. If it fails, it triggers a debug loop.
2. Quantifying "Decision Information" via Bipartite Graphs
LLMs excel at text generation but often struggle with strict quantitative analysis. To help the LLM understand exactly how much a user's query changed the problem, the framework converts both the original and updated Linear Programs (LPs) into bipartite graphs (where nodes are either decision variables or constraints). It then calculates the Graph Edit Distance (GED)—the minimum number of operations needed to transform the old graph into the new one. This provides the LLM with a hard, quantitative metric to ground its explanation of the results.
A New Industrial Benchmark
Because explainable OR is a new sub-field, existing datasets focus primarily on problem descriptions rather than structural modifications. The authors introduce a new industrial benchmark specifically designed to evaluate OR explainability:
- Built on top of the open-source commercial IndustryOR dataset.
- Contains 30 categorized problems across various domains (logistics, finance, etc.).
- Each problem includes 10 unique, complex queries crafted by OR experts (involving adding, deleting, or updating constraints).
- Includes ground truth labels, Python code, and Gurobi solver optimal solutions.
Key Insights
- Beyond Sensitivity Analysis: Traditional OR relies on "sensitivity analysis" (tweaking a number and seeing what happens). EOR introduces "Decision Information Analysis," which can handle and explain structural changes to the problem space, such as entirely new operational limits.
- Math Grounds the LLM: By translating code changes into a Graph Edit Distance, the framework forces the LLM to base its explanations on actual structural shifts in the mathematical model. This prevents hallucinations and ensures the explanation matches the underlying math.
- Two-Tiered Explanations: The framework specifically separates its outputs into an Explanation of Correctness (justifying why the Python code was modified) and an Explanation of Results (translating the new mathematical output into a business-friendly narrative).
Results and Performance
The authors tested EOR against a Standard LLM approach and OptiGuide using various GPT-4 models.
- Modeling Accuracy: In a one-shot setting (providing the LLM with one example), EOR using GPT-4-Turbo achieved 95.33% accuracy, vastly outperforming the Standard approach (88.00%) and OptiGuide (69.33%).
- Explanation Quality: Explanations were evaluated by both an automated LLM judge and human OR experts on a 0-10 scale. EOR scored an impressive ~9.3 to 9.7 out of 10 across all metrics, while baselines hovered around 5.5 to 6.5.
- Zero-Shot vs. One-Shot: Providing just a single example prompt significantly boosted the model's ability to accurately rewrite the OR code and format its output correctly.
Limitations and Future Directions
While highly effective, the framework has a few limitations. The authors noted that increasing the "Safeguard" agent's debug attempts from 3 to 10 did not significantly improve performance, indicating that the LLM struggles to fix deep modeling logic errors on its own without human intervention. Additionally, a small percentage of failures were still due to JSON formatting errors, variable name mismatches, or Python indentation errors.
Future work will focus on developing more robust automated evaluation techniques for explanations—since LLM-as-a-judge can introduce biases—and integrating human-in-the-loop feedback to help the model overcome its self-correction limitations.
Summary updated