{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/flashst-a-simple-and-universal-prompt-tuning","title":"FlashST: A Simple and Universal Prompt-Tuning Framework for Traffic Prediction","arxiv_id":"2405.17898","date":"2024-05-28","proceeding":null,"authors":["Zhonghang Li","Lianghao Xia","Yong Xu","Chao Huang"],"abstract":"The objective of traffic prediction is to accurately forecast and analyze the dynamics of transportation patterns, considering both space and time. However, the presence of distribution shift poses a significant challenge in this field, as existing models struggle to generalize well when faced with test data that significantly differs from the training distribution. To tackle this issue, this paper introduces a simple and universal spatio-temporal prompt-tuning framework-FlashST, which adapts pre-trained models to the specific characteristics of diverse downstream datasets, improving generalization in diverse traffic prediction scenarios. Specifically, the FlashST framework employs a lightweight spatio-temporal prompt network for in-context learning, capturing spatio-temporal invariant knowledge and facilitating effective adaptation to diverse scenarios. Additionally, we incorporate a distribution mapping mechanism to align the data distributions of pre-training and downstream data, facilitating effective knowledge transfer in spatio-temporal forecasting. Empirical evaluations demonstrate the effectiveness of our FlashST across different spatio-temporal prediction tasks using diverse urban datasets. Code is available at https://github.com/HKUDS/FlashST.","url_abs":"https://arxiv.org/abs/2405.17898v1","url_pdf":"https://arxiv.org/pdf/2405.17898v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"flashst-a-simple-and-universal-prompt-tuning","repo_url":"https://github.com/hkuds/flashst","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"prediction","task_name":"Prediction"},{"task_slug":"spatio-temporal-forecasting","task_name":"Spatio-Temporal Forecasting"},{"task_slug":"traffic-prediction","task_name":"Traffic Prediction"},{"task_slug":"transfer-learning","task_name":"Transfer Learning"}],"methods":[{"method_slug":"align","method_name":"ALIGN"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.17898","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.17898"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/HKUDS/FlashST","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hkuds/flashst","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":9,"ran_draft_wrong":1,"unverified":5},"by_repo_kind":{"official":{"samples":15,"ran":10,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"c40b9c932efa74c7","entry":"MAE_torch","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/metrics.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/metrics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c40b9c932efa74c7"}},{"code_sha256_prefix":"bb1134c39c66c490","entry":"MSE_torch","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/metrics.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/metrics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bb1134c39c66c490"}},{"code_sha256_prefix":"a49a2f0364137c7f","entry":"calculate_scaled_laplacian","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/predifineGraph.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/predifineGraph.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a49a2f0364137c7f"}},{"code_sha256_prefix":"996764623af1eab9","entry":"get_logger","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/logger.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/logger.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"996764623af1eab9"}},{"code_sha256_prefix":"0e86124fe7fa990b","entry":"huber_loss","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/metrics.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/metrics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0e86124fe7fa990b"}},{"code_sha256_prefix":"e246ed362e86604f","entry":"init_lr_scheduler","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/TrainInits.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/TrainInits.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e246ed362e86604f"}},{"code_sha256_prefix":"ffe6b5e6a255061f","entry":"init_optim","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/TrainInits.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/TrainInits.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ffe6b5e6a255061f"}},{"code_sha256_prefix":"cd17080a788963f3","entry":"load_pickle","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/predifineGraph.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/predifineGraph.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cd17080a788963f3"}},{"code_sha256_prefix":"f06b9dde37d1edca","entry":"split_data_by_ratio","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/data_process.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/data_process.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f06b9dde37d1edca"}},{"code_sha256_prefix":"393d9fa92fbb7360","entry":"time_add","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/data_process.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/data_process.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"393d9fa92fbb7360"}},{"code_sha256_prefix":"9ddd482ace302247","entry":"FlashST","repo":"hkuds/flashst","repo_kind":"official","path":"model/FlashST.py","file_url":"https://github.com/hkuds/flashst/blob/HEAD/model/FlashST.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9ddd482ace302247"}},{"code_sha256_prefix":"bcbb414ef2d71a4e","entry":"get_adjacency_matrix","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/predifineGraph.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/predifineGraph.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bcbb414ef2d71a4e"}},{"code_sha256_prefix":"d7187fc207b2d503","entry":"init_device","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/TrainInits.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/TrainInits.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d7187fc207b2d503"}},{"code_sha256_prefix":"276cf31cff24137f","entry":"load_st_dataset","repo":"HKUDS/FlashST","repo_kind":"official","path":"lib/data_process.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/lib/data_process.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"276cf31cff24137f"}},{"code_sha256_prefix":"bfcf8880c515ac93","entry":"parse_args","repo":"HKUDS/FlashST","repo_kind":"official","path":"conf/FlashST/Params_pretrain.py","file_url":"https://github.com/HKUDS/FlashST/blob/HEAD/conf/FlashST/Params_pretrain.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bfcf8880c515ac93"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}