UrbanLLMind
Scalable LLM-powered urban mobility simulation with open-weight models
UrbanLLMind is a city simulation in which every resident is driven by an open-weight large language model. Each agent plans its day, decides where to go next whenever an activity ends, remembers what happened, and reflects on its routine at night. The city is built from real data: buildings and streets from OpenStreetMap, and residents generated from census tracts with realistic age, employment, household, income and car ownership. A simulation engine keeps the clock in 5-minute steps, handles travel between places, and checks every decision the model makes, so agents cannot teleport or break the rules of the world.
How an agent thinks
Each agent has three moments of decision. At the start of the day it sketches a rough plan. Whenever an activity ends it decides what to do next and for how long, returning a short rationale and a structured answer the engine can check. At the end of the day it reflects on what happened and turns repeated behavior into routines. A memory stream of observations, decisions and reflections ties the days together: before each decision, the most recent, important and relevant memories are put back into the prompt.
Here is one agent from the simulated week, #8429, a 34-year-old lecturer with school-age children:
“I’ll start the morning at home getting the kids ready and dropping them off at school before driving to the college for a morning lecture…”
“Leaving home to drop the kids off at school before heading to the college for my morning lecture.”
“…dropping the kids at school, and later in the evening I picked them up and took a brief family walk after dinner.”
The decision step is a single prompt. An abridged version, taken from the paper’s appendix for a different agent (a 32-year-old full-time worker), looks like this:
Current Context: - Time: Monday, 2025-09-08 07:05 - Current Location: Home - Today rough plan (soft guidance, created at first decision): Morning, I’ll head out of Home around 7 am for a quick breakfast at a local café before commuting to work in the city… Reference Data: - Recent Activity: (no activity yet) - Relevant Memories: - [2025-09-08 07:05] (memory) At 07:05 on 2025-09-08 you were at Home for 425.0 minutes. Activity Codes: 1: Home 2: Work 3: Eat Meal 4: Education 5: Recreational 6: Shopping 7: Care 8: Community 9: Other 10: Social Visit Decision Logic: - Authenticity: Ensure your decision is a realistic expression of your demographic identity, the current time/day, and your city's environment. - Anchor: The Daily Plan is a rough guide, not a script. Adapt if current context makes the plan impractical. … Return JSON ONLY: { "rationale": "<string>", "next_activity_type": <int>, "stay_minutes": <int> }
Grounded in real travel diaries
Prompting alone already produces plausible days, but we also adapt the model to how people actually move. We take San Francisco and national person-days from the 2017 National Household Travel Survey (NHTS), replay each one through the simulator’s own planning and decision steps, and turn them into training examples in exactly the format the agents use at run time. Two LoRA adapters for the open-weight GPT-OSS-20B come out of this: one trained on 3,950 San Francisco examples (FT-SF) and one on 4,000 examples from across the U.S. (FT-US).
We then simulate 1,000 agents for a week and compare their travel with the real San Francisco diaries at three levels: daily patterns, trips between activity types, and complete daily activity chains. The baseline is Patterns of Life, a conventional rule-based agent simulation.
| Model | Places / day | Travel h / day | Transition error ↓ | Chain precision % | Chain recall % | Chain overlap % |
|---|---|---|---|---|---|---|
| Real diaries (NHTS, San Francisco) | 5.37 | 1.74 | – | – | – | – |
| Patterns of Life (rule-based) | 4.26 | n/a | 0.2208 | 84.98 | 36.60 | 26.57 |
| GPT-OSS-120B, prompt only | 5.22 | 1.14 | 0.1471 | 77.20 | 46.34 | 23.28 |
| GPT-OSS-20B, prompt only | 5.66 | 1.28 | 0.1791 | 67.70 | 46.21 | 28.23 |
| GPT-OSS-20B + LoRA, San Francisco | 5.21 | 1.14 | 0.0843 | 66.60 | 52.92 | 43.74 |
| GPT-OSS-20B + LoRA, U.S. | 4.86 | 1.02 | 0.0776 | 68.60 | 54.68 | 44.18 |
Table 1 of the paper; best simulated value in each column highlighted. Transition error is the distance between the real and simulated activity-to-activity transition matrices (Frobenius norm). Precision is the share of simulated daily chains (such as Home → Work → Shop → Home) that occur in real diaries, recall is the share of real chains the simulation reproduces, and overlap also weighs how often each chain occurs. The rule-based baseline has the highest precision because it repeats a narrow set of common chains.
Reacting to a storm warning
A rule-based model only does what its rules allow. LLM agents can react to news. We rerun the same week and add one sentence to every agent’s prompt on Tuesday and Saturday:
A severe storm has been forecast for today. Travel across the city is expected to be heavily disrupted. The city emergency management department has advised residents to limit travel as much as possible.
The number of places visited drops sharply on both days for all four models, and the trips that remain lean toward necessities: for GPT-OSS-20B, work makes up 28% of trips on the storm Tuesday compared with 20% on Monday and Wednesday. Nothing storm-specific is programmed; the agents read the warning and replan. Agent #8429, for example, keeps the school run but works from home:
“I’ll start the day at home preparing breakfast and driving the kids to school before the morning storm hits, then work remotely from my home…”
What each part of the agent adds
Switching parts of the decision stack on one at a time (GPT-OSS-120B, same 1,000 agents and week) shows what each contributes:
| Configuration | Places / day (Δ vs real) | Transition error ↓ | Weekday continuity ↑ | Routine specificity ↑ |
|---|---|---|---|---|
| Reactive decisions only | 4.328 (−1.045) | .250 | .708 | .026 |
| + Day planning | 5.553 (+0.180) | .153 | .614 | .039 |
| + Memory | 5.357 (−0.016) | .132 | .652 | .050 |
| + Reflection (full stack) | 5.245 (−0.128) | .144 | .737 | .127 |
Table 3 of the paper. Weekday continuity measures how similar an agent's weekdays are to each other; routine specificity (the paper's matched-control delta) measures how much more an agent's weekdays resemble its own other weekdays than those of other agents with the same role.
Planning gives each day its structure, memory brings the population closest to the real data, and reflection keeps every agent’s routine its own from day to day.
Ongoing work
The next version of UrbanLLMind, in progress and not yet published, moves from individuals to households and social ties:
- Households and friends that coordinate. Family members and friends plan together by messaging each other: parents take children to school, a household shares its cars, and friends meet up.
- Learning from real days. Real surveyed household days are run through the simulator to become training examples.
- Open-weight fine-tuning. The open-weight GPT-OSS-20B is fine-tuned on those examples.
- Reinforcement learning, with the simulation as teacher. Agents are rewarded for keeping their arrangements and for weeks that look like real people’s.
- More cities. Extending beyond San Francisco to other U.S. cities.
An example household’s day in the new simulation: a family of four, where one parent handles the school run and the other has dinner with a friend from another household.
- 08:05 the mother drives both girls to school
- 16:25 she picks them both up
- 18:40–19:30 the father has dinner with a friend from another household
Poster
UrbanLLMind builds on our earlier work on synthesizing travel surveys with LLMs, which introduced the evaluation used above.