{"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/cafa-global-weather-forecasting-with","title":"CaFA: Global Weather Forecasting with Factorized Attention on Sphere","arxiv_id":"2405.07395","date":"2024-05-12","proceeding":null,"authors":["Zijie Li","Anthony Zhou","Saurabh Patil","Amir Barati Farimani"],"abstract":"Accurate weather forecasting is crucial in various sectors, impacting decision-making processes and societal events. Data-driven approaches based on machine learning models have recently emerged as a promising alternative to numerical weather prediction models given their potential to capture physics of different scales from historical data and the significantly lower computational cost during the prediction stage. Renowned for its state-of-the-art performance across diverse domains, the Transformer model has also gained popularity in machine learning weather prediction. Yet applying Transformer architectures to weather forecasting, particularly on a global scale is computationally challenging due to the quadratic complexity of attention and the quadratic increase in spatial points as resolution increases. In this work, we propose a factorized-attention-based model tailored for spherical geometries to mitigate this issue. More specifically, it utilizes multi-dimensional factorized kernels that convolve over different axes where the computational complexity of the kernel is only quadratic to the axial resolution instead of overall resolution. The deterministic forecasting accuracy of the proposed model on $1.5^\\circ$ and 0-7 days' lead time is on par with state-of-the-art purely data-driven machine learning weather prediction models. We also showcase the proposed model holds great potential to push forward the Pareto front of accuracy-efficiency for Transformer weather models, where it can achieve better accuracy with less computational cost compared to Transformer based models with standard attention.","url_abs":"https://arxiv.org/abs/2405.07395v1","url_pdf":"https://arxiv.org/pdf/2405.07395v1.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":"cafa-global-weather-forecasting-with","repo_url":"https://github.com/BaratiLab/CaFA","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"prediction","task_name":"Prediction"},{"task_slug":"weather-forecasting","task_name":"Weather Forecasting"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.07395","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.07395"}},"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/BaratiLab/CaFA","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":2,"ran":4,"ran_honours":1},"by_repo_kind":{"official":{"samples":7,"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":"aa5486a3650902d8","entry":"exists","repo":"BaratiLab/CaFA","repo_kind":"official","path":"libs/positional_encoding_module.py","file_url":"https://github.com/BaratiLab/CaFA/blob/HEAD/libs/positional_encoding_module.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"515987a2a36b3d89","entry":"get_cosine_weight","repo":"BaratiLab/CaFA","repo_kind":"official","path":"utils/loss_utils.py","file_url":"https://github.com/BaratiLab/CaFA/blob/HEAD/utils/loss_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"515987a2a36b3d89"}},{"code_sha256_prefix":"33805df68cb6892e","entry":"get_emb","repo":"BaratiLab/CaFA","repo_kind":"official","path":"libs/positional_encoding_module.py","file_url":"https://github.com/BaratiLab/CaFA/blob/HEAD/libs/positional_encoding_module.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"33805df68cb6892e"}},{"code_sha256_prefix":"77e8930f34309d7d","entry":"get_time_embedding","repo":"BaratiLab/CaFA","repo_kind":"official","path":"libs/positional_encoding_module.py","file_url":"https://github.com/BaratiLab/CaFA/blob/HEAD/libs/positional_encoding_module.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"77e8930f34309d7d"}},{"code_sha256_prefix":"513b813d6932a659","entry":"latitude_weighted_l1","repo":"BaratiLab/CaFA","repo_kind":"official","path":"utils/loss_utils.py","file_url":"https://github.com/BaratiLab/CaFA/blob/HEAD/utils/loss_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"513b813d6932a659"}},{"code_sha256_prefix":"2614986bcbcc0b0d","entry":"latitude_weighted_rmse","repo":"BaratiLab/CaFA","repo_kind":"official","path":"utils/loss_utils.py","file_url":"https://github.com/BaratiLab/CaFA/blob/HEAD/utils/loss_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2614986bcbcc0b0d"}},{"code_sha256_prefix":"6ba8cee9f5daea41","entry":"pair","repo":"BaratiLab/CaFA","repo_kind":"official","path":"libs/attention.py","file_url":"https://github.com/BaratiLab/CaFA/blob/HEAD/libs/attention.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6ba8cee9f5daea41"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}