{"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/time-series-forecasting-with-llms","title":"Time Series Forecasting with LLMs: Understanding and Enhancing Model Capabilities","arxiv_id":"2402.10835","date":"2024-02-16","proceeding":null,"authors":["Hua Tang","Chong Zhang","Mingyu Jin","Qinkai Yu","Zhenting Wang","Xiaobo Jin","Yongfeng Zhang","Mengnan Du"],"abstract":"Large language models (LLMs) have been applied in many fields and have developed rapidly in recent years. As a classic machine learning task, time series forecasting has recently been boosted by LLMs. Recent works treat large language models as \\emph{zero-shot} time series reasoners without further fine-tuning, which achieves remarkable performance. However, there are some unexplored research problems when applying LLMs for time series forecasting under the zero-shot setting. For instance, the LLMs' preferences for the input time series are less understood. In this paper, by comparing LLMs with traditional time series forecasting models, we observe many interesting properties of LLMs in the context of time series forecasting. First, our study shows that LLMs perform well in predicting time series with clear patterns and trends, but face challenges with datasets lacking periodicity. This observation can be explained by the ability of LLMs to recognize the underlying period within datasets, which is supported by our experiments. In addition, the input strategy is investigated, and it is found that incorporating external knowledge and adopting natural language paraphrases substantially improve the predictive performance of LLMs for time series. Overall, our study contributes insight into LLMs' advantages and limitations in time series forecasting under different conditions.","url_abs":"https://arxiv.org/abs/2402.10835v5","url_pdf":"https://arxiv.org/pdf/2402.10835v5.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":"time-series-forecasting-with-llms","repo_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"jax","reach":{"status":"ok"}}],"tasks":[{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series-forecasting","task_name":"Time Series Forecasting"},{"task_slug":"time-series-prediction","task_name":"Time Series Prediction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.10835","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.10835"}},"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/mingyuj666/time-series-forecasting-with-llms","reach":{"status":"ok"}}],"summary":{"ran":10,"unverified":12},"by_repo_kind":{"official":{"samples":22,"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":22,"samples":[{"code_sha256_prefix":"a43c0e795f42a4e4","entry":"get_avg_tokens_per_step","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/promptcast.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/promptcast.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":"a43c0e795f42a4e4"}},{"code_sha256_prefix":"f9f0267039a3e10c","entry":"get_chunked_AR_likelihoods","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/darts.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/darts.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":"f9f0267039a3e10c"}},{"code_sha256_prefix":"c9d4277557a5ad48","entry":"get_gp_predictions_data","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/gaussian_process.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/gaussian_process.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":"c9d4277557a5ad48"}},{"code_sha256_prefix":"ddf3ae386381837b","entry":"get_scaler","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/llmtime.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/llmtime.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":"ddf3ae386381837b"}},{"code_sha256_prefix":"e2334c5cdd64f02f","entry":"handle_prediction","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/llmtime.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/llmtime.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":"e2334c5cdd64f02f"}},{"code_sha256_prefix":"ea3f2a9058322ab1","entry":"llama2_model_string","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/llama.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/llama.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ea3f2a9058322ab1"}},{"code_sha256_prefix":"c0e90befe3def690","entry":"metrics_used","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"utils_others.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/utils_others.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":"c0e90befe3def690"}},{"code_sha256_prefix":"1584833dcf9cb539","entry":"paraphrase_seq2lan","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"utils_paragraph.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/utils_paragraph.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":"1584833dcf9cb539"}},{"code_sha256_prefix":"a944775a44d34a92","entry":"test_gp","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/gaussian_process.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/gaussian_process.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":"a944775a44d34a92"}},{"code_sha256_prefix":"fbf4f5f91d7ae546","entry":"unflatten","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/utils.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/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":"fbf4f5f91d7ae546"}},{"code_sha256_prefix":"697cdd488db56658","entry":"describe_change","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"utils_paragraph.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/utils_paragraph.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":"697cdd488db56658"}},{"code_sha256_prefix":"2a86130b6c290600","entry":"evaluate_hyper","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/validation_likelihood_tuning.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/validation_likelihood_tuning.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":"2a86130b6c290600"}},{"code_sha256_prefix":"4d2db8ac4af8bffc","entry":"flatten","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/utils.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/utils.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":"4d2db8ac4af8bffc"}},{"code_sha256_prefix":"07a1ec7a6c69ed48","entry":"get_allowed_ids","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/gpt.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/gpt.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":"07a1ec7a6c69ed48"}},{"code_sha256_prefix":"42592f351c8e9f61","entry":"get_model_and_tokenizer","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/llama.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/llama.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":"42592f351c8e9f61"}},{"code_sha256_prefix":"013b729b67771afc","entry":"get_token_ids","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/promptcast.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/promptcast.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":"013b729b67771afc"}},{"code_sha256_prefix":"cfe13ed62ca54e83","entry":"get_tokenizer","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/llama.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/llama.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":"cfe13ed62ca54e83"}},{"code_sha256_prefix":"3ead7ce217600482","entry":"make_validation_dataset","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/validation_likelihood_tuning.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/validation_likelihood_tuning.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":"3ead7ce217600482"}},{"code_sha256_prefix":"7c64b8e59c3fb35b","entry":"paraphrase_initial","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"utils_paragraph.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/utils_paragraph.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":"7c64b8e59c3fb35b"}},{"code_sha256_prefix":"3aae9ed7e6ed94d4","entry":"sample_config","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/utils.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/utils.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":"3aae9ed7e6ed94d4"}},{"code_sha256_prefix":"0974c070244bffa0","entry":"tokenize_fn","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/gpt.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/gpt.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":"0974c070244bffa0"}},{"code_sha256_prefix":"76c5dcef347a5103","entry":"train_gp","repo":"mingyuj666/time-series-forecasting-with-llms","repo_kind":"official","path":"models/gaussian_process.py","file_url":"https://github.com/mingyuj666/time-series-forecasting-with-llms/blob/HEAD/models/gaussian_process.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":"76c5dcef347a5103"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}