TrajLLM: A Modular LLM-Enhanced Agent-Based Framework for Realistic Human Trajectory Simulation

Chenlu Ju, Jiaxin Liu, Shobhit Sinha, Hao Xue, Flora Salim

Abstract

TrajLLM is a modular framework that leverages Large Language Models (LLMs) to simulate realistic human movement patterns. By integrating LLM-driven reasoning with physical spatial models and a hierarchical memory system, TrajLLM generates "digital twins" that exhibit human-like intent and personality. This approach provides a privacy-preserving alternative to sensitive real-world mobility data while maintaining high behavioral realism.

Introduction

Understanding urban mobility is crucial for city planning, traffic management, and public health. However, researchers face significant challenges: real-world data is often expensive and privacy-sensitive, while traditional mechanistic models fail to capture the complexity of human intent. Deep learning models, though powerful, often lack interpretability. TrajLLM addresses these issues by using LLMs to provide the "why" (intent) behind movement, while physical models handle the "where" (spatial constraints) efficiently.

Methodology

The TrajLLM framework is built upon a hierarchical architecture consisting of four primary modules designed to simulate coherent human behavior over time.

The TrajLLM architecture integrates persona preprocessing, routine activity generation, a hierarchical memory module, and a hybrid destination selection process.

Core Modules

  • Persona Module: Generates agents based on real-world government statistics (age, gender, occupation) and "Big Five" personality traits. It assigns "anchor" locations like homes and workplaces to ensure routine consistency.
  • Activity Module: Uses LLMs (e.g., Llama-3 or GPT-4o-mini) to iteratively predict the next activity (e.g., "exercise at a park") based on the agent’s persona and historical routine.
  • Destination Module: Employs a hybrid approach. It can use the LLM for personalized historical visits or a Potential-based Spatial Model inspired by gravity models to calculate visit probabilities based on distance and frequency.
  • Memory Module: Implements a hierarchical memory (daily, weekly, monthly summaries) with a forgetting mechanism. It prioritizes significant "events" and "entities" over minor attributes to maintain consistency without exceeding the LLM's context window.

Data Sources

The framework utilizes the Tokyo Check-in Dataset for POI information and official Japanese Government Population Statistics to ensure demographic accuracy. Static POI data maps activity categories to real-world coordinates.

Key Insights

  • Personality-Driven Mobility: Integrating the "Big Five" personality traits allows agents to exhibit diverse behaviors; for example, extroverted agents may engage in more social activities compared to conscientious agents focused on work.
  • Hybrid Physics-LLM Approach: By offloading precise spatial calculations to a physical model, TrajLLM balances computational efficiency with behavioral realism.
  • Cognitive Memory Modeling: The "smart forgetting" mechanism mimics human cognition, ensuring agents remain coherent over long-term simulations by prioritizing significant memories.

Results and Simulation

Preliminary results indicate that TrajLLM simulations align closely with observed real-world movement patterns in Tokyo. The modular design supports scalability, allowing for the simultaneous simulation of multiple agents.

A web-based interface demonstrates the TrajLLM framework in action, visualizing real-time agent trajectories and live movement updates for Tokyo residents.

The authors developed a web-based interface where users can adjust parameters and observe trajectories in real-time. A key advantage of this framework is its interpretability; TrajLLM provides a "chain-of-thought" for agent decisions, making the synthetic data actionable for urban planners.

Limitations and Future Work

While promising, the framework faces challenges such as inherent LLM biases and the current lack of agent-to-agent social interaction. Future research will focus on modeling social dynamics, such as group meetings and crowd formation. Additionally, the authors stress that generated data must be labeled as synthetic to prevent policy-making errors.

Summary updated

BibTeX
@misc{ju2025trajllm,
  author = {Chenlu Ju and Jiaxin Liu and Shobhit Sinha and Hao Xue and Flora Salim},
  title = {{TrajLLM: A Modular LLM-Enhanced Agent-Based Framework for Realistic Human Trajectory Simulation}},
  year = {2025},
  eprint = {2502.18712},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.18712},
}
Figure