[MDM 2024]Spatial-Temporal Large Language Model for Traffic Prediction

論文網址:[2401.10134] Spatial-Temporal Large Language Model for Traffic Prediction

論文代碼:GitHub - ChenxiLiu-HNU/ST-LLM: Official implementation of the paper "Spatial-Temporal Large Language Model for Traffic Prediction"

英文是純手打的!論文原文的summarizing and paraphrasing。可能會出現難以避免的拼寫錯誤和語法錯誤,若有發現歡迎評論指正!文章偏向于筆記,謹慎食用

目錄

1. 心得

2. 論文逐段精讀

2.1. Abstract

2.2. Introduction

2.3. Related Work

2.3.1.?Large Language Models for Time Series Analysis

2.3.2.?Traffic Prediction

2.4. Problem Definition

2.5. Methodology

2.5.1.?Overview

2.5.2.?Spatial-Temporal Embedding and Fusion

2.5.3.?Partially Frozen Attention (PFA) LLM

2.6. Experiments

2.6.1. Datasdets

2.6.2. Baselines

2.6.3. Implementations

2.6.4. Evaluation Metrics

2.6.5. Main Results

2.6.6.?Performance of ST-LLM and Ablation Studies

2.6.7.?Parameter Analysis

2.6.8.?Inference Time Analysis

2.6.9. Few-Shot Prediction

2.6.10.?Zero-Shot Prediction

2.7. Conclusion

3. Reference


1. 心得

(1)盡管幾天后要投的論文還沒開始寫,仍然嚼嚼餅干寫寫閱讀筆記。哎。這年頭大家都跑得太快了

(2)比起數學,LLM適合配一杯奶茶讀,全程輕松愉悅,這一篇就是分開三個卷積→合在一起→LLM(部分解凍一些模塊)→over

2. 論文逐段精讀

2.1. Abstract

? ? ? ? ①They proposed Spatial-Temporal Large Language Model (ST-LLM) to predict traffic(好像沒什么特別的我就不寫了,就是在介紹方法,說以前的精度不高。具體方法看以下圖吧)

2.2. Introduction

? ? ? ? ①Traditional CNN and RNN cannot capture complex/long range spatial and temporal dependencies. GNNs are prone to overfitting, thus reseachers mainly use attention mechanism.

? ? ? ? ②Existing traffic prediction methods mainly focus on temporal feature rather than spatial

? ? ? ? ③For better long term prediction, they proposed?partially frozen attention (PFA)

2.3. Related Work

2.3.1.?Large Language Models for Time Series Analysis

? ? ? ? ①Listing TEMPO-GPT, TIME-LLM, OFA, TEST, and LLM-TIME, which all utilize temporal feature only. However, GATGPT, which introduced spatial feature, ignores temporal dependencies.

imputation??n.歸責;歸罪;歸咎;歸因

2.3.2.?Traffic Prediction

? ? ? ? ①Filter is a common and classic method for processing traffic data

? ? ? ? ②Irrgular city net makes CNN hard to apply or extract spatial feature

2.4. Problem Definition

? ? ? ? ①Input traffic data:?\mathbf{X}\in\mathbb{R}^{T\times N\times C}, where?T?denotes timesteps,?N?denotes numberof spatial stations,?C?denotes feature

? ? ? ? ②Task: given historical traffic data?\mathbf{X}_{P}=\{\mathbf{X}_{t-P+1},\mathbf{X}_{t-P+2},\ldots,\mathbf{X}_{t}\}\in\mathbb{R}^{P\times N\times C}?of?P?time steps only, learning a function?f\left ( \cdot \right )?with parameter?\theta?to predict future?S?timesteps:?\mathbf{Y}_{S}=\{\mathbf{Y}_{t+1},\mathbf{Y}_{t+2},\ldots,\mathbf{Y}_{t+S}\}\in\mathbb{R}^{S\times N\times C}:

[\mathbf{X}_{t-P+1},\mathbf{X}_{t-P+2},\ldots,\mathbf{X}_{t}]\xrightarrow{f(\cdot)}[\mathbf{Y}_{t+1},\mathbf{Y}_{t+2},\ldots,\mathbf{Y}_{t+S}]

2.5. Methodology

2.5.1.?Overview

? ? ? ? ①Overall framework of ST-LLM:

where Spatial-Temporal Embedding layer extracts?timesteps \mathbf{E}_{T}\in\mathbb{R}^{N\times D}, spatial embedding \mathbf{E}_{S}\in\mathbb{R}^{N\times D}, and temporal embedding?\mathbf{E}_{P}\in\mathbb{R}^{N\times D}?of historical?P?timesteps. Then, they three are combined to?\mathbf{E}_{F}\in\mathbb{R}^{N\times3D}. Freeze first?F?layers and preserve last?U?layers in PFA LLM and get output?\mathbf{H}^{L}\in\mathbb{R}^{N\times3D}. Lastly, regresion convolution convert it to?\widehat{\mathbf{Y}}_{S}\in\mathbb{R}^{S\times N\times C}.

2.5.2.?Spatial-Temporal Embedding and Fusion

? ? ? ? ①They get?tokens by?pointwise convolution:

\mathbf{E}_{P}=PConv(\mathbf{X}_{P};\theta_{p})

? ? ? ? ②Applying linear layer to encode input?\mathbf{X}_P\in\mathbb{R}^{P\times N\times C}?to day?\mathbf{X}_{day}\in\mathbb{R}^{N\times T_{d}}?and week?\mathbf{X}_{week}\in\mathbb{R}^{N\times T_{w}}:

E_T^d = W_{day}(X_{day}), \\ E_T^w = W_{week}(X_{week}), \\ E_T = E_T^d + E_T^w.

where?\mathbf{W}_{day}\in\mathbb{R}^{T_{d}\times D}?and?\mathbf{W}_{week}\in\mathbb{R}^{T_{w}\times D}?are learnable parameter and the output is?\mathbf{E}_{T}\in\mathbb{R}^{N\times D}

? ? ? ? ③They extract spatial correlations by:

\mathbf{E}_S=\sigma(\mathbf{W}_s\cdot\mathbf{X}_\mathbf{P}+\mathbf{b}_s)

? ? ? ? ④Fusion convolution:

\mathbf{H}_F=FConv(\mathbf{E}_P||\mathbf{E}_S||\mathbf{E}_T;\theta_f)

where?\mathbf{H}_{F}\in\mathbb{R}^{N\times3D}

2.5.3.?Partially Frozen Attention (PFA) LLM

? ? ? ? ①They freeze the first?F?layers (including multihead attention and feed-forward layers) which contains important information:

\mathbf{\bar{H}}^{i}=MHA\left(LN\left(\mathbf{H}^{i}\right)\right)+\mathbf{H}^{i},\\\mathbf{H}^{i+1}=FFN\left(LN\left(\mathbf{\bar{H}}^{i}\right)\right)+\mathbf{\bar{H}}^{i},

where?i \in \left \{ 1,F-1 \right \},?\mathbf{H}^{1}=[\mathbf{H}_{F}+\mathbf{P}\mathbf{E}],?\mathrm{PE}?denotes?learnable positional encoding,?\mathbf{\bar{H}}^{i}?represents the intermediate representation of the i-th layer after applying the frozen multi-head attention (MHA) and the first unfrozen layer normalization (LN),?\mathbf{H}^{i}?symbolizes the final representation after applying the unfrozen LN and frozen feed-forward network (FFN), and:

LN \left( \mathbf { H } ^ { i } \right) = \gamma \odot \frac { \mathbf { H } ^ { i } - \mu } { \sigma } + \beta ,\\ MHA ( \tilde { \mathbf { H } } ^ { i } ) = \mathbf { W } ^ { O } ( \mathrm { h e a d } _ { 1 } ^ { i } \| \cdots \| \mathrm { h e a d } _ { h } ^ { i } ) ,\\ \mathrm { h e a d } _ { k } ^ { i } = A t t e n t i o n ( \mathbf { W } _ { q } ^ { k } \tilde { \mathbf { H } } ^ { i } , \mathbf { W } _ { k } ^ { k } \tilde { \mathbf { H } } ^ { i } , \mathbf { W } _ { v } ^ { k } \tilde { \mathbf { H } } ^ { i } ) ,\\ A t t e n t i o n ( \tilde { \mathbf { H } } ^ { i } ) = \operatorname { s o f t m a x } \left( \frac { \tilde { \mathbf { H } } ^ { i } \tilde { \mathbf { H } } ^ { i T } } { \sqrt { d _ { k } } } \right) \tilde { \mathbf { H } } ^ { i } ,\\ F F N ( \tilde { \mathbf { H } } ^ { i } ) = \max \left( 0 , \mathbf { W } _ { 1 } \tilde { \mathbf { H } } ^ { i + 1 } + \mathbf { b } _ { 1 } \right) \mathbf { W } _ { 2 } + \mathbf { b } _ { 2 } ,\\

? ? ? ? ②Unfreezing the last?U?layers:

\mathbf{\bar{H}^{F+U-1}}=MHA\left(LN\left(\mathbf{H^{F+U-1}}\right)\right)+\mathbf{H^{F+U-1}},\\\mathbf{H^{F+U}}=FFN\left(LN\left(\mathbf{\bar{H}^{F+U-1}}\right)\right)+\mathbf{\bar{H}^{F+U-1}},

? ? ? ? ③The final regresion convolution (RConv):

\hat{\mathbf{Y}}_{S}=RCon\nu(\mathbf{H}^{F+U};\theta_{r})

? ? ? ? ④Loss function:

\mathcal{L}=\left\|\widehat{\mathbf{Y}}_{S}-\mathbf{Y}_{S}\right\|+\lambda\cdot L\mathrm{reg}

where?\mathbf{Y}_{S}?is ground truth

? ? ? ? ⑤Algorithm:

2.6. Experiments

2.6.1. Datasdets

? ? ? ? ①Statistics of datasets:

? ? ? ? ②NYCTaxi: includes 266?virtual stations and?4,368 timesteps (each timestep is half-hour)

? ? ? ? ③CHBike: includes 250 sites and?4,368 timesteps (30 mins as well)

2.6.2. Baselines

? ? ? ? ①GNN based baselines: DCRNN, STGCN, GWN, AGCRN, STGNCDE, DGCRN

? ? ? ? ②Attention based model: ASTGCN, GMAN, ASTGNN

? ? ? ? ③LLMs: OFA, GATGPT, GCNGPT, LLAMA2

2.6.3. Implementations

? ? ? ? ①Data split: 6:2:2

? ? ? ? ②Historical and future timesteps:?P=12,S=12

? ? ? ? ③T_w=7,T_d=48

? ? ? ? ④Learning rate: 0.001 and Ranger21 optimizer for LLM and 0.001 and Adam for GCN and attention based

? ? ? ? ⑤LLM:?GPT2 and LLAMA2 7B

? ? ? ? ⑥Layer: 6 for?GPT2 and 8 for LLAMA2

? ? ? ? ⑦Epoch: 100

? ? ? ? ⑧Batch size: 64

2.6.4. Evaluation Metrics

? ? ? ? ①Metrics:?Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), Root Mean Squared Error (RMSE), and Weighted Absolute Percentage Error (WAPE)

2.6.5. Main Results

? ? ? ? ①Performance table:

2.6.6.?Performance of ST-LLM and Ablation Studies

? ? ? ? ①Module ablation:

? ? ? ? ②Frozen ablation:

2.6.7.?Parameter Analysis

? ? ? ? ①Hyperparameter?U?ablation:

2.6.8.?Inference Time Analysis

? ? ? ? ①Inference time table:

2.6.9. Few-Shot Prediction

? ? ? ? ①10% samples few-shot learning:

2.6.10.?Zero-Shot Prediction

? ? ? ? ①Performance:

2.7. Conclusion

? ? ? ? ~

3. Reference

@inproceedings{liu2024spatial,
? title={Spatial-Temporal Large Language Model for Traffic Prediction},
? author={Liu, Chenxi and Yang, Sun and Xu, Qianxiong and Li, Zhishuai and Long, Cheng and Li, Ziyue and Zhao, Rui},
? booktitle={MDM},
? year={2024}
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/896147.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/896147.shtml
英文地址,請注明出處:http://en.pswp.cn/news/896147.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

k2路由器登錄校園網

教程1刷入Breed,并手動刷入Padavan固件:斐訊K1、K2、K2P 刷機、刷入Breed 輔助工具 | tb (tbvv.net) Padavan下載網址: 我用的是: Padavan 登錄的網址是 192.168.123.1 Padavan配置教程: 先用網線連上校園網&#…

多源 BFS 算法詳解:從原理到實現,高效解決多源最短路問題

多源 BFS 是一種解決 邊權為 1 的多源最短路問題 的高效算法。其核心思想是將所有源點視為一個“超級源點”,通過一次 BFS 遍歷即可計算所有節點到最近源點的最短距離。以下從原理、實現和代碼示例三個方面深入講解: 目錄 一、原理分析 1. 單源 BFS vs…

【藍橋杯集訓·每日一題2025】 AcWing 6123. 哞叫時間 python

6123. 哞叫時間 Week 1 2月18日 農夫約翰正在試圖向埃爾茜描述他最喜歡的 USACO 競賽,但她很難理解為什么他這么喜歡它。 他說「競賽中我最喜歡的部分是貝茜說 『現在是哞哞時間』并在整個競賽中一直哞哞叫」。 埃爾茜仍然不理解,所以農夫約翰將競賽以…

C++,設計模式,【工廠方法模式】

文章目錄 如何用汽車生產線理解工廠方法模式?一、傳統生產方式的困境二、工廠方法模式解決方案三、模式應用場景四、模式優勢分析五、現實應用啟示?C++,設計模式,【目錄篇】 如何用汽車生產線理解工廠方法模式? 某個早晨,某車企CEO看著會議室里堆積如面的新車訂單皺起眉…

貪心算法

int a[1000], b5, c8; swap(b, c); // 交換操作 memset(a, 0, sizeof(a)); // 初始化為0或-1 引導問題 為一個小老鼠準備了M磅的貓糧,準備去和看守倉庫的貓做交易,因為倉庫里有小老鼠喜歡吃的五香豆,第i個房間有J[i] 磅的五香豆&#xf…

機器學習·數據處理

前言 對于大規模數據,我們經常會使用python內置函數或者編寫腳本進行批量化處理,從而提高后續使用算法的效率。 1. 正則表達式 定義:用于檢索、替換符合某個模式的文本,是文本預處理常用技術。基本語法 符號描述.匹配除換行符 …

大廠出品!三個新的 DeepSeek 平替網站

前幾天給大家分享了幾個 DeepSeek 免費平替網站,今天又來更新啦。 新增了以下三個平臺:火山引擎、知乎直達、百度搜索。 經過實際測試,這幾個平臺的服務響應速度快,穩定性表現優異,基本不會出現宕機或服務器繁忙的情…

[創業之路-321]:創新開拓思維和經營管理思維的比較

目錄 一、概述 1.1、定義與內涵 1、創新開拓思維: 2、經營管理思維: 1.2、特點與優勢 1、創新開拓思維的特點與優勢: 2、經營管理思維的特點與優勢: 3、應用場景與限制 4、總結 二、創新開拓思維與經營管理思維&#xf…

《深度學習實戰》第1集:深度學習基礎回顧與框架選擇

本專欄系列博文旨在幫助讀者從深度學習的基礎知識逐步進階到前沿技術,涵蓋理論、實戰和行業應用。每集聚焦一個核心知識點,并結合實際項目進行實踐,避免空談理論,簡潔明快,快速切入代碼,所有代碼都經過驗證…

經典復古嘻哈說唱朋克風格專輯海報標題設計psai英文字體安裝包 Punk Of Sad — Ransom Font

Punk Of Sad 將確保您忘記所有簡潔的線條和企業潤色。這種經典的贖金風格字體是一封寫給 DIY 文化的情書,誕生于雜志、演出海報和地下場景的原始能量的剪切和粘貼混亂。每個字母都是不可預測的,都帶有叛逆的邊緣。 這種字體有三種不同的樣式 – Regular…

hot100-滑動窗口

3. 無重復字符的最長子串 給定一個字符串 s ,請你找出其中不含有重復字符的 最長子串的長度。 思路:雙指針指向不含重復字符的連續字串的頭和尾,用集合存儲子串中的元素,有重復時,左指針持續右移,無重復后…

MariaDB 歷史版本下載地址 —— 筑夢之路

MariaDB 官方yum源里面只有目前在維護的版本,而有時候對于老項目來說還是需要老版本的rpm包,國內很多鏡像站都是同步的官方倉庫,因此下載老版本也不好找,這里主要記錄下從哪里可以下載到歷史版本的MariaDB rpm包。 1. 官方歸檔網…

Linux-Ansible模塊進階

文章目錄 Copy和FetchFile模塊 Copy和Fetch copy和fetch模塊實踐 copy模塊需要注意的點:在收集日志之前需要對文件先進行改名或者備份fetch模塊需要注意的點:復制的源文件的路徑必須是文件不能是目錄建議全部使用絕對路徑,別使用相對路徑確保…

網絡空間安全(1)web應用程序的發展歷程

前言 Web應用程序的發展歷程是一部技術創新與社會變革交織的長卷,從簡單的文檔共享系統到如今復雜、交互式、數據驅動的平臺,經歷了多個重要階段。 一、起源與初期發展(1989-1995年) Web的誕生: 1989年,歐洲…

國產開源PDF解析工具MinerU

前言 PDF的數據解析是一件較困難的事情,幾乎所有商家都把PDF轉WORD功能做成付費產品。 PDF是基于PostScript子集渲染的,PostScript是一門圖靈完備的語言。而WORD需要的渲染,本質上是PDF能力的子集。大模型領域,我們的目標文件格…

Powershell Install deepseek

前言 deepseekAI助手。它具有聊天機器人功能,可以與用戶進行自然語言交互,回答問題、提供建議和幫助解決問題。DeepSeek 的特點包括: 強大的語言理解能力:能夠理解和生成自然語言,與用戶進行流暢的對話。多領域知識&…

6. 【.NET 8 實戰--孢子記賬--從單體到微服務--轉向微服務】--微服務基礎工具與技術--Ocelot 網關--概念與簡單入門

網關是一種位于客戶端和后端服務之間的服務,充當所有客戶端請求的單一入口。它的主要職責是接收所有的API調用,匯總各類請求,將其路由到適當的后端服務,并將響應返回給客戶端。網關不僅僅是一個簡單的反向代理,它還能夠…

網頁制作06-html,css,javascript初認識のhtml如何建立超鏈接

超鏈接有外部鏈接、電子郵件鏈接、錨點鏈接、空鏈接、腳本鏈接 一、內部鏈接 與自身網站頁面有關的鏈接被稱為內部鏈接 1、創建內部鏈接 1&#xff09;語法&#xff1a; <a href"鏈接地址"> …… </a> 2&#xff09;舉例應用&#xff1a; 3&#xf…

MySQL后端返回給前端的時間變了(時區問題)

問題&#xff1a;MySQL里的時間例如為2025-01-10 21:19:30&#xff0c;但是返回到前端就變成了2025-01-10 13:19:30&#xff0c;會出現小時不一樣或日期變成隔日的問題 一般來說設計字段時會使用datetime字段類型&#xff0c;這是一種用于時間的字段類型&#xff0c;而這個類型…

【算法與數據結構】單調隊列

目錄 單調隊列 使用單調隊列維護滑動窗口 具體過程&#xff1a; 代碼實現&#xff1a; 復雜度分析&#xff1a; 使用單調隊列優化動態規劃 例題 單調隊列 單調隊列(deque)是一種特殊的隊列&#xff0c;隊列中的元素始終按嚴格遞增或者遞減排列。這樣就可以保證隊頭元素…