Large Language Model for Discrete Optimization Problems: Evaluation and Step-by-step Reasoning
Organizations: School of Mathematics, Southeast University, Nanjing, China · School of Computer Science and Engineering, Southeast University, Nanjing, China · School of Mathematical Sciences, Chongqing Normal University, Chongqing, China
Abstract
This work investigated the capabilities of different models, including the Llama-3 series of models and CHATGPT, with different forms of expression in solving discrete optimization problems by testing natural language datasets. In contrast to formal datasets with a limited scope of parameters, our dataset included a variety of problem types in discrete optimization problems and featured a wide range of parameter magnitudes, including instances with large parameter sets, integrated with augmented data. It aimed to (1) provide an overview of LLMs' ability in large-scale problems, (2) offer suggestions to those who want to solve discrete optimization problems automatically, and (3) regard the performance as a benchmark for future research. These datasets included original, expanded and augmented datasets. Among these three datasets, the original and augmented ones aimed for evaluation while the expanded one may help finetune a new model. In the experiment, comparisons were made between strong and week models, CoT methods and No-CoT methods on various datasets. The result showed that stronger model performed better reasonably. Contrary to general agreement, it also showed that CoT technique was not always effective regarding the capability of models and disordered datasets improved performance of models on easy to-understand problems, even though they were sometimes with high variance, a manifestation of instability. Therefore, for those who seek to enhance the automatic resolution of discrete optimization problems, it is recommended to consult the results, including the line charts presented in the Appendix, as well as the conclusions drawn in this study for relevant suggestions.
Figures & tables
| PROBLEMS | MANUAL | EXPANDED | AUGMENTED |
| Assignment | 60 | 48 | 108 |
| 1D-Binpacking | 960 | 640 | 1600 |
| Crew-scheduling | 150 | 100 | 250 |
| Steiner | 980 | 980 | 1960 |
| UBQP | 135 | 90 | 225 |
| CVRP | 606 | 404 | 1010 |
| Error Types | Description |
| IndexError | Raised when trying to access an index that is out of range for a list or a sequence. |
| FileNotFoundError | Raised when a file or directory is requested but cannot be found. |
| OverflowError | Raised when a calculation exceeds the limits of the data type, typically in numeric operations. |
| NameError | Raised when a local or global name is not found, meaning the variable or function is not defined. |
| ValueError | Raised when a function receives an argument of the right type but an inappropriate value, such as converting a non-numeric string to an integer. |
| AttributeError | Raised when an invalid attribute reference is made, meaning the attribute does not exist on the object. |
| ①Implicit | ①Explicit | ① |
| There are 120 items S and several boxes B with a capacity of 150. The volumes of the 120 items are [BLANK] , and it is given that ( ). The packing problem seeks to pack all items into the boxes in such a way that the number of boxes used is minimized. The following table shows the volumes of the items: [BLANK] | There are 120 items S and several boxes B with a capacity of 150. The volumes of the 120 items are , and it is given that ( ). The packing problem seeks to pack all items into the boxes in such a way that the number of boxes used is minimized. The following table shows the volumes of the items: , ,…, , | |
| ①Implicit-Disorder | ||
| The packing problem seeks to pack all items into the boxes in such a way that the number of boxes used is minimized The following table shows the volumes of the items: … , and it is given that ( ) 1.There are 120 items S and several boxes B with a capacity of 150. The volumes of the 120 items are | ||
| ②CoT Prompting(Optional) | ② | |
| Dealing with 1D bin - packing problems involves several key steps. Here’s a concise outline: 1. Define the Problem: Clearly state the items to be packed (sizes and quantities) and the capacity of the bins. 2. Choose a Strategy: Select a bin - packing algorithm or heuristic (First - Fit, Best - Fit, FFD, BFD). 3. Sort the Items: If using a decreasing strategy, sort the items in descending order. 4. Initialize Bins: Create an empty list or array to represent the bins. 5. Pack the Items: Iterate through the sorted list and place each item into the first suitable bin. 6. Handle Overflows: If an item cannot fit, create a new bin. 7. Track Usage: Record how many bins are used and their contents. 8. Evaluate the Solution: Assess packing efficiency (number of bins used, waste). 9. Optimize (if needed): Explore further optimization techniques. 10. Implement and Test: Run with various inputs to ensure correctness and efficiency. | ||
| ③Common Prompting | ③ | |
| Task | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| Assignment | Explicit-origin | \ | \ | \ | \ | \ | \ | \ | |
| Implicit-origin | 98.33 | ||||||||
| Implicit-disorder | \ | 92.59 | \ | \ | |||||
| 1D-Binpacking | Explicit-origin | \ | \ | \ | \ | \ | \ | \ | |
| Implicit-origin | 82.55 | ||||||||
| Task | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| Assignment | Explicit-origin | \ | \ | \ | \ | \ | \ | \ | |
| Implicit-origin | 10.00 | ||||||||
| Implicit-disorder | \ | 11.11 | \ | \ | |||||
| 1D-Binpacking | Explicit-origin | \ | \ | \ | \ | \ | \ | \ | |
| Implicit-origin | 10.07 | ||||||||
| Task | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| Assignment | Explicit-origin | \ | - | \ | \ | \ | \ | \ | \ |
| Implicit-origin | - | 0.534 | |||||||
| Implicit-disorder | \ | - | - | 0.220 | \ | \ | |||
| 1D-Binpacking | Explicit-origin | \ | \ | \ | \ | \ | \ | \ | |
| Implicit-origin | 0.092 | ||||||||
| Task | Error | Reason |
| Assignment | cost_matrix[i, j] = c | IndexError: index 3301 is out of bounds for axis 1 with size 3000 |
| 1D-Binpacking | with open(’data123.txt’, ’r’) as file: S = [float(line.strip()) for line in file] | ValueError: could not convert string to float: ’[ ]’ |
| Crew-scheduling | cost[i][j] = c | IndexError: list assignment index out of range |
| Steiner | Timeout | TimeoutError: Operation Timed Out |
| UBQP | matrix[i][j] = c_ij | IndexError: list assignment index out of range |
| CVRP | routing.AddDimensionWithVehicleCapacity( demand_callback_index, 0, data, True, ’Capacity’ ) | TypeError: ’float’ object cannot be interpreted as an integer |
| Task | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| Assignment | Explicit-origin | \ | 0.00 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 0.00 | 0.00 | 0.00 | 3.33 | 0.00 | 1.67 | 1.67 | ||
| Implicit-disorder | \ | 1.85 | 1.85 | 1.85 | \ | \ | |||
| 1D-Binpacking | Explicit-origin | \ | 11.55 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 15.00 | 4.62 | 6.04 | 2.92 | 4.17 | 15.10 | |||
| Status | Status Descriptions | Problems |
| Worsened | Disordered datasets are slightly inferior | 1D-Binpacking, Crew-scheduling, CVRP |
| Significantly Worsened | Disordered datasets are greatly inferior | Steiner, UBQP |
| Improved | Disordered datasets are slightly superior | Assignment, MDVRP, Aircraft Landing, Multi-dimensional Knapsack |
| Significantly Improved | Disordered datasets are greatly superior | PVRP, Generalised Assignment, Capacitated Warehouse Location, 2D-Cutting Packing-Constrained Guillotine |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Error Type | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit-origin | \ | 0.00 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 24.24 | 19.57 | 2.22 | 9.80 | 1.03 | 3.32 | 0.00 | 9.09 | |
| Implicit-disorder | \ | 0.00 | 22.22 | 3.70 | 2.69 | 2.85 | \ | \ | |
| FileNotFoundError | Explicit-origin | \ | 9.52 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 3.03 | 2.17 | 0.00 | 0.00 | 0.69 | 1.85 | 0.00 | 0.00 | |
| Error Type | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit-origin | \ | 0.00 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 4.23 | 3.23 | 7.19 | 1.24 | 17.26 | 2.98 | 15.94 | 29.23 | |
| Implicit-disorder | \ | 8.47 | 1.70 | 1.40 | 14.50 | 8.02 | \ | \ | |
| FileNotFoundError | Explicit-origin | \ | 0.00 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 0.00 | 0.00 | 5.12 | 0.00 | 5.58 | 1.75 | 0.00 | 2.31 | |
| Error Type | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit-origin | \ | 30.77 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 46.40 | 48.06 | 19.61 | 30.47 | 11.76 | 7.05 | 59.78 | 32.89 | |
| Implicit-disorder | \ | 33.67 | 28.46 | 22.89 | 34.78 | 2.62 | \ | \ | |
| FileNotFoundError | Explicit-origin | \ | 14.62 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 3.60 | 6.20 | 0.00 | 0.78 | 0.00 | 2.12 | 3.26 | 0.67 | |
| Error Type | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit-origin | \ | 0.00 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 4.14 | 8.55 | 7.03 | 4.51 | 1.39 | 6.16 | 0.23 | 1.35 | |
| Implicit-disorder | \ | 0.92 | 13.82 | 11.09 | 1.24 | 1.68 | \ | \ | |
| FileNotFoundError | Explicit-origin | \ | 0.00 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 3.45 | 1.32 | 0.41 | 0.16 | 0.00 | 0.47 | 0.00 | 1.35 | |
| Error Type | Expression | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit | \ | 25.53 | \ | \ | \ | \ | \ | \ |
| Implicit | 62.04 | 47.83 | 18.18 | 17.39 | 0.92 | 6.16 | 34.74 | 60.66 | |
| Implicit-disorder | \ | 29.04 | 18.69 | 14.29 | 1.99 | 3.63 | \ | \ | |
| FileNotFoundError | Explicit | \ | 8.51 | \ | \ | \ | \ | \ | \ |
| Implicit | 10.22 | 17.39 | 0.00 | 0.00 | 0.15 | 1.11 | 0.00 | 1.64 | |
| Error Type | Expression | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit | \ | 10.29 | \ | \ | \ | \ | \ | \ |
| Implicit | 8.52 | 2.87 | 2.51 | 2.30 | 3.20 | 3.17 | 0.39 | 1.55 | |
| Implicit-disorder | \ | 4.98 | 4.31 | 2.96 | 1.71 | 0.44 | \ | \ | |
| FileNotFoundError | Explicit | \ | 15.04 | \ | \ | \ | \ | \ | \ |
| Implicit | 0.00 | 1.91 | 0.00 | 0.27 | 2.28 | 3.49 | 0.00 | 0.62 | |
| Error Type | Expression | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit | \ | 29.02 | \ | \ | \ | \ | \ | \ |
| Implicit | 4.05 | 14.12 | 7.48 | 0.95 | 0.31 | 0.61 | 6.54 | 39.61 | |
| Implicit-disorder | \ | 5.05 | 7.81 | 2.51 | 0.92 | 0.31 | \ | \ | |
| FileNotFoundError | Explicit | \ | 6.70 | \ | \ | \ | \ | \ | \ |
| Implicit | 5.41 | 4.71 | 0.00 | 0.00 | 0.15 | 1.23 | 1.87 | 0.48 | |
| Error Type | Expression | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit | \ | 2.14 | \ | \ | \ | \ | \ | \ |
| Implicit | 7.97 | 5.47 | 1.66 | 2.11 | 0.16 | 0.64 | 0.00 | 1.14 | |
| Implicit-disorder | \ | 3.02 | 5.09 | 3.65 | 0.29 | 0.68 | \ | \ | |
| FileNotFoundError | Explicit | \ | 0.00 | \ | \ | \ | \ | \ | \ |
| Implicit | 3.62 | 2.34 | 0.00 | 0.00 | 0.48 | 0.48 | 0.00 | 0.00 | |
| Error Type | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit-origin | \ | 13.00 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 3.33 | 2.60 | 2.38 | 1.37 | 0.93 | 0.00 | 9.52 | 50.00 | |
| Implicit-disorder | \ | 0.74 | 5.56 | 3.57 | 2.30 | 0.70 | \ | \ | |
| FileNotFoundError | Explicit-origin | \ | 4.00 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 0.00 | 0.00 | 0.00 | 0.00 | 1.40 | 0.00 | 0.00 | 0.00 | |
| Error Type | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit-origin | \ | 60.80 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 12.98 | 9.15 | 13.41 | 17.95 | 1.15 | 2.31 | 41.67 | 37.80 | |
| Implicit-disorder | \ | 3.85 | 9.25 | 12.80 | 3.21 | 4.24 | \ | \ | |
| FileNotFoundError | Explicit-origin | \ | 8.52 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 2.67 | 5.23 | 8.94 | 1.03 | 0.46 | 0.93 | 0.00 | 0.00 | |
| Error Type | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit-origin | \ | 37.62 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 26.28 | 22.61 | 6.58 | 6.41 | 3.38 | 4.22 | 15.88 | 16.22 | |
| Implicit-disorder | \ | 17.59 | 4.16 | 4.87 | 3.66 | 2.97 | \ | \ | |
| FileNotFoundError | Explicit-origin | \ | 0.99 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 1.53 | 1.01 | 0.12 | 0.38 | 6.39 | 5.84 | 0.00 | 0.00 | |
| Error Type | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit-origin | \ | 43.98 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 23.51 | 26.09 | 0.00 | 6.29 | 1.03 | 1.21 | 31.47 | 17.88 | |
| Implicit-disorder | \ | 21.05 | 1.81 | 2.94 | 1.21 | 1.19 | \ | \ | |
| FileNotFoundError | Explicit-origin | \ | 4.71 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 0.37 | 3.56 | 0.00 | 0.00 | 1.23 | 0.60 | 0.00 | 1.12 | |
| Error Type | Dataset | GPT-4o-mini | LLAMA3-8B | ORLM | DeepSeek-R1 | ||||
| PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | PoT | PoT+CoT | ||
| IndexError | Explicit-origin | \ | 0.00 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 16.67 | 10.00 | 2.51 | 0.00 | 0.00 | 0.00 | 15.91 | 3.32 | |
| Implicit-disorder | \ | 3.23 | 6.90 | 0.00 | 0.00 | 6.90 | \ | \ | |
| FileNotFoundError | Explicit-origin | \ | 0.00 | \ | \ | \ | \ | \ | \ |
| Implicit-origin | 0.00 | 0.00 | 0.00 | 0.00 | 1.18 | 1.18 | 0.00 | 1.85 | |
LLM Evaluation
Large language model evaluation measures what models can do, how reliably they do it, and whether benchmark scores predict real-world performance.
See all 2,408 papers