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