arXiv:2610.21393cs.AIOct 2026

Manuscript Offprint

arXiv:2610.21393

Self-Guided LLM Reasoning for Error Diagnosis in Vehicle Routing Problems

Ni Zhang, Jianan Zhou, Yue-Jiao Gong, Zhiguang Cao

Abstract

Vehicle Routing Problems (VRPs) are fundamental to many real-world applications. Recent advances in large language models (LLMs) have spurred progress in solving these NP-hard problems. However, most existing approaches assume that input instances are error-free, neglecting the presence of faults commonly encountered in real-world data. In this work, we systematically investigate the capability of LLMs to detect (and correct) errors in VRP instances, and identify key limitations, particularly in handling complex instances or errors that substantially increase the LLM's reasoning burden. To overcome these challenges, we propose a self-guided reasoning framework in which LLMs autonomously generate code that provides structured insights to aid in error diagnosis. Experiments across diverse problem settings and LLMs demonstrate that our framework significantly improves error detection performance, achieving near-perfect accuracy.

1 Introduction

Vehicle Routing Problems (VRPs) are widely deployed in real-world decision-making pipelines across last-mile delivery (Tiwari and Sharma 2023; Tilk, Olkis, and Irnich 2021; Kitjacharoenchai and Lee 2019), transportation (Gayialis, Konstantakopoulos, and Tatsiopoulos 2019; Wang et al. 2024; Xu et al. 2023), and ride-sharing (Lin et al. 2012; Guo et al. 2022; Chen et al. 2019). While decades of research have produced highly efficient optimization algorithms, the reliability of these pipelines remains fragile: subtle inconsistencies or latent errors in problem instances can lead to solver failures or infeasible solutions. Most VRP solvers assume that input instances are well-formed and feasible. In practice, however, instances may contain errors such as formatting issues, missing fields, or violated feasibility constraints. Importantly, many of these faults are latent as they are not immediately evident from the instance specification and require additional analysis to be identified. Given the diversity of VRP formulations and input formats across problem settings, designing general-purpose programs for automatic error detection is highly challenging. As a result, prior approaches typically rely on domain expertise or post hoc analysis of solver outputs to infer potential instance-level issues, which is both time-consuming and expertise-dependent.

Recent advances in large language models (LLMs) offer a promising new direction. With strong language understanding and reasoning capabilities, LLMs can interpret diverse inputs and reason about structured information. These capabilities naturally prompt following questions: a) Can LLMs be enabled to identify and correct errors in VRP instances? b) How and why does such reasoning succeed or fail? c) Under what conditions do LLMs struggle to identify errors, and how can these limitations be effectively mitigated?

Recent work has begun to explore this direction. For example, MOID (Li et al. 2025) attempts to identify potential instance-level issues by examining the feasibility of solutions produced by a solver. However, it heavily relies on solver outputs and thus inherits their limitations, since infeasible solutions may arise from solver deficiencies rather than errors in the input instance. Moreover, a comprehensive evaluation of LLMs' capability to directly identify and correct errors within VRP instances remains absent to date.

In this paper, we systematically investigate the capability of LLMs to diagnose errors in VRP instances. To address the aforementioned research questions, we evaluate: (i) LLMs' ability to handle increased error complexity, (ii) their ability to cope with increased instance complexity, and (iii) the effect of iterative reasoning on error detection performance. Our findings show that (i) LLMs perform well in detecting formatting errors and relatively simple constraint violations, such as capacity and demand constraints. However, their ability to identify more complex constraint violations, including time windows and distance limits, as well as scenarios with larger numbers of errors, is substantially weaker. (ii) Detection performance degrades as instance scale and constraint counts increases, indicating limited robustness under increased instance complexity. (iii) While iterative reasoning improves the detection of formatting issues and simple constraint violations, it provides limited benefit for identifying more complex errors.

In summary, we find that LLMs are effective at identifying and correcting errors in relatively simple settings, whereas their performance degrades when confronted with instances or errors of higher complexity. To address limitations, we propose a self-guided reasoning framework in which the LLM generates analysis code as an intermediate reasoning tool. This code enables the model to extract structured insights that facilitate error detection while alleviating overall reasoning burden. Our contributions are summarized as follows:

• We present a comprehensive study of LLMs’ capability to detect errors in VRP instances, including a systematic analysis of how error complexity, instance complexity and reasoning depth affect detection performance.

  • We propose a self-guided reasoning framework in which LLMs generate code to derive intermediate reasoning insights, addressing their limitations in handling complex errors while reducing the overall reasoning burden.

  • Extensive experiments across diverse problem settings, including vehicle routing and bin packing, demonstrate that our framework significantly enhances error detection performance, achieving near-perfect accuracy.