[论文解读] DQ-LoRe: Dual Queries with Low Rank Approximation Re-ranking for In-Context Learning
DQ-LoRe 提出了一种双查询框架,通过利用大语言模型(LLMs)生成思维链(CoT)推理,再通过引入低秩近似(LoRe)的检索模型对样本进行重排序,从而增强上下文学习。该方法通过降维过滤冗余信息,提升样本选择质量,在 GPT-4 上实现 94.2% 的准确率,相较之前最先进方法提升 1.7%。
Recent advances in natural language processing, primarily propelled by Large Language Models (LLMs), have showcased their remarkable capabilities grounded in in-context learning. A promising avenue for guiding LLMs in intricate reasoning tasks involves the utilization of intermediate reasoning steps within the Chain-of-Thought (CoT) paradigm. Nevertheless, the central challenge lies in the effective selection of exemplars for facilitating in-context learning. In this study, we introduce a framework that leverages Dual Queries and Low-rank approximation Re-ranking (DQ-LoRe) to automatically select exemplars for in-context learning. Dual Queries first query LLM to obtain LLM-generated knowledge such as CoT, then query the retriever to obtain the final exemplars via both question and the knowledge. Moreover, for the second query, LoRe employs dimensionality reduction techniques to refine exemplar selection, ensuring close alignment with the input question's knowledge. Through extensive experiments, we demonstrate that DQ-LoRe significantly outperforms prior state-of-the-art methods in the automatic selection of exemplars for GPT-4, enhancing performance from 92.5% to 94.2%. Our comprehensive analysis further reveals that DQ-LoRe consistently outperforms retrieval-based approaches in terms of both performance and adaptability, especially in scenarios characterized by distribution shifts. DQ-LoRe pushes the boundary of in-context learning and opens up new avenues for addressing complex reasoning challenges. Our code is released at https://github.com/menik1126/DQ-LoRe
研究动机与目标
- 解决人工选择上下文样本时存在的不稳定性及缺乏可泛化标准的问题。
- 通过引入中间推理步骤(CoT)而非仅依赖问题相似性,改进样本选择。
- 通过降维减少高维嵌入中的冗余,提升样本区分度。
- 在分布偏移场景下增强样本选择的鲁棒性与适应性。
- 构建一个可扩展、高效的框架,利用 LLM 与检索模型在两级查询流水线中协同工作。
提出的方法
- 采用双查询机制:首先查询 LLM,为输入问题生成思维链(CoT)推理。
- 将输入问题与其生成的 CoT 拼接,形成更丰富的查询用于检索器。
- 使用组合后的“问题+CoT”查询,向小规模检索模型查询候选样本。
- 对检索到的样本嵌入空间应用低秩近似(如 PCA),以过滤冗余信息。
- 基于低秩表示对样本进行重排序,提升与输入推理结构的一致性。
- 将最终重排序后的样本输入 LLM 进行推理,从而提升推理性能。

实验结果
研究问题
- RQ1在上下文学习中,引入 LLM 生成的思维链(CoT)推理是否能提升样本检索质量?
- RQ2通过低秩近似进行降维,是否能增强语义相似但逻辑不同的样本之间的区分度?
- RQ3在分布偏移条件下,DQ-LoRe 相较于基于检索的基线方法表现如何?
- RQ4双查询机制是否能减少对仅基于问题相似性的依赖,并提升少样本提示中的鲁棒性?
- RQ5基于 LoRe 的重排序在多步推理基准测试中,能在多大程度上提升泛化能力与性能?
主要发现
- DQ-LoRe 将 GPT-4 在上下文学习中的准确率从 92.5% 提升至 94.2%,相较之前最先进方法实现 1.7% 的绝对提升。
- 该方法在分布偏移下表现出更优的鲁棒性,性能稳定,而基于检索的基线方法则明显下降。
- 低秩近似(LoRe)能有效减少高维嵌入中的冗余,提升样本区分度与选择质量。
- 双查询机制通过利用 LLM 生成的推理,显著提升检索效果,在准确率与泛化能力上均优于仅基于问题的检索。
- DQ-LoRe 在多个多步推理基准测试(包括 SVAMP 和 GSM8K)中持续优于现有基于检索的方法。
- 由于 PCA 的过滤作用,该框架在样本库中存在虚假相关性或词共现模式时仍具备良好适应性与有效性。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。