Large Language Models as Urban Residents: An LLM Agent Framework for Personal Mobility Generation

Jiawei Wang, Renhe Jiang, Chuang Yang, Zengqing Wu, Makoto Onizuka, Ryosuke Shibasaki, Noboru Koshizuka, Chuan Xiao

TL;DR

The paper introduces LLMob, a pioneering framework that transforms Large Language Models (LLMs) into simulated urban residents to generate realistic personal mobility trajectories. By combining long-term habitual activity patterns with short-term daily motivations, LLMob outperforms traditional deep learning models in capturing the semantic and temporal nuances of human movement, even adapting seamlessly to unprecedented scenarios like a pandemic.

What Problem Does This Paper Address?

Understanding and simulating how people move around cities—personal mobility generation—is crucial for urban planning, traffic management, and privacy-preserving data sharing. Traditional approaches rely on data-driven models (like LSTMs, GANs, or Diffusion models) trained on raw GPS coordinates.

While these models are good at mimicking statistical data distributions, they suffer from two major flaws:

  1. Lack of Semantic Interpretability: They treat locations as coordinates rather than meaningful places (e.g., a restaurant, a park, or home). They don't understand why a person is traveling.
  2. Poor Versatility: Because they only copy past data distributions, they fail completely when faced with novel, unseen scenarios where behavior shifts drastically—such as during a global pandemic or a major policy change.

This paper tackles these gaps by leveraging the semantic reasoning capabilities of LLMs to create context-aware, interpretable human mobility simulators.

Methods

The authors propose LLMob, a two-phase LLM agent framework that models individual daily activity trajectories based on two core factors: habitual patterns and immediate motivations.

Figure 2: LLMob, the proposed LLM agent framework for personal Mobility generation.

Phase 1: Self-Consistent Activity Pattern Identification

To establish a baseline of an individual's habits, the framework extracts candidate patterns from historical check-in data combined with specific personas (e.g., student, office worker). To ensure accuracy, it uses a novel Self-Consistency Evaluation. The LLM rates how likely a target resident's actual trajectory matches a candidate pattern versus trajectories from other residents. The pattern with the highest contrastive score is selected as the resident's true habit profile.

Phase 2: Motivation-Driven Activity Generation

Since daily life is dynamic, the framework uses Retrieval-Augmented Generation (RAG) to supply the agent with current context. The authors design two distinct retrieval strategies to infer daily motivations:

  • Evolving-based Motivation Retrieval: The LLM reviews the agent's activities over the previous few days to deduce what their immediate next-day needs or interests might be.
  • Learning-based Motivation Retrieval: An unsupervised contrastive learning model matches the target date with historically similar dates based on temporal features, allowing the LLM to extract relevant past motivations.

Finally, the LLM agent is prompted to act as an urban resident, combining its identified habit pattern and current daily motivation to output a structured JSON plan of the day's activities and locations.

Figure 3: Evolving-based motivation retrieval.

Datasets

The framework was evaluated on real-world personal activity trajectory datasets from two major Japanese cities:

  • Tokyo Dataset: Collected via Twitter and Foursquare APIs spanning January 2019 to December 2022. This dataset is particularly valuable because it covers both normal pre-pandemic routines and abnormal pandemic-era disruptions.
  • Osaka Dataset: Used to validate the framework's robustness across different urban environments.

LLMob was benchmarked against classic and state-of-the-art baselines, including Markov Models, DeepMove, TrajGAIL, ActSTD, and DiffTraj.

Key Insights and Ideas

  • Semantics Drive Realism: Traditional models struggle to capture the logic of daily routines. LLMob excels because it understands abstract concepts (e.g., "a person usually eats breakfast after waking up") rather than just trying to predict the next coordinate pair.
  • Zero-Shot Adaptation to Crises: Because LLMs possess broad world knowledge, researchers can inject a macro-level context constraint (e.g., "Now it is the pandemic period. The government has asked residents to telecommute..."). The LLM agents naturally adapt their behavior in a realistic, human-like manner without requiring any model retraining.
  • The Necessity of Filtering: Simply asking an LLM to summarize a user's habits yields noisy results. The paper's contrastive self-consistency check is vital to grounding the LLM's generation in actual, verified individual behavior.

Key Results

The authors evaluated the generated trajectories using Jensen-Shannon Divergence (JSD) across multiple metrics, where lower JSD indicates a closer match to real-world data.

  • Superior Temporal and Routine Accuracy: LLMob significantly outperformed all baselines in Step Interval (SI) and Daily Activity Routine Distribution (DARD). On the DARD metric, LLMob cut the error (JSD) by roughly 1/2 to 1/3 compared to the best deep learning baselines (achieving a JSD of ~0.12 vs. DeepMove's ~0.53).
  • Pandemic Simulation Success: When tested on generating abnormal pandemic-era trajectories using normal pre-pandemic data, LLMob successfully reproduced realistic drops in activity frequencies for categories like "Food" and "Arts & Entertainment," closely mirroring actual ground-truth behavioral shifts.

Limitations and Future Work

The authors acknowledge several limitations that pave the way for future research:

  • Lack of Multi-Agent Interaction: Currently, LLMob models individuals in isolation. It does not simulate social dynamics, such as friends deciding to visit a location together or family dependencies.
  • Data Sparsity: Real-world check-in data from social media APIs can be incomplete, meaning the models are sometimes predicting based on fragmented histories.
  • LLM Scope: Due to API cost constraints, the bulk of the comprehensive testing was limited to GPT-3.5-turbo, though preliminary tests with GPT-4o-mini and Llama 3-8B demonstrated that the framework's performance remains robust across different base models.

Summary updated

Abstract

This paper introduces a novel approach using Large Language Models (LLMs) integrated into an agent framework for flexible and effective personal mobility generation. LLMs overcome the limitations of previous models by effectively processing semantic data and offering versatility in modeling various tasks. Our approach addresses three research questions: aligning LLMs with real-world urban mobility data, developing reliable activity generation strategies, and exploring LLM applications in urban mobility. The key technical contribution is a novel LLM agent framework that accounts for individual activity patterns and motivations, including a self-consistency approach to align LLMs with real-world activity data and a retrieval-augmented strategy for interpretable activity generation. We evaluate our LLM agent framework and compare it with state-of-the-art personal mobility generation approaches, demonstrating the effectiveness of our approach and its potential applications in urban mobility. Overall, this study marks the pioneering work of designing an LLM agent framework for activity generation based on real-world human activity data, offering a promising tool for urban mobility analysis.
BibTeX
@inproceedings{wang2024large,
  author = {Jiawei Wang and Renhe Jiang and Chuang Yang and Zengqing Wu and Makoto Onizuka and Ryosuke Shibasaki and Noboru Koshizuka and Chuan Xiao},
  title = {{Large Language Models as Urban Residents: An LLM Agent Framework for Personal Mobility Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=1iHmhMHNyA},
}
Figure