{"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/a-generative-pre-training-framework-for","title":"Spatio-Temporal Few-Shot Learning via Diffusive Neural Network Generation","arxiv_id":"2402.11922","date":"2024-02-19","proceeding":null,"authors":["Yuan Yuan","Chenyang Shao","Jingtao Ding","Depeng Jin","Yong Li"],"abstract":"Spatio-temporal modeling is foundational for smart city applications, yet it is often hindered by data scarcity in many cities and regions. To bridge this gap, we propose a novel generative pre-training framework, GPD, for spatio-temporal few-shot learning with urban knowledge transfer. Unlike conventional approaches that heavily rely on common feature extraction or intricate few-shot learning designs, our solution takes a novel approach by performing generative pre-training on a collection of neural network parameters optimized with data from source cities. We recast spatio-temporal few-shot learning as pre-training a generative diffusion model, which generates tailored neural networks guided by prompts, allowing for adaptability to diverse data distributions and city-specific characteristics. GPD employs a Transformer-based denoising diffusion model, which is model-agnostic to integrate with powerful spatio-temporal neural networks. By addressing challenges arising from data gaps and the complexity of generalizing knowledge across cities, our framework consistently outperforms state-of-the-art baselines on multiple real-world datasets for tasks such as traffic speed prediction and crowd flow prediction. The implementation of our approach is available: https://github.com/tsinghua-fib-lab/GPD.","url_abs":"https://arxiv.org/abs/2402.11922v3","url_pdf":"https://arxiv.org/pdf/2402.11922v3.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":"a-generative-pre-training-framework-for","repo_url":"https://github.com/tsinghua-fib-lab/gpd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"few-shot-learning","task_name":"Few-Shot Learning"},{"task_slug":"transfer-learning","task_name":"Transfer Learning"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.11922","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.11922"}},"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/tsinghua-fib-lab/gpd","reach":{"status":"ok"}}],"summary":{"ran":3,"ran_honours":1,"unverified":3},"by_repo_kind":{"official":{"samples":7,"ran":4,"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":7,"samples":[{"code_sha256_prefix":"d3fbd118981e42da","entry":"asym_adj","repo":"tsinghua-fib-lab/gpd","repo_kind":"official","path":"GPD/PredictionModel/NetSet.py","file_url":"https://github.com/tsinghua-fib-lab/gpd/blob/HEAD/GPD/PredictionModel/NetSet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d3fbd118981e42da"}},{"code_sha256_prefix":"f6b944f50d3f15ae","entry":"count_parameters","repo":"tsinghua-fib-lab/gpd","repo_kind":"official","path":"GPD/PredictionModel/utils.py","file_url":"https://github.com/tsinghua-fib-lab/gpd/blob/HEAD/GPD/PredictionModel/utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f6b944f50d3f15ae"}},{"code_sha256_prefix":"3271072775c90837","entry":"loadAM","repo":"tsinghua-fib-lab/gpd","repo_kind":"official","path":"GPD/PredictionModel/datasets.py","file_url":"https://github.com/tsinghua-fib-lab/gpd/blob/HEAD/GPD/PredictionModel/datasets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3271072775c90837"}},{"code_sha256_prefix":"427a9cc90a721278","entry":"metric_func","repo":"tsinghua-fib-lab/gpd","repo_kind":"official","path":"GPD/PredictionModel/utils.py","file_url":"https://github.com/tsinghua-fib-lab/gpd/blob/HEAD/GPD/PredictionModel/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"427a9cc90a721278"}},{"code_sha256_prefix":"3111cac67fcf4405","entry":"datapreparing","repo":"tsinghua-fib-lab/gpd","repo_kind":"official","path":"GPD/datapreparing.py","file_url":"https://github.com/tsinghua-fib-lab/gpd/blob/HEAD/GPD/datapreparing.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3111cac67fcf4405"}},{"code_sha256_prefix":"1b23af7e990267fc","entry":"getNewIndex","repo":"tsinghua-fib-lab/gpd","repo_kind":"official","path":"GPD/evalParams.py","file_url":"https://github.com/tsinghua-fib-lab/gpd/blob/HEAD/GPD/evalParams.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1b23af7e990267fc"}},{"code_sha256_prefix":"2828bc45778287b7","entry":"setup_logger","repo":"tsinghua-fib-lab/gpd","repo_kind":"official","path":"GPD/diffusionutils.py","file_url":"https://github.com/tsinghua-fib-lab/gpd/blob/HEAD/GPD/diffusionutils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2828bc45778287b7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}