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.
翻译:万维网需要可靠的预测能力以响应用户行为和使用模式的变化。时间序列预测是实现这一目标的关键手段。近年来,面向时间序列预测的大语言模型已取得良好性能。然而,预训练语料与时间序列数据之间存在显著差异,直接应用大语言模型于时间序列预测难以保证预测质量;微调大语言模型可缓解此问题,但通常会产生大量计算开销。因此,面向时间序列预测的大语言模型面临预测性能与计算开销的双重挑战。为解决此问题,我们旨在探索一种在冻结所有大语言模型参数以降低计算开销的同时,提升其时间序列预测性能的方法。受上下文学习的启发,我们提出LVICL方法。LVICL利用我们提出的向量注入式上下文学习,将示例信息注入冻结的大语言模型中,激发其上下文学习能力,从而提升其在相关任务(即时间序列预测)上的性能。具体而言,我们首先使用大语言模型与可学习的上下文向量适配器,从多个示例中自适应地提取上下文向量。该向量包含经过压缩的、与示例相关的信息。随后在前向传播过程中,我们将此向量注入大语言模型的每一层,以提升预测性能。与将示例添加至提示词的传统上下文学习相比,我们的向量注入式上下文学习不会增加提示长度;此外,从示例中自适应推导上下文向量能抑制对预测有害的成分,从而提升模型性能。大量实验证明了我们方法的有效性。