ST-LINK: Spatially-Aware Large Language Models for Spatio-Temporal Forecasting

December 22, 2025 ยท View on GitHub

This is an official Pytorch implementation of ST-LINK in the following paper: ST-LINK: Spatially-Aware Large Language Models for Spatio-Temporal Forecasting, CIKM 2025

Requirements

  • python>=3.8
  • torch>=1.7.1
  • numpy>=1.12.1
  • pandas>=0.19.2
  • scipy>=0.19.0

Data

The NYCTaxi and CHBike datasets can be found in the Liu et al., 2024, Ye et al., 2021. The other datasets (including METR-LA, PEMS-BAY, PEMS-03,04,07,08, etc.), can be found in Google Drive provided by Li et al. (DCRNN).

Process Datasets

In the data processing stage, We have the same process as DCRNN & TESTAM. A data folder must be created, and the METR-LA and PEMS-BAY datasets should be preprocessed accordingly. NYCTaxi and CHBike datasets can also be added.

# Create data directories
mkdir -p data/{METR-LA,PEMS-BAY}

# METR-LA
python generate_training_data.py --output_dir=data/METR-LA --traffic_df_fiilename=data/metr-la.h5 --seq_length_x INPUT_SEQ_LENGTH --seq_length_y PRED_SEQ_LENGTH

# PEMS-BAY
python generate_training_data.py --output_dir=data/PEMS-BAY --traffic_df_fiilename=data/pems-bay.h5 --seq_length_x INPUT_SEQ_LENGTH --seq_length_y PRED_SEQ_LENGTH

Training

python train.py --data DATASET > your_log_name.log &

Test

python test.py --data DATASET --load_path "logs/YYYY-MM-DD-HH:MM:SS-DATASET/best_model.pth"

Acknowledgement

Our implementation is based on STLLM and TESTAM, with extensive modifications tailored to our objectives. We sincerely thank the original authors for publicly sharing their codebases and resources.

Citation

@inproceedings{jeon2025stlink,
 title = {{ST-LINK}: Spatially-Aware Large Language Models for Spatio-Temporal Forecasting},
 author = {Hyotaek Jeon, Hyunwook Lee, Juwon Kim and Sungahn Ko},
 booktitle = {Proceedings of the 34th ACM International Conference on Information and Knowledge Management},
 year = {2025},
 address = {Seoul, Republic of Korea},
 URL = [https://doi.org/10.1145/3746252.3761085)
}