Manuscript Offprint

arXiv:2609.02250

RideSkill: A Hierarchical Algorithm for Generalized Ride Sharing with LLM-Driven Automatic Evolution

Zijian Zhao, Sen Li, Xialiang Tong, Mingxuan Yuan

ABSTRACT

Ride-sharing, which allows multiple passengers with different origin-destination (OD) pairs to share a single vehicle, is a challenging operational problem, as it requires orders with different OD pairs to be efficiently bundled and assigned to vehicles under uncertain and varying scenarios. Although multi-agent reinforcement learning (MARL) solutions have achieved promising performance, they suffer from limited generalization (adapting to different environmental scenarios), low transferability (adapting to different platform objectives), and training difficulties in large-scale systems, such as the curse of dimensionality. Recently, motivated by the scaling of large language models (LLMs), several works have incorporated LLMs into ride-hailing systems, either by employing LLMs directly as decision-making agents or using them for automatic algorithm design. However, none of these approaches support vehicle sharing, which complicates the problem by expanding both the state and action spaces exponentially. Moreover, most of them require frequent LLM calls at inference time, making them infeasible for real-time deployment. To address these issues, we propose RideSkill, a hierarchical method for ride-sharing that leverages LLM-assisted automatic algorithmic design. RideSkill consists of a combiner that assigns appropriate skills to each vehicle from a learned skill repository, enabling adaptive dispatch under varying scenarios and objectives, and a repositioner that sequentially relocates idle vehicles to emerging regions, avoiding conflicts among vehicles. Crucially, the skill repository, combiner, and repositioner are all trained by an LLM-based automatic evolutionary method, eliminating the need for LLM calls during deployment and thus ensuring high real-time performance. Evaluated on a real-world ride-hailing dataset, RideSkill achieves the best performance compared to model-based, MARL-based, and LLM-based benchmarks. Most crucially, our method demonstrates strong generalization and flexibility across different fleet sizes, vehicle speeds, passenger capacities, order densities, and objectives, suggesting high practical application value. Our code is provided at https://anonymous.4open.science/r/RideSkill-6AAD.

1 INTRODUCTION

Ride-sharing systems, which allow multiple passengers with different origin–destination (OD) pairs to share a single vehicle, have emerged as a transformative paradigm in urban mobility. By increasing vehicle occupancy and reducing the total number of trips, they alleviate traffic congestion, lower carbon emissions, and improve the overall efficiency of transportation networks. Beyond these environmental benefits, ride-sharing enhances passenger convenience through lower fares and shorter waiting times while enabling platforms to serve more demand with a limited fleet, thereby generating substantial social and economic value in densely populated cities (Jin et al., 2018).

∗^{*}Project Lead: Xialiang Tong

†^{\dagger}Corresponding Author: Sen Li

Existing approaches to order dispatching in ride-sharing largely fall into two categories. Classical optimization and rule-based methods, although computationally efficient, are typically myopic (Alonso-Mora et al., 2017a). Multi-agent reinforcement learning (MARL) techniques have demonstrated stronger performance by learning long-term policies, yet they suffer from the curse of dimensionality when the number of vehicles and orders grows large (Hao & Varakantham, 2022). More critically, once the model is formulated or the policy is trained, they struggle to adapt to changing environmental conditions (e.g., different fleet sizes, vehicle speeds, or capacities) or to shifts in platform objectives. In practice, a platform's objectives (e.g., maximizing service rate, minimizing passenger detour, or balancing vehicle income) may evolve rapidly with market conditions and government regulation, rendering static solutions inadequate. More seriously, most transfer RL methods fail in multi-agent settings, since the change in other agents' policies alters the environment as experienced by any given agent (Barreto et al., 2018).

Recently, large language models (LLMs) have been introduced into ride-hailing systems, either by treating an LLM as a decision-making agent that directly selects orders for individual vehicles or by employing it as a global matcher (Lyu et al., 2026a; Zhang & Xiao, 2026; Su et al., 2025). While these approaches leverage the reasoning capabilities of LLMs, they require frequent model calls at inference time and are therefore unsuitable for the stringent latency requirements of real-time ride-sharing. An alternative line of work uses LLMs for automatic algorithm discovery: by combining the generative power of LLMs with evolutionary search, new heuristics or policies can be designed offline (Zhang et al., 2026). Compared with traditional evolutionary algorithms, LLMs inject rich prior knowledge and enable more effective exploration of the algorithm space. However, existing LLM-based methods have been developed exclusively for ride-hailing. Extending them to ride-sharing is non-trivial, as it requires considering feasible order combinations, which expands the state and action spaces, modeling inter-order dependencies, and handling vehicles that become heterogeneous once they carry en-route passengers. More critically, all of these methods are still trained on a single fixed scenario and objective, as in conventional MARL-based solutions. As a result, the obtained policies exhibit limited generalization across different operating conditions and limited transferability when the platform's objective changes. (A detailed literature review is provided at Appendix A.)

To address these challenges, we propose RideSkill, a hierarchical framework that performs adaptive order dispatching and vehicle repositioning under varying scenarios and platform objectives. RideSkill maintains (i) a repository of reusable basic skills (e.g., nearest matching, detour minimization, service-rate maximization); (ii) a combiner that, conditioned on the current environment and objective, dynamically assigns an appropriate skill to each vehicle; and (iii) a sequential repositioner that relocates idle vehicles to emerging demand regions while avoiding conflicts that would arise from simultaneous decisions. All three components are trained offline by a carefully designed LLM-assisted evolutionary procedure that incorporates self-checking, diverse task generation, and a group-relative fitness formulation. Once trained, the resulting policies operate without any LLM calls, thereby satisfying real-time constraints while retaining strong generalization and transferability. We validate RideSkill on a large-scale ride-sharing simulator built from real New York City trip data. The results show that RideSkill outperforms all types of baselines across different scenarios and objectives. To the best of our knowledge, RideSkill is the first LLM-based solution for ride-sharing tasks, and the first generalized approach capable of addressing diverse scenarios and objectives.

References (31)