From Geographic Memory to Spatial Generalization in Large Language Models
Organizations: University of Southern California · NYU Shanghai · University of Chinese Academy of Sciences
Abstract
Large language models (LLMs) can associate places with geographic descriptions, but recovering an observed association does not establish an ability to generalize across geographic space. We distinguish geospatial memory, the recovery of location--description associations observed during training, from spatial generalization, the prediction of descriptions for locations in unobserved regions. We investigate whether continuous location representations improve this generalization and encourage geographic knowledge to become spatially organized within an LLM. We frame this organization as a latent spatial field: a learned mapping from locations to descriptions connected through spatial dependencies. Building on a continuous spatial encoder, we project location representations into the model's embedding space and supply them as spatial tokens. We evaluate the resulting models on two newly curated geo-text benchmarks for Los Angeles and London using two complementary assessments. Geospatial captioning tests both memory and spatial generalization by generating descriptions at observed locations and at locations beyond the spatial coverage of the training observations. A separate geospatial grounding model tests whether generated location--description pairs provide useful additional supervision for mapping text to geographic space. Across multiple LLM families, continuous location representations improve captioning at unobserved locations relative to textual coordinates, while their generated descriptions yield modest but consistent improvements in downstream grounding. Layer-wise probing and representation clustering provide additional evidence consistent with spatially organized geographic representations. Together, these findings show the value of evaluating spatial generalization separately from memory and of incorporating continuous spatial representations into language models.
Figures & tables
| Los Angeles | London | |||
| Method | BERT | ROUGE | BERT | ROUGE |
| Random | 0.4410 | 0.2070 | 0.4664 | 0.2282 |
| GPT-OSS | 0.4048 | 0.1155 | 0.4158 | 0.1523 |
| Qwen3.5 | 0.4255 | 0.1477 | 0.4555 | 0.2094 |
| Gemma4 | 0.4392 | 0.2245 | 0.5012 | 0.2654 |
| GPT-OSS-GRID | 0.5125 | 0.2884 | 0.5449 | 0.3299 |
| Los Angeles | London | |||
| Method | BERT | ROUGE | BERT | ROUGE |
| k-NN | 0.5213 | 0.2931 | 0.5306 | 0.2980 |
| GPT-OSS-GRID | 0.4921 | 0.2595 | 0.5084 | 0.2871 |
| GPT-OSS-HASH | 0.5320 | 0.3109 | 0.5348 | 0.3162 |
| GPT-OSS-TEXT | 0.5329 | 0.3078 | 0.5524 | 0.3369 |
| GPT-OSS-HYBRID | 0.5503 | 0.3289 | 0.5597 | 0.3447 |
| Los Angeles | London | |||
| Method | Hit Rate@1% | Hit Rate@5% | Hit Rate@1% | Hit Rate@5% |
| GeoGrounding | 34.90% 0.52% | 54.81% 0.57% | 55.07% 0.33% | 69.26% 0.70% |
| w/ k-NN | 35.05% 0.46% | 54.57% 0.41% | 55.52% 0.25% | 69.52% 0.32% |
| w/ GPT-OSS-GRID | 30.70% 0.26% | 51.39% 0.78% | 53.24% 0.56% | 67.41% 0.92% |
| w/ GPT-OSS-HASH | 34.79% 0.45% | 54.46% 0.43% | 55.10% 0.66% | 69.04% 0.99% |
| w/ GPT-OSS-TEXT | 34.84% 0.26% | 54.60% 0.31% | 55.34% 0.63% | 69.16% 0.66% |
| Los Angeles | London | |||||
| Method | Coverage@1% | JSD | Wasserstein | Coverage@1% | JSD | Wasserstein |
| GeoGrounding | 60.22% 0.86% | 0.4747 0.0019 | 7459.29 116.46 | 74.96% 0.31% | 0.4632 0.0079 | 6202.41 341.13 |
| w/ k-NN | 60.06% 0.74% | 0.4734 0.0029 | 7394.78 71.03 | 75.09% 0.39% | 0.4693 0.0046 | 6120.26 239.72 |
| w/ GPT-OSS-GRID | 58.57% 0.47% | 0.4889 0.0047 | 7743.80 57.20 | 72.59% 0.33% | 0.4895 0.0067 | 6629.12 300.62 |
| w/ GPT-OSS-HASH | 59.72% 0.72% | 0.4716 0.0027 | 7386.82 62.27 | 74.82% 0.67% | 0.4645 0.0098 | 6075.04 334.89 |
| w/ GPT-OSS-TEXT | 60.07% 0.51% | 0.4690 0.0048 | 7327.45 115.96 | 74.81% 0.66% | 0.4690 0.0064 | 6031.12 249.98 |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Configuration | Value |
| Base model | Frozen |
| Token embeddings | Frozen |
| Batch size | |
| Gradient accumulation | |
| LoRA learning rate | |
| Geo-module learning rate |
| ID | Measured Distance | NAIVE | TEXT | GRID | LATENT | HYBRID |
|---|---|---|---|---|---|---|
| Comparison | Hit Rate@1% | Hit Rate@5% | Coverage@1% | JSD | Wasserstein |
|---|---|---|---|---|---|
| Augmentation vs. no augmentation | |||||
| w/ GRID | ( 0.001) † | ( 0.001) † | ( 0.001) † | ( 0.001) † | (0.009) † |
| w/ HASH | (0.487) | (0.774) | (0.668) | (0.572) | (0.173) |
| w/ TEXT | (0.243) | (0.686) | (0.702) | (0.588) | (0.141) |
| w/ HYBRID | (0.180) | (0.608) | (0.055) | (0.062) | (0.442) |
| w/ LATENT | (0.002) | (0.235) | (0.574) | (0.005) | (0.103) |
Spatial Generalization
Spatial Generalization studies whether models and spatial representations remain reliable across unseen locations, geographic scales, and changing environments.
See all 43 papers