Artificial Intelligence
October 15, 2024
9 min read
Leveraging Large Language Models for Time-Series Forecasting
A look at recent research on zero-shot forecasting with LLMs — where they win and where they fall apart.

Time-series forecasting, a cornerstone in fields like economics, finance, and energy management, has traditionally relied on statistical models such as ARIMA or exponential smoothing. However, the rise of Large Language Models (LLMs) like GPT-4 and LLAMA has opened new possibilities for time-series forecasting. LLMs have demonstrated their ability to process and generate text, but recent research shows that they can also excel in predicting sequential data without the need for extensive fine-tuning.
In this piece, we'll explore how LLMs can be used for time forecasting, highlighting key insights from recent research on the subject and discussing how their capabilities can be harnessed effectively.
LLMs and time-series forecasting: a new frontier
Traditionally, time-series forecasting models are designed to handle sequential data by identifying patterns in the form of trends, seasonality, and residuals. These models, however, often require fine-tuning and customization for different types of datasets. LLMs offer a more flexible approach, as they can be applied to time-series data in a zero-shot setting. This means LLMs can generate accurate forecasts without extensive training on a specific dataset, making them a powerful tool.
According to research by Tang et al. (2024) from institutions such as Rutgers University and Shanghai Jiao Tong University, LLMs perform particularly well when forecasting time-series data that exhibit clear trends and seasonal patterns. Their study found that LLMs can effectively capture the underlying periodic patterns in datasets, leading to strong forecasting performance under certain conditions.
Why do LLMs excel at time forecasting?
LLMs are fundamentally designed to understand and generate human language, but they can also handle structured data — such as time series — by treating numerical sequences as text. The key to their success lies in their ability to discern intricate concepts within temporally correlated data.
Tang et al. demonstrated that LLMs can identify trends and seasonal strengths in time-series data, often outperforming traditional forecasting methods when these patterns are strong. The models work by recognizing the periodic structure inherent in the data, even without the need for fine-tuning. This ability to generalize makes LLMs highly effective for certain types of time-series forecasts.
For example, LLMs were tested on datasets such as the AirPassengerDataset and MonthlyMilkDataset, both of which exhibit strong seasonal patterns. The models were able to capture these patterns and provide accurate forecasts by recognizing the cycles within the data. In contrast, datasets with weaker or more complex periodicities posed challenges for LLMs, as their ability to detect multiple periods was less effective.
Enhancing LLM performance in time forecasting
Although LLMs perform well with clear seasonal and trend data, their effectiveness can be further enhanced by integrating additional techniques. Tang et al. proposed two main strategies to improve the accuracy of LLM-based time forecasting:
- Incorporating external knowledge. By embedding domain-specific information into the input prompts, LLMs can leverage contextual knowledge to better understand the data. For instance, providing information about the economic context or environmental factors that influence the time series can help the model make more informed predictions.
- Natural-language paraphrasing. Instead of using raw numerical data, converting the time-series data into a natural-language format can improve the LLM's comprehension. For example, describing the changes between data points as "The value rises from X to Y" allows the model to process the data more effectively.
These techniques allow LLMs to outperform traditional forecasting models on a wide range of datasets, particularly those with clear seasonal and trend components.
Limitations and future directions
While LLMs have shown remarkable potential in time forecasting, there are still challenges to be addressed. LLMs tend to struggle with datasets that exhibit multiple overlapping periods or irregular patterns. This is because the models may fail to fully capture the distinct cycles present in such data. Additionally, LLMs are more sensitive to the later segments of the input sequence, meaning that noise or inaccuracies in the final data points can significantly impact their performance.
Future research will likely focus on improving LLMs' ability to handle complex and multi-period time series. Fine-tuning LLMs on domain-specific data or incorporating new training techniques could help mitigate some of these challenges.
Conclusion
LLMs represent a significant advancement in time-series forecasting, offering flexibility and accuracy, particularly for datasets with strong seasonal and trend patterns. While they are not without limitations, the ongoing research and development in this area suggest that LLMs will play an increasingly important role in time-forecasting applications across industries. By incorporating external knowledge and natural-language paraphrasing, LLMs' performance can be further enhanced, paving the way for more robust and efficient forecasting models.
Tang, H., Zhang, C., Jin, M., Yu, Q., Wang, Z., Jin, X., Zhang, Y., & Du, M. (2024). Time-Series Forecasting with LLMs: Understanding and Enhancing Model Capabilities. arXiv preprint, https://arxiv.org/abs/2402.10835.