FlowDistill: Scalable Traffic Flow Prediction via Distillation from LLMs

Chenyang Yu, Xinpeng Xie, Yan Huang, Chenxi QiuarXiv 2025 · DOI

Abstract

Accurate traffic flow prediction is essential for smart city infrastructure but is currently hindered by the high data requirements and computational complexity of Graph Neural Networks (GNNs). We present FlowDistill, a novel framework that distills the complex spatio-temporal reasoning of Large Language Models (LLMs) into a lightweight Multi-Layer Perceptron (MLP). FlowDistill achieves state-of-the-art accuracy while requiring 75% less training data and significantly lower computational overhead than traditional models, making it ideal for real-time edge deployment.

Introduction

Traffic flow prediction influences urban planning and ride-sharing efficiency. While GNNs are the current standard, they suffer from "data hunger" and high computational costs. Conversely, LLMs possess remarkable "zero-shot" reasoning capabilities but are too large for millisecond-level forecasting. FlowDistill bridges this gap by transferring the "wisdom" of an LLM teacher into a compact student model capable of running on resource-constrained devices.

Methodology

FlowDistill utilizes a Teacher-Student distillation framework composed of four primary modules:

  1. Instruction Tuning Module: Converts numerical traffic data and regional metadata (e.g., Points of Interest) into tokens for a fine-tuned LLM (UrbanGPT).
  2. Teacher Guidance Module: The LLM acts as a teacher, providing high-level spatio-temporal insights.
  3. VIB-MLP Module: The student is a compact MLP enhanced with a Variational Information Bottleneck (VIB) to ensure it retains only the most essential predictive information.
  4. Loss Function: A specialized suite of losses, including Teacher-Bounded Loss ($L_{tbl}$), which ensures the student only learns from the teacher when the teacher's output is demonstrably superior, and spatio-temporal regularization to compensate for the lack of an explicit graph structure.
The FlowDistill architecture, illustrating the flow from LLM instruction tuning to the VIB-MLP student model and the integrated loss functions.

Experimental Evaluation

The model was evaluated on real-world datasets from New York City (NYC-Taxi) and Chicago (Chicago-Taxi), sampled at 30-minute intervals.

Key Results

  • Data Efficiency: FlowDistill achieved a Mean Absolute Error (MAE) of 7.22 on the NYC dataset using only 10% of the training data. In contrast, the leading graph-based baseline, STWA, required 40% of the data to reach the same performance level.
  • Computational Leanliness: The student model is remarkably small (0.39GB) compared to high-performing baselines like ST-MLP (34.1GB). It also reduced inference latency by approximately 40%.
  • Scalability: FlowDistill maintains a stable memory footprint and low latency even as testing data scales, outperforming traditional GNN-based architectures.
Comparison of training data requirements, model size (GB), and MAE performance across various traffic prediction models.

Discussion and Insights

FlowDistill demonstrates that LLMs can serve as "data amplifiers," identifying high-level urban patterns that allow student models to excel in data-scarce scenarios. A critical innovation is Selective Supervision via Teacher-Bounded Loss; by recognizing that even LLMs can produce noisy outputs, the framework prevents the student from over-fitting to the teacher's errors.

Limitations and Future Work

While effective, the student's performance is currently capped by the quality of the LLM teacher. Future research will explore non-grid-based spatial partitions and cross-city generalization to adapt distilled knowledge between different urban layouts without requiring a new teacher for every city.

Summary updated

BibTeX
@misc{yu2025flowdistill,
  author = {Chenyang Yu and Xinpeng Xie and Yan Huang and Chenxi Qiu},
  title = {{FlowDistill: Scalable Traffic Flow Prediction via Distillation from LLMs}},
  year = {2025},
  eprint = {2504.02094},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.02094},
}
Figure