Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Enhancing Large Language Models for Time-Series Forecasting via Vector-Injected In-Context Learning

About

The World Wide Web needs reliable predictive capabilities to respond to changes in user behavior and usage patterns. Time series forecasting (TSF) is a key means to achieve this goal. In recent years, the large language models (LLMs) for TSF (LLM4TSF) have achieved good performance. However, there is a significant difference between pretraining corpora and time series data, making it hard to guarantee forecasting quality when directly applying LLMs to TSF; fine-tuning LLMs can mitigate this issue, but often incurs substantial computational overhead. Thus, LLM4TSF faces a dual challenge of prediction performance and compute overhead. To address this, we aim to explore a method for improving the forecasting performance of LLM4TSF while freezing all LLM parameters to reduce computational overhead. Inspired by in-context learning (ICL), we propose LVICL. LVICL uses our vector-injected ICL to inject example information into a frozen LLM, eliciting its in-context learning ability and thereby enhancing its performance on the example-related task (i.e., TSF). Specifically, we first use the LLM together with a learnable context vector adapter to extract a context vector from multiple examples adaptively. This vector contains compressed, example-related information. Subsequently, during the forward pass, we inject this vector into every layer of the LLM to improve forecasting performance. Compared with conventional ICL that adds examples into the prompt, our vector-injected ICL does not increase prompt length; moreover, adaptively deriving a context vector from examples suppresses components harmful to forecasting, thereby improving model performance. Extensive experiments demonstrate the effectiveness of our approach.

Jianqi Zhang, Jingyao Wang, Wenwen Qiang, Fanjiang Xu, Changwen Zheng• 2026

Related benchmarks

TaskDatasetResultRank
Long-term time-series forecastingETTh1
MAE0.412
351
Long-term time-series forecastingWeather
MSE0.222
348
Long-term time-series forecastingETTh2
MSE0.326
327
Long-term time-series forecastingETTm2
MSE0.239
305
Long-term time-series forecastingETTm1
MSE0.328
295
Long-term time-series forecastingTraffic
MSE0.37
278
Long-term time-series forecastingECL
MSE0.158
134
Showing 7 of 7 rows

Other info

Follow for update