Dynamic uncertainty ranking: enhancing retrieval-augmented in-context learning for long-tail knowledge in LLMs

Training framework of the proposed method. After pre-selection using BM25 for each validation sample pi, we conduct from 0-shot to ki-shot inference and update retriever Sθ according to the dynamic impacts of each sample on LLMs based on the reward from LLM.

Large language models (LLMs) can learn vast amounts of knowledge from diverse domains during pre-training. However, long-tail knowledge from specialized domains is often scarce and underrepresented, rarely appearing in the models’ memorization. Prior work has shown that in-context learning (ICL) with retriever augmentation can help LLMs better capture long-tail knowledge, reducing their reliance on pre-trained data. Despite these advances, we observe that LLM predictions for long-tail questions remain uncertain to variations in retrieved samples. To take advantage of the uncertainty in ICL for guiding LLM predictions toward correct answers on long-tail samples, we propose a reinforcement learning-based dynamic uncertainty ranking method for retrieval-augmented ICL that accounts for the varying impact of each retrieved sample on LLM predictions. Our approach prioritizes more informative and stable samples while demoting misleading ones, updating rankings based on the feedback from the LLM w.r.t. each retrieved sample. To enhance training efficiency and reduce query costs, we introduce a learnable dynamic ranking threshold, adjusted when the model encounters negative prediction shifts. Experimental results on various question-answering datasets from different domains show that our method outperforms the best baseline by 2.76%, with a notable 5.96% boost in accuracy on long-tail questions that elude zero-shot inference. Our code is available at https://github.com/Yu-shuyan/uncertian_ranker

Download the paper.

Concept only. This work is in concept phase and may never become a product. Not for Sale. Any reported results are preliminary and subject to change.  Not cleared or approved by the U.S. FDA or any other global regulator for commercial availability.

Share