{"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/elastst-towards-robust-varied-horizon","title":"ElasTST: Towards Robust Varied-Horizon Forecasting with Elastic Time-Series Transformer","arxiv_id":"2411.01842","date":"2024-11-04","proceeding":null,"authors":["Jiawen Zhang","Shun Zheng","Xumeng Wen","Xiaofang Zhou","Jiang Bian","Jia Li"],"abstract":"Numerous industrial sectors necessitate models capable of providing robust forecasts across various horizons. Despite the recent strides in crafting specific architectures for time-series forecasting and developing pre-trained universal models, a comprehensive examination of their capability in accommodating varied-horizon forecasting during inference is still lacking. This paper bridges this gap through the design and evaluation of the Elastic Time-Series Transformer (ElasTST). The ElasTST model incorporates a non-autoregressive design with placeholders and structured self-attention masks, warranting future outputs that are invariant to adjustments in inference horizons. A tunable version of rotary position embedding is also integrated into ElasTST to capture time-series-specific periods and enhance adaptability to different horizons. Additionally, ElasTST employs a multi-scale patch design, effectively integrating both fine-grained and coarse-grained information. During the training phase, ElasTST uses a horizon reweighting strategy that approximates the effect of random sampling across multiple horizons with a single fixed horizon setting. Through comprehensive experiments and comparisons with state-of-the-art time-series architectures and contemporary foundation models, we demonstrate the efficacy of ElasTST's unique design elements. Our findings position ElasTST as a robust solution for the practical necessity of varied-horizon forecasting.","url_abs":"https://arxiv.org/abs/2411.01842v1","url_pdf":"https://arxiv.org/pdf/2411.01842v1.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":"elastst-towards-robust-varied-horizon","repo_url":"https://github.com/microsoft/probts","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":null,"task_name":"Position"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series-forecasting","task_name":"Time Series 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=2411.01842","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.01842"}},"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/microsoft/ProbTS","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/microsoft/probts","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":2,"unverified":12},"by_repo_kind":{"official":{"samples":14,"ran":2,"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":"df116dde4bb6ab3e","entry":"extract","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/utils.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/utils.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"df116dde4bb6ab3e"}},{"code_sha256_prefix":"e5947aba1d10885f","entry":"get_1d_sincos_pos_embed_from_grid","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/position_emb.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/position_emb.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e5947aba1d10885f"}},{"code_sha256_prefix":"1b456163f15dff07","entry":"abs_error","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/metrics.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1b456163f15dff07"}},{"code_sha256_prefix":"a169084ad0e815a0","entry":"abs_target_sum","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/metrics.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a169084ad0e815a0"}},{"code_sha256_prefix":"a8273d970bb0f2ba","entry":"byte2gb","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/callbacks/memory_callback.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/callbacks/memory_callback.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a8273d970bb0f2ba"}},{"code_sha256_prefix":"76c6745b9b380415","entry":"calculate_average","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/save_utils.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/save_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"76c6745b9b380415"}},{"code_sha256_prefix":"09de1fe9aa41ea2c","entry":"calculate_weighted_average","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/save_utils.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/save_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"09de1fe9aa41ea2c"}},{"code_sha256_prefix":"627f3d58e3247384","entry":"get_weights","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/model/forecast_module.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/model/forecast_module.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"627f3d58e3247384"}},{"code_sha256_prefix":"02b65b093a712e17","entry":"mse","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/metrics.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"02b65b093a712e17"}},{"code_sha256_prefix":"366672efd91af2fd","entry":"process_tensor","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/evaluator.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/evaluator.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"366672efd91af2fd"}},{"code_sha256_prefix":"d6932de4de105184","entry":"repeat","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/utils.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d6932de4de105184"}},{"code_sha256_prefix":"99d47a14c8bad15e","entry":"sin_cos_encoding","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/position_emb.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/position_emb.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"99d47a14c8bad15e"}},{"code_sha256_prefix":"8dd5f62ecb607733","entry":"update_metrics","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/save_utils.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/save_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8dd5f62ecb607733"}},{"code_sha256_prefix":"3cd5309f49681509","entry":"weighted_average","repo":"microsoft/ProbTS","repo_kind":"official","path":"probts/utils/utils.py","file_url":"https://github.com/microsoft/ProbTS/blob/HEAD/probts/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3cd5309f49681509"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}