从城市数据到可解释的移动性预测From urban data to explainable mobility prediction
Use this as an interview map, not as a textbook. The target is to explain the problem, the modeling choice, the evidence, and the limitation in clear English.
页面默认中英对照;点击 EN only 隐藏中文提示,练习全英复述。Default view is bilingual. Click EN only to rehearse in English.
先记住这条主线Remember this narrative
如果教授只给你一分钟,先说这段。它把五篇文章放在同一张图里。If the professor gives you one minute, use this narrative to connect all five papers.
共同主题是结构化城市数据的表示学习;区别主要在空间如何表示、监督信号如何获得。
Urban Computing: the problem setting
This paper is the conceptual foundation. It is less about one model and more about the end-to-end urban data loop.
Definition and recurrent loop
Urban computing uses data generated in cities to understand and improve city life, city operations, and the environment. It connects sensing, data management, analytics, and service provision in a recurrent loop.
Urban computing 利用城市产生的数据来理解并改善生活、城市运行和环境;它把感知、数据管理、分析和服务连接成循环。
Seven application categories
Urban planning; transportation; environment; energy; social; economy; public safety and security.
城市规划、交通、环境、能源、社会、经济、公共安全。
Four methodology families
Urban sensing; urban data management; knowledge fusion across heterogeneous data; urban data visualization.
城市感知、数据管理、异构知识融合、数据可视化。
城市数据通常不满足简单的独立同分布假设:它有空间依赖、时间依赖、缺失、噪声、隐私和异构语义。
What to say if asked for an example: “A traffic sensor is not an isolated time series. Its value is influenced by nearby roads, upstream flow, weather, incidents, time of day, and policy.”
Spatio-Temporal Graph Neural Networks
STGNN combines a graph learner for space with a temporal learner for sequence dynamics. It is a strong baseline language for urban forecasting interviews.
Problem representation
At time t, a graph can be written as G_t = (V, E_t, A_t), where V are locations or entities, E_t are edges, and A_t is the adjacency matrix. Node features are X_t in R^(N x F).
在时刻 t,图可写为 G_t=(V,E_t,A_t):V 是位置或实体,E_t 是边,A_t 是邻接矩阵;节点特征 X_t 的形状通常为 N x F。
The graph may be static or dynamic, directed or undirected, weighted or unweighted. The choice should follow the data and the task.
图可以静态或动态、有向或无向、加权或不加权,选择取决于数据和任务。
How to construct the graph
Topology-based
Use known connectivity, such as road links. Usually sparse and often static.
利用道路连接等已知拓扑,通常稀疏且相对静态。
Distance-based
Connect nearby locations with a kernel such as a Gaussian RBF; a threshold controls sparsity.
用距离核函数(如高斯 RBF)连接邻近位置,阈值控制稀疏度。
Similarity-based
Connect locations with similar time series or POI profiles; Pearson correlation and DTW are common.
连接时间序列或 POI 属性相似的位置;常见方法有 Pearson 相关和 DTW。
Interaction-based
Use flows between locations, for example the proportion of trips from i to j.
利用位置之间的流量,例如 i 到 j 的出行比例。
预定义图可能漏掉隐含或变化的关系;模型可以学习节点向量生成邻接矩阵,也可以从当前特征或隐藏状态动态生成。
Three modules in a typical STGNN
Basic building blocks
| Component | Intuition | Interview wording |
|---|---|---|
| GCN / message passing | Aggregate a node's neighbors using A and learnable weights. | “A graph convolution propagates information along the relational structure.” |
| GAT | Learn different attention weights for different neighbors. | “Attention lets the model distinguish important neighbors from less relevant ones.” |
| GRU / LSTM | Recursive memory with gates; handles sequential dependence. | “GRU balances the new observation with the previous hidden state.” |
| TCN | Causal 1-D convolution; dilation expands the receptive field. | “A dilated causal TCN captures multi-scale history without looking into the future.” |
| Self-attention | Queries attend to keys and aggregate values; positional encoding preserves order. | “Self-attention can connect distant time steps, but it needs positional information.” |
Fusion and improved variants
Factorized vs coupled
Factorized models stack spatial and temporal blocks (e.g., STGCN). Coupled models embed graph convolution inside a recurrent unit (e.g., DCRNN).
Factorized 把空间和时间模块串联或并联;coupled 把图卷积嵌进循环单元。
Joint spatio-temporal graph
Connect spatial neighbors and the same location across adjacent times in one graph (e.g., STSGCN).
在统一图中同时连接空间邻居和相邻时间的同一位置。
Multi-scale / granularity
Learn short-term closeness, daily or weekly periodicity, and long-term trend separately, then fuse them.
分别学习短期 closeness、日/周周期和长期 trend,再融合。
Heterogeneous learning
Treat different edge or node types differently, such as distance edges versus mobility-flow edges.
区分不同节点或边类型,如距离边和流动边。
Advanced techniques to recognize
adversarial learningmeta learningself-supervised learningNeural ODE/CDEphysics-informed learningtransfer learningNAS
You do not need to derive each one. Know the purpose: improve realism, adapt to heterogeneity, learn from unlabeled data, model continuous dynamics, enforce domain rules, transfer across cities, or automate architecture design.
不必推导每个方法;记住它们各自解决什么问题:真实性、异质性、无标签学习、连续动态、物理约束、跨城市迁移和自动架构设计。
STGNN limitations and future directions
Which space-time features drive the prediction?哪些时空特征真正驱动了预测?
Can a manager trust the confidence score?置信度是否可靠?
Do outputs obey domain laws?输出是否符合物理或领域规律?
Can representations transfer to new tasks?表示能否迁移到新任务?
Will a model trained in one period or city generalize?换时间段或城市后还能泛化吗?
Can it handle tens of thousands of locations efficiently?大规模节点下是否高效?
Self-Supervised Learning for Time Series
The interview-level idea: create supervision from the data itself, learn a reusable representation, then fine-tune with fewer labels.
Why SSL for time series?
Labels for forecasting, anomaly detection, or classification can be expensive. SSL pre-trains on abundant unlabeled sequences and transfers the encoder to downstream tasks.
预测、异常检测、分类的标签可能昂贵;SSL 先用大量无标签序列预训练,再把编码器迁移到下游任务。
A pretext task is not necessarily the final task. It is a proxy objective that forces the representation to preserve useful temporal structure.
pretext task 不一定是最终任务,而是迫使表示保留有用时间结构的代理目标。
Taxonomy
Generative-based
Autoregressive forecasting: predict future window from history.
Autoencoder reconstruction: encode and reconstruct the input; denoising and masking are common.
Diffusion generation: add noise and learn a reverse denoising process.
生成式:用历史预测未来、重构输入、或通过扩散反向去噪生成。
Contrastive-based
Construct positive and negative views, pull positives together, push negatives apart. Five categories in the survey: sampling, prediction, augmentation, prototype, and expert-knowledge contrast.
对比式:构造正负样本,正样本靠近、负样本远离;五类是 sampling、prediction、augmentation、prototype、expert knowledge。
Adversarial-based
A generator creates synthetic or perturbed sequences; a discriminator distinguishes real from generated, or adversarial loss enhances representations.
对抗式:生成器产生样本,判别器区分真假,或用对抗损失增强表示。
Contrastive learning pipeline
最重要的风险是正负样本构造:错误负样本或时间泄漏会让模型学到错误的不变性。
Time-series-specific augmentations
Noise injection, window slicing, window warping, masking, time-step masking, segment masking, and variable-wise masking.
常见增强包括加噪、窗口切片、窗口变形、mask;mask 又可按时间点、片段或变量进行。
How to discuss evaluation
| Task | Question | Typical metrics |
|---|---|---|
| Forecasting | How close is the future window? | MAE, RMSE, MAPE |
| Classification | Can the representation separate classes? | Accuracy, F1, AUROC |
| Anomaly detection | Can it identify unusual points or sequences? | Precision, recall, F1, delay-aware metrics |
| Clustering | Does the embedding reveal meaningful groups? | Adjusted Rand Index, NMI, silhouette |
时空数据的增强必须保留时间和空间语义;任意打乱可能破坏因果,短片段 mask 更符合真实缺失。
Urban Computing in the Era of LLMs
Treat this as a bridge from classic urban models to foundation models and agents.
Why LLMs are attractive
Traditional urban models can be accurate but task-specific, difficult to generalize, and often opaque. LLMs can process text and multimodal context, retrieve external knowledge, explain decisions, and decompose tasks.
传统模型可能准确但任务专用、泛化有限且不透明;LLM 能处理文本和多模态上下文、检索外部知识、解释决策并分解任务。
Five functional roles
Encoder
Turn urban data into representations, often through tokenization and fine-tuning.
把城市数据编码成向量表示。
Predictor
Map context to forecasts or decisions.
直接输出预测或决策。
Enhancer
Improve an existing model with semantic reasoning, missing-data handling, or recommendations.
增强现有模型的语义理解、补全或建议能力。
Assistant
Answer questions, summarize reports, and support experts.
回答问题、总结报告、辅助专家。
Agent
Plan, retrieve, call APIs/tools, evaluate results, and iterate.
规划、检索、调用工具、评估结果并迭代。
Core implementation concepts
Tokenization / alignment
Numeric or spatial data must be converted into tokens or embeddings that an LLM can consume. Alignment determines whether the LLM receives meaningful signal or just a text wrapper.
数值或空间数据要转成 LLM 能处理的 token/embedding;关键是对齐是否真的保留了信号,而不是简单套一层文本。
RAG / GraphRAG
Retrieve relevant external facts before generation. GraphRAG uses entity relations for multi-hop context and can reduce hallucination.
生成前检索外部事实;GraphRAG 利用实体关系做多跳检索,降低幻觉。
LoRA / PEFT
Fine-tune a small set of parameters or low-rank adapters instead of the entire LLM.
只训练少量参数或低秩 adapter,降低微调成本。
Efficiency and trust
Pruning, quantization, distillation, caching, selective computation, uncertainty, and human-in-the-loop review matter for deployment.
部署时要考虑剪枝、量化、蒸馏、缓存、选择性计算、不确定性和人工复核。
LLMs and human mobility
A trajectory can be represented as a sequence of (location, timestamp) pairs. Next-location prediction is a conditional generation problem: given history H, context C, and knowledge K, predict the next spatial unit.
轨迹可表示为 (location, timestamp) 序列;下一位置预测可以看作条件生成:给定历史 H、上下文 C 和知识 K,预测下一空间单元。
LLM 不会自动拥有准确坐标知识;必须用语义描述、检索、空间编码和工具输出把它落到地理空间。
Future issues likely to be asked
generalizationinterpretabilitycomputational costprivacy / securityhallucinationreal-time planningmultimodal fusion
CityFM: foundation representations from OSM
This is the cleanest example of self-supervised, multimodal geospatial representation learning.
Why OSM is difficult
Geospatial data is heterogeneous: nodes are points, ways are polylines or polygons, and relations connect entities. Each object may also have sparse key-value tags, a location, a shape, and nearby context.
地理数据很异构:node 是点,way 是线或面,relation 连接实体;对象还可能有稀疏的 key-value 标签、位置、形状和邻域上下文。
Node
Point with coordinates; often a POI.
带坐标的点,常表示 POI。
Way
Ordered nodes forming a road polyline or a building polygon.
有序节点组成道路线或建筑面。
Relation
Members that represent a complex object, such as a bus route.
成员集合表示复杂对象,如公交线路。
CityFM pretraining objectives
The intuition is mutual-information maximization: different views of the same entity should agree in representation space.
核心直觉是最大化互信息:同一实体的不同视图在表示空间中应该一致。
Location encoding
CityFM uses a fixed sinusoidal encoding of latitude and longitude with multiple frequencies. The frequencies represent position at different granularities, and the parameters do not need to be learned.
CityFM 用多频率正弦编码经纬度;多频率对应不同空间粒度,位置编码参数不必训练。
Frozen embeddings and downstream tasks
After pretraining, the encoder is frozen and its embeddings are used for road traffic-speed inference, building-functionality classification, and population-density estimation. The reported results are superior to or on par with task-specific baselines.
预训练后冻结编码器,用 embedding 做道路速度推断、建筑功能分类和人口密度估计;结果优于或不弱于任务专用基线。
Foundation model 不只意味着模型很大;关键是从广泛、主要无标签的数据学习可复用表示,并迁移到多个下游任务。
Limitations to mention
- OSM annotations are sparse, inconsistent, and contributor-dependent.OSM 标签稀疏、不一致,并受贡献者习惯影响。
- CityFM is trained within a selected area, so cross-city transfer needs validation.CityFM 在选定区域内训练,跨城市迁移需要额外验证。
- It represents geospatial entities well, but it is not a temporal mobility model by itself.它擅长地理实体表示,但本身不是时间移动性模型。
把五篇文章连成你的回答Connect the five papers
| Question | Answer map | English line |
|---|---|---|
| How to represent space? | Graph: discrete relations; field: continuous coordinates; CityFM: multimodal entity embeddings. | “The representation should match the geometry and the available supervision.” |
| How to learn with little labels? | Time-series SSL and CityFM create proxy objectives from unlabeled data. | “Self-supervision turns structure in the data into a training signal.” |
| How to handle time? | RNN/TCN/attention model temporal dependence; multi-granularity separates closeness, periodicity, and trend. | “Temporal inductive bias is useful, but it must not leak future information.” |
| How to improve transfer? | Pretraining, adaptive graphs, meta-learning, foundation representations, and careful domain adaptation. | “Transfer is difficult because both spatial topology and temporal distributions can change.” |
| How to improve trust? | Calibration, uncertainty, physical constraints, RAG, audit traces, and human review. | “Accuracy is necessary, but deployment also needs calibrated confidence and an audit trail.” |
| How does AgentMob fit? | It uses compact behavioral/geographical evidence and an LLM controller to allocate reasoning by difficulty. | “The LLM is a controller for evidence gathering, not merely a black-box predictor.” |
A safe 45-second synthesis
“The papers address different layers of the same urban intelligence problem. Urban computing defines the sensing-to-service loop. STGNNs model discrete spatial relations and temporal dynamics, while the field-based view in my air-quality work models continuous coordinates. Self-supervised learning and CityFM reduce dependence on labels by learning reusable representations from time-series or OpenStreetMap structure. More recent LLM work adds semantic reasoning and tool use, but it also introduces concerns about grounding, cost, privacy, and calibration. I see my mobility-agent project as an evidence-grounded decision layer on top of these representation-learning ideas.”
这段适合面试中总结五篇文章并自然引到你的项目。