WWW2026
ST-LEGO: Large Language Models as Modular Architects for Traffic Prediction
Shuhao Li, Weidong Yang, Yue Cui, Lipeng Ma, Yixuan Li, Chaoteng Wu, Lu Qin, Fan Zhang
摘要
Traffic prediction serves as a cornerstone for systems and network services such as the Web of Vehicles (WoV), online navigation, and smart city applications. Despite the proliferation of model architectures in recent years, existing approaches often suffer from highly customized structures and weak transferability, making it difficult to cope with increasing task heterogeneity and modeling complexity. To address these challenges, we propose ST-LEGO, a modular assembly framework driven by large language models (LLMs) that supports flexible structural composition and automated code generation. ST-LEGO employs a multi-agent collaborative system comprising a Prompt Agent, Assemble Agent, and Code Agent, which are responsible for understanding task requirements, dynamically assembling structural modules, and automatically generating executable PyTorch code. By introducing a standardized module library and an intermediate structural description language (DSL), the framework enables controllable generation, reusable composition, and cross-task generalization of model architectures. Empirical results on multiple real-world traffic datasets demonstrate that models generated by ST-LEGO achieve superior accuracy, structural diversity, and convergence compared to a wide range of manually designed baselines. These results highlight the unique potential and scalability of LLMs as structural architects for traffic prediction, offering a new paradigm for integrating language models into web-interactive intelligent transportation systems.