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

Jianqi Zhang, Jingyao Wang, Wenwen Qiang, Fanjiang Xu, Changwen Zheng
1/12/2026
cs.LGcs.AI

No official code found. Best implementation: jlu-phyComputer/LVICL (0 stars, last commit 2025-10-06). 1 more below.

Abstract

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.

View on arXivView PDF

Code Implementations(2)

The repo is the official implementation for the paper: Enhancing Large Language Models for Time-Series Forecasting via Vector-Injected In-Context Learning

01PythonOct 6, 20251 years ago

The repo is the official implementation for the paper: Enhancing Large Language Models for Time-Series Forecasting via Vector-Injected In-Context Learning

00PythonOct 6, 20251 years ago

Similar Papers

Cite this paper

@article{zhang2026enhancing,
  title  = {Enhancing Large Language Models for Time-Series Forecasting via Vector-Injected In-Context Learning},
  author = {Jianqi Zhang and Jingyao Wang and Wenwen Qiang and Fanjiang Xu and Changwen Zheng},
  year   = {2026},
  eprint = {2601.07903},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.07903v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.07903.svg)](https://codeofpaper.com/paper/2601.07903)

Discussion