Retrieval-augmented generation (RAG) enhances zero-shot time series (TS) forecasting by leveraging external knowledge bases, yet existing approaches overlook input-level relevance when fusing retrieved samples with the query. We argue that not all retrievals are equally useful, and irrelevant ones can degrade performance. To this end, we propose Cross-RAG, a zero-shot RAG-based forecasting framework that selectively attends to query-relevant retrieved samples via query--retrieval cross-attention. By modeling input-level relevance between the query and retrieved samples, Cross-RAG jointly incorporates three sources of information: 1) the query itself, 2) the retrieved samples, and 3) their relational interactions. In particular, this input-aware design enables Cross-RAG to remain stable as the number of retrieved samples $k$ grows, whereas prior methods without cross-attention require careful $k$ tuning to avoid degradation from irrelevant retrievals. Extensive experiments demonstrate that Cross-RAG consistently improves zero-shot forecasting performance across multiple TSFM backbones and various RAG methods, with additional analyses confirming its effectiveness across various retrieval scenarios. Code is available at https://github.com/seunghan96/cross-rag/.
翻译:检索增强生成(RAG)通过利用外部知识库增强了零样本时间序列预测能力,但现有方法在融合检索样本与查询时忽略了输入级别的相关性。我们认为并非所有检索结果都具有同等效用,无关的检索反而会降低性能。为此,我们提出Cross-RAG——一种基于RAG的零样本预测框架,通过查询-检索交叉注意力机制选择性关注与查询相关的检索样本。通过建模查询与检索样本之间的输入级相关性,Cross-RAG联合整合三方面信息:1)查询本身,2)检索样本,3)二者的关系交互。特别地,这种输入感知设计使得Cross-RAG在检索样本数量$k$增长时保持稳定,而传统无交叉注意力的方法需要谨慎调整$k$值以避免无关检索导致的性能退化。大量实验表明,Cross-RAG在多种TSFM骨干网络和不同RAG方法上持续提升零样本预测性能,附加分析进一步验证了其在各类检索场景下的有效性。代码已开源:https://github.com/seunghan96/cross-rag/。