In-Context and Few-Shots Learning for Forecasting Time Series Data based on Large Language Models

📅 2025-12-08
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This study systematically benchmarks large language models (LLMs) and pretrained time-series foundation models (e.g., TimesFM) against classical forecasting methods (ARIMA, LSTM, TCN, Transformer) to delineate their performance boundaries in time-series forecasting. Method: We propose a fine-tuning-free in-context learning (ICL) framework that unifies LLMs (o4-mini, Gemini 2.5 Flash Lite) and TimesFM into zero-shot and few-shot forecasting pipelines. Contribution/Results: Experimental results demonstrate that TimesFM achieves the best overall trade-off (RMSE = 0.3023, inference latency = 266 seconds), while o4-mini remains competitive in zero-shot settings. Crucially, this work validates the direct applicability of pretrained time-series foundation models to ICL—establishing a lightweight, efficient, and parameter-efficient forecasting paradigm that eliminates the need for task-specific fine-tuning.

Technology Category

Application Category

📝 Abstract
Existing data-driven approaches in modeling and predicting time series data include ARIMA (Autoregressive Integrated Moving Average), Transformer-based models, LSTM (Long Short-Term Memory) and TCN (Temporal Convolutional Network). These approaches, and in particular deep learning-based models such as LSTM and TCN, have shown great results in predicting time series data. With the advancement of leveraging pre-trained foundation models such as Large Language Models (LLMs) and more notably Google's recent foundation model for time series data, {it TimesFM} (Time Series Foundation Model), it is of interest to investigate whether these foundation models have the capability of outperforming existing modeling approaches in analyzing and predicting time series data. This paper investigates the performance of using LLM models for time series data prediction. We investigate the in-context learning methodology in the training of LLM models that are specific to the underlying application domain. More specifically, the paper explores training LLMs through in-context, zero-shot and few-shot learning and forecasting time series data with OpenAI { t o4-mini} and Gemini 2.5 Flash Lite, as well as the recent Google's Transformer-based TimesFM, a time series-specific foundation model, along with two deep learning models, namely TCN and LSTM networks. The findings indicate that TimesFM has the best overall performance with the lowest RMSE value (0.3023) and the competitive inference time (266 seconds). Furthermore, OpenAI's o4-mini also exhibits a good performance based on Zero Shot learning. These findings highlight pre-trained time series foundation models as a promising direction for real-time forecasting, enabling accurate and scalable deployment with minimal model adaptation.
Problem

Research questions and friction points this paper is trying to address.

Evaluating LLMs for time series forecasting accuracy
Comparing in-context and few-shot learning methods
Assessing foundation models against traditional deep learning approaches
Innovation

Methods, ideas, or system contributions that make the work stand out.

Uses in-context learning with LLMs for time series
Compares foundation models like TimesFM against traditional methods
Demonstrates TimesFM's superior accuracy and competitive speed
🔎 Similar Papers
No similar papers found.
S
Saroj Gopali
Department of Computer Science, Texas Tech University
B
Bipin Chhetri
Department of Computer Science, Texas Tech University
D
Deepika Giri
Cumberland University
S
Sima Siami-Namini
Advanced Academic Programs Science, Johns Hopkins University
Akbar Siami Namin
Akbar Siami Namin
Professor of Computer Science, Texas Tech University
Machine/Deep LearningHuman Factor ModelingTrustworthy/Agentic AILLM/NLPAnomaly Detection