DQ-LoRe: Dual Queries with Low Rank Approximation Re-ranking for In-Context Learning

Jing Xiong, Zixuan Li, Chuanyang Zheng, Zhijiang Guo, Yichun Yin +8 more
10/4/2023
cs.CL

Official code: menik1126/DQ-LoRe (6 stars, Python, Apache-2.0, last commit 2026-01-09). Most starred: AI4fun/DQ-LoRe, a community implementation (13 stars, Python, last commit 2024-06-26, 2.2× the official stars). 1 more implementation below.

Abstract

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.

Show full abstract

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

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
menik1126/DQ-LoReOfficial6PythonApache-2.02026-01-09
AI4fun/DQ-LoReCommunity13Python–2024-06-26
menik1126/DQ-LoReOfficial100%
Apache-2.0

[ICLR2024🔥] DQ-LoRe: Dual Queries with Low Rank Approximation Re-ranking for In-Context Learning

618Python, ShellOct 24, 202310 months agoApache-2.0
AI4fun/DQ-LoReCommunity100%
130Python, ShellOct 2, 20232 years ago

Similar Papers

Cite this paper

@article{xiong2023dqlore,
  title  = {DQ-LoRe: Dual Queries with Low Rank Approximation Re-ranking for In-Context Learning},
  author = {Jing Xiong and Zixuan Li and Chuanyang Zheng and Zhijiang Guo and Yichun Yin and Enze Xie and Zhicheng Yang and Qingxing Cao and Haiming Wang and Xiongwei Han and Jing Tang and Chengming Li and Xiaodan Liang},
  year   = {2023},
  eprint = {2310.02954},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.02954v6}
}

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/2310.02954.svg)](https://codeofpaper.com/paper/2310.02954)

Discussion