Skip to main content
QUICK REVIEW

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

Jiong Xiong, Zixuan Li|arXiv (Cornell University)|Oct 4, 2023
Context-Aware Activity Recognition SystemsComputer Science3 citations
TL;DR

DQ-LoRe proposes a dual-query framework that enhances in-context learning by leveraging Large Language Models (LLMs) to generate Chain-of-Thought (CoT) reasoning, which is then used to re-rank exemplars via a retrieval model enhanced with low-rank approximation (LoRe). The method improves exemplar selection by filtering redundant information through dimensionality reduction, achieving a 94.2% accuracy on GPT-4, a 1.7% improvement over prior state-of-the-art methods.

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. 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

Motivation & Objective

  • Address the instability and lack of generalizable criteria in manual in-context exemplar selection for LLMs.
  • Improve exemplar selection by incorporating intermediate reasoning steps (CoT) beyond simple question similarity.
  • Reduce redundancy in high-dimensional embeddings through dimensionality reduction to enhance exemplar differentiation.
  • Enhance robustness and adaptability of exemplar selection under distribution shift scenarios.
  • Develop a scalable, efficient framework that leverages LLMs and retrieval models in a two-stage querying pipeline.

Proposed method

  • Use a dual-query mechanism: first query the LLM to generate Chain-of-Thought (CoT) reasoning for the input question.
  • Concatenate the input question and its generated CoT to form a richer query for the retriever.
  • Query a smaller-scale retrieval model using the combined question-CoT query to retrieve candidate exemplars.
  • Apply Low-rank approximation (e.g., PCA) to the embedding space of retrieved exemplars to filter out redundant information.
  • Re-rank exemplars based on the low-rank representation to improve alignment with the input’s reasoning structure.
  • Feed the final re-ranked exemplars to the LLM for inference, improving reasoning performance.
Figure 1: The overall pipeline of DQ-LoRe. It consists of three parts: Dual Query first query LLM to obtain CoT $y$ , then query the retriever to obtain the final exemplars via both question and LLM-generated knowledge. LoRe leverages PCA to approximate the low-rank embedding of retrieved exemplars,
Figure 1: The overall pipeline of DQ-LoRe. It consists of three parts: Dual Query first query LLM to obtain CoT $y$ , then query the retriever to obtain the final exemplars via both question and LLM-generated knowledge. LoRe leverages PCA to approximate the low-rank embedding of retrieved exemplars,

Experimental results

Research questions

  • RQ1Can incorporating LLM-generated Chain-of-Thought (CoT) reasoning improve exemplar retrieval quality in in-context learning?
  • RQ2Does dimensionality reduction via low-rank approximation enhance the differentiation between semantically similar but logically distinct exemplars?
  • RQ3How does DQ-LoRe perform compared to retrieval-based baselines under distribution shift conditions?
  • RQ4Can the dual-query mechanism reduce reliance on question-only similarity and improve robustness in few-shot prompting?
  • RQ5To what extent does LoRe-based re-ranking improve generalization and performance on multi-step reasoning benchmarks?

Key findings

  • DQ-LoRe improves in-context learning performance on GPT-4 from 92.5% to 94.2% accuracy, representing a 1.7% absolute improvement over prior state-of-the-art methods.
  • The method demonstrates superior robustness under distribution shift, maintaining high performance where retrieval-based baselines degrade.
  • Low-rank approximation (LoRe) effectively reduces redundancy in high-dimensional embeddings, improving exemplar distinction and selection quality.
  • The dual-query mechanism significantly enhances retrieval by leveraging LLM-generated reasoning, outperforming question-only retrieval in both accuracy and generalization.
  • DQ-LoRe consistently outperforms existing retrieval-based approaches across multiple multi-step reasoning benchmarks, including SVAMP and GSM8K.
  • The framework is adaptable and effective even when exemplar pools contain spurious correlations or word co-occurrence patterns, thanks to the filtering effect of PCA.
(a) The retriever on SVAMP is trained under the i.i.d. setting and the dimensionality-reduced results after retrieval on SVAMP.
(a) The retriever on SVAMP is trained under the i.i.d. setting and the dimensionality-reduced results after retrieval on SVAMP.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.