TL;DR
This paper introduces TransitLM, a large-scale dataset and benchmark designed to train Large Language Models (LLMs) for end-to-end, map-free public transit route planning. By treating transit routing as a text-generation problem, the authors demonstrate that an LLM can internalize complex urban topologies and implicitly ground raw GPS coordinates to physical stations without relying on traditional map databases or routing engines.
What Problem Does This Paper Address?
Traditional public transit route planning is computationally heavy and structurally rigid. It relies on explicit graph representations of transit networks and specialized routing algorithms (like Dijkstra, A*, or RAPTOR) to retrieve and rank candidate paths.
While general-purpose LLMs excel at many reasoning tasks, they fail spectacularly at transit routing when used out-of-the-box. Because they lack domain-specific topological knowledge, they frequently hallucinate non-existent stations, propose broken transfers, or fail to align raw GPS coordinates with actual transit access points. Existing datasets don't solve this: vehicle trajectory datasets lack station structures, while static network datasets (like GTFS) lack real-world user behavior and preference data.
The authors ask a fundamental question: Can end-to-end transit route planning be learned entirely from data, bypassing maps and routing engines altogether?
Methods
To turn an LLM into a self-contained routing engine, the authors implement a two-stage training pipeline:
- Vocabulary Expansion: Instead of letting the model tokenize station names as standard text (which leads to spelling-based hallucinations), they register all 120,845 unique station IDs as dedicated tokens in the LLM's vocabulary.
- Domain-Adaptive Continual Pre-Training (CPT): The model is trained on millions of unstructured textual route descriptions and static station/line properties to help it internalize the "grammar" and spatial relationships of the transit network.
- Supervised Fine-Tuning (SFT): The model is fine-tuned on standardized prompt-label pairs to solve specific routing tasks, outputting structured JSON containing line sequences, station sequences, transfer markers, and estimated trip attributes (distance, time, fare).
The authors also evaluate a Joint Training approach, where a single model is trained simultaneously across multiple routing objectives to see if transit knowledge transfers across tasks.
Datasets
The authors introduce two core resources, collectively called TransitLM:
- TransitData: A massive pre-training corpus containing over 13 million real-world route planning logs from Amap (a leading Chinese navigation platform) across four major cities: Beijing, Shanghai, Shenzhen, and Chengdu. It covers 120,845 stations and 13,666 transit lines, supplemented by 1 million static descriptions of lines and stations.
- TransitBench: An evaluation benchmark featuring 10,000 test samples for three core tasks:
- Optimal Route Generation (ORG): Finding the best route based on historical user choices.
- Preference-Aware Planning (PRG): Customizing routes based on constraints like "subway-first" or "fewer transfers."
- Multi-Route Generation (DRG): Providing three distinct, diverse routing alternatives.
Key Insights and Ideas
- Emergent Implicit Spatial Grounding: Remarkably, when given only raw origin-destination GPS coordinates without any text names, the trained LLM successfully resolves them to appropriate nearby boarding and alighting stations. It learns a continuous mapping of coordinate space to discrete station tokens purely from data exposure.
- A Learning Hierarchy Exists: Data scaling experiments reveal that LLMs grasp basic network topology (connectivity) very quickly, even with a tiny fraction (6.25%) of the training data. However, precise route matching and numeric calibration (predicting exact travel times and fares) are highly data-hungry and require full-scale training.
- Transit Knowledge is Task-Agnostic: The jointly trained model (
4B-Joint) matched or outperformed single-task models across the board. Exposure to diverse planning constraints (like "bus-first") actually reinforced the model's underlying spatial understanding, showing zero negative transfer.
Key Results
The authors evaluated their approach using base models from the Qwen3 family (0.6B, 1.7B, and 4B parameters):
- Vs. General-Purpose LLMs: On the Optimal Route Generation task, commercial giants like Gemini-3.1-Pro and GPT-5.4 struggled, achieving only 40.2% and 18.4% Route Exact Match (REM) respectively under lenient evaluation conditions. In contrast, the dedicated Qwen3-4B model achieved 71.0% REM and 97.0% path connectivity.
- The GPS-Only Stress Test: When all textual names were stripped from the prompt—leaving only raw coordinates—commercial LLMs collapsed to near 0% exact matches. The TransitLM-trained models showed virtually zero performance degradation, proving they weren't just memorizing text strings but were utilizing learned spatial representations.
- Vs. Tool-Augmented Agents: The map-free
4B-Jointmodel achieved comparable structural accuracy (83.5% Line Overlap) to LLM agents explicitly hooked up to production routing APIs, demonstrating that an LLM can internalize the capabilities of a heavy engineering pipeline.
Limitations and Future Work
- Vocabulary Scaling: Registering every station as a unique token causes linear vocabulary growth. Expanding this method nationwide across China would require roughly 1.8 million tokens, creating massive memory and computational overhead. Hierarchical or compressed tokenization schemes are needed.
- Static Snapshot Constraints: The model operates on a static snapshot of the transit network. It cannot natively adapt to real-time disruptions, traffic congestion, temporary route adjustments, or newly opened lines without being retrained.
- Geographic and Language Bias: The dataset is currently limited to four Chinese cities, and all textual prompts are in Chinese. Cross-regional and cross-lingual generalizability remains unverified.
Summary updated