Skip to main content
QUICK REVIEW

[Paper Review] Time Series Forecasting with LLMs: Understanding and Enhancing Model Capabilities

Hua Tang, Chong Zhang|arXiv (Cornell University)|Feb 16, 2024
Time Series Analysis and ForecastingComputer Science3 citations
TL;DR

This paper investigates large language models (LLMs) for time series forecasting, revealing their preference for data with strong trends or seasonality. By designing prompts to elicit periodicity detection and applying natural language paraphrasing and external knowledge injection, the authors enhance LLM performance, particularly on structured time series, while identifying limitations in multi-period scenarios.

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.

Motivation & Objective

  • To understand LLMs' preferences in time series forecasting, especially regarding trend and seasonal strength.
  • To investigate how input sequence structure and prompt design influence LLM forecasting performance.
  • To evaluate the impact of transforming numerical sequences into natural language and incorporating external knowledge.
  • To identify limitations of LLMs in handling multi-period time series.
  • To provide actionable techniques for improving LLM-based forecasting through prompt engineering and data reformatting.

Proposed method

  • Transforming numerical time series into string sequences with digit-space separation and comma delimiters to align with LLM tokenization.
  • Designing zero-shot prompts that explicitly ask LLMs to identify the period of a time series, enabling analysis of their periodicity detection ability.
  • Creating counterfactual datasets by adding Gaussian noise to input sequences to test sensitivity to input segment proximity to the prediction target.
  • Applying natural language paraphrasing to reframe numerical sequences into descriptive text (e.g., 'the number of passengers increased steadily') to improve model comprehension.
  • Incorporating external knowledge into prompts, such as domain-specific context about seasonal patterns or trends.
  • Using fixed, pre-trained LLMs (e.g., GPT-3.5-Turbo, GPT-4-Turbo, Llama-2) without fine-tuning to evaluate zero-shot generalization.

Experimental results

Research questions

  • RQ1How do LLMs perform on time series with varying degrees of trend and seasonal strength?
  • RQ2What role does the segment of input sequence closest to the prediction target play in LLM forecasting performance?
  • RQ3Can LLMs accurately detect the periodicity of a time series when prompted to do so?
  • RQ4How does transforming numerical sequences into natural language affect forecasting accuracy?
  • RQ5To what extent does incorporating external knowledge improve LLM performance in time series forecasting?

Key findings

  • LLMs demonstrate superior performance on time series with high trend or seasonal strength, particularly when the periodicity is clear.
  • LLMs are highly sensitive to the input segment immediately preceding the prediction window, indicating strong local pattern dependence.
  • When prompted to identify the period, LLMs can accurately determine the periodicity of a dataset, explaining their strong performance on periodic data.
  • Natural language paraphrasing of numerical sequences significantly improves forecasting performance, reducing MSE by up to 80% on certain datasets like AirPassengers.
  • Incorporating external knowledge into prompts enhances model understanding of temporal structures, especially for complex or non-obvious patterns.
  • LLMs struggle with multi-period time series, indicating a limitation in recognizing and modeling multiple overlapping periodic components.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.