TL;DR
This paper introduces CityGPT, a framework to improve Large Language Models' (LLMs) understanding of urban environments. By creating a specialized dataset (CityInstruction) and a novel self-weighted fine-tuning method (SWFT), CityGPT significantly enhances LLMs' urban spatial cognition, enabling smaller models to rival proprietary ones on a new urban benchmark (CityEval).
What Problem Does This Paper Address?
While LLMs have shown remarkable success in general language tasks, they often struggle with real-world geospatial challenges in urban settings. This limitation stems from a lack of specific physical world knowledge and relevant training data. Existing evaluations are often limited to simple coordinate predictions or global-scale analyses, failing to capture the nuances of urban spatial cognition. The authors aim to bridge this gap by developing a comprehensive framework for both evaluating and enhancing LLMs' abilities in understanding and interacting with urban environments.
Methods
The core of CityGPT lies in three main components:
- CityInstruction Dataset: This dataset is designed to inject urban knowledge into LLMs. It's built by simulating human mobility behaviors in urban environments, collecting multi-view data (like observations at specific locations), and then augmenting it with diverse instructions. Crucially, it includes "CityReasoning" data with explicit intermediate steps for spatial reasoning, mimicking human cognitive processes.
- Self-Weighted Fine-Tuning (SWFT): This novel fine-tuning method addresses the issue of "low-quality" data that can hinder LLM performance. SWFT automatically assesses data quality by analyzing the loss of a base LLM and a warm-up LLM. It then adaptively assigns lower weights to problematic samples in the loss function, allowing the model to focus on more robust and informative data, thereby improving spatial skills without compromising general capabilities.
- CityEval Benchmark: This is a comprehensive evaluation benchmark designed specifically for urban spatial cognition. It's structured into four sub-modules: City Image (understanding fundamental urban elements), Urban Semantics (human activities and urban functions), Spatial Reasoning (quantitative reasoning and spatial cognition), and Composite Tasks (integrating capabilities for tasks like mobility prediction and navigation).
Datasets
- CityInstruction: A newly constructed dataset for instruction tuning, comprising CityQA, CityWalk, and CityReasoning.
- General Instruction Data: A mix of existing datasets like ShareGPT, UltralChat, Open-Platypus, and AgentTuning, along with geographical datasets (GeoGLUE) and spatial reasoning datasets (StepGame, ReSQ).
- CityEval Benchmark: A newly introduced benchmark for evaluating LLMs on urban spatial tasks, divided into City Image, Urban Semantics, Spatial Reasoning, and Composite Tasks.
Key Insights and Ideas
- Human-like Spatial Cognition is Key: The paper emphasizes that mimicking human cognitive processes, especially embodied experiences and explicit reasoning steps, is crucial for LLMs to truly understand urban spaces.
- Data Quality Over Quantity (to an extent): SWFT highlights that not all training data is created equal. Effectively weighting data based on its quality and impact on learning is more beneficial than simply using more data, especially for complex tasks.
- Domain-Specific Evaluation is Essential: Existing benchmarks are insufficient for assessing LLMs in urban contexts. CityEval provides a much-needed, multi-faceted evaluation suite that captures the complexity of urban spatial intelligence.
- Smaller Models Can Shine: The research demonstrates that with the right training and evaluation, smaller LLMs can achieve performance comparable to, or even exceeding, larger proprietary models on specific domain tasks.
Key Results
- CityGPT-trained models, particularly CityGPT-Qwen2.5-7B, significantly outperform baseline LLMs across most tasks in the CityEval benchmark.
- In the challenging Spatial Reasoning task, CityGPT-7B achieved performance gains of 148% to 237% compared to its base model.
- CityGPT-7B demonstrated performance competitive with, and in some cases superior to, proprietary LLMs like GPT-3.5 and GPT-4 mini on CityEval.
- The SWFT method showed improved performance over standard fine-tuning (SFT) on both CityEval and general benchmarks, with gains ranging from 0.8% to 27%.
- Spatial transferability was observed, with models trained on data from one city performing well in evaluations of other cities, indicating the learning of general spatial cognition.
Limitations and Future Work
- General Capability Trade-offs: While SWFT aims to mitigate this, some CityGPT models showed a decline in general capabilities (e.g., on MMLU and GSM8K) compared to their base models, suggesting that further research is needed to perfectly balance domain-specific enhancement with general knowledge retention.
- Challenging Benchmarks: The paper notes that even with CityGPT, performance on the most challenging tasks (like Spatial Reasoning without context) still has room for improvement.
- Future Directions: The authors plan to validate the framework in more cities globally and explore incorporating multi-modal data (remote sensing, street view images) to further enhance foundation models. They also suggest future work on optimizing parameter search for SWFT.
Summary updated