{"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/urbangpt-spatio-temporal-large-language","title":"UrbanGPT: Spatio-Temporal Large Language Models","arxiv_id":"2403.00813","date":"2024-02-25","proceeding":null,"authors":["Zhonghang Li","Lianghao Xia","Jiabin Tang","Yong Xu","Lei Shi","Long Xia","Dawei Yin","Chao Huang"],"abstract":"Spatio-temporal prediction aims to forecast and gain insights into the ever-changing dynamics of urban environments across both time and space. Its purpose is to anticipate future patterns, trends, and events in diverse facets of urban life, including transportation, population movement, and crime rates. Although numerous efforts have been dedicated to developing neural network techniques for accurate predictions on spatio-temporal data, it is important to note that many of these methods heavily depend on having sufficient labeled data to generate precise spatio-temporal representations. Unfortunately, the issue of data scarcity is pervasive in practical urban sensing scenarios. Consequently, it becomes necessary to build a spatio-temporal model with strong generalization capabilities across diverse spatio-temporal learning scenarios. Taking inspiration from the remarkable achievements of large language models (LLMs), our objective is to create a spatio-temporal LLM that can exhibit exceptional generalization capabilities across a wide range of downstream urban tasks. To achieve this objective, we present the UrbanGPT, which seamlessly integrates a spatio-temporal dependency encoder with the instruction-tuning paradigm. This integration enables LLMs to comprehend the complex inter-dependencies across time and space, facilitating more comprehensive and accurate predictions under data scarcity. To validate the effectiveness of our approach, we conduct extensive experiments on various public datasets, covering different spatio-temporal prediction tasks. The results consistently demonstrate that our UrbanGPT, with its carefully designed architecture, consistently outperforms state-of-the-art baselines. These findings highlight the potential of building large language models for spatio-temporal learning, particularly in zero-shot scenarios where labeled data is scarce.","url_abs":"https://arxiv.org/abs/2403.00813v3","url_pdf":"https://arxiv.org/pdf/2403.00813v3.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":"urbangpt-spatio-temporal-large-language","repo_url":"https://github.com/hkuds/urbangpt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"10-shot-image-generation","task_name":"10-shot image generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.00813","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.00813"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hkuds/urbangpt","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":6,"ran_violates":1,"unverified":5},"by_repo_kind":{"official":{"samples":12,"ran":7,"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":"2100188132670662","entry":"MAE_torch","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/ST_Llama.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/ST_Llama.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":"2100188132670662"}},{"code_sha256_prefix":"bdd3c4ef3723890a","entry":"apply_rotary_pos_emb","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/monkey_patch_non_inplace.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/monkey_patch_non_inplace.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":"bdd3c4ef3723890a"}},{"code_sha256_prefix":"a730a935c1f257ae","entry":"load_compress_model","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/compression.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/compression.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":"a730a935c1f257ae"}},{"code_sha256_prefix":"1c58db3bf7592ab2","entry":"load_model_pretrained","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/ST_Llama.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/ST_Llama.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":"1c58db3bf7592ab2"}},{"code_sha256_prefix":"0bf414a2b44babe6","entry":"raise_warning_for_incompatible_cpu_offloading_configuration","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/model_adapter.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/model_adapter.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0bf414a2b44babe6"}},{"code_sha256_prefix":"62a553b3b2dcaca7","entry":"rotate_half","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/monkey_patch_non_inplace.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/monkey_patch_non_inplace.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":"62a553b3b2dcaca7"}},{"code_sha256_prefix":"6aced6f709ffe24b","entry":"scaler_mae_loss","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/ST_Llama.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/ST_Llama.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":"6aced6f709ffe24b"}},{"code_sha256_prefix":"80dde39da1ba3708","entry":"compress","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/compression.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/compression.py","link_basis":"harvester_set","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":"80dde39da1ba3708"}},{"code_sha256_prefix":"2cbe6ed055d5fd44","entry":"forward","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/monkey_patch_non_inplace.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/monkey_patch_non_inplace.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":"2cbe6ed055d5fd44"}},{"code_sha256_prefix":"c5824da57107fe8c","entry":"get_compressed_list","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/compression.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/compression.py","link_basis":"harvester_set","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":"c5824da57107fe8c"}},{"code_sha256_prefix":"52162c648b35e17b","entry":"get_model_info","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/model_registry.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/model_registry.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":"52162c648b35e17b"}},{"code_sha256_prefix":"bad3bd3ae89b22d3","entry":"load_pretrained_model","repo":"hkuds/urbangpt","repo_kind":"official","path":"urbangpt/model/builder.py","file_url":"https://github.com/hkuds/urbangpt/blob/HEAD/urbangpt/model/builder.py","link_basis":"plan_row","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":"bad3bd3ae89b22d3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}