paper-with-me

홈 › Papers

$k$NN Prompting: Beyond-Context Learning with Calibration-Free Nearest Neighbor Inference

2023-03-24 · Benfeng Xu, Quan Wang, Zhendong Mao, Yajuan Lyu, Qiaoqiao She, Yongdong Zhang

In-Context Learning (ICL), which formulates target tasks as prompt completion conditioned on in-context demonstrations, has become the prevailing utilization of LLMs. In this paper, we first disclose an actual predicament for this typical usage that it can not scale up with training data due to context length restriction. Besides, existing works have shown that ICL also suffers from various biases and requires delicate calibration treatment. To address both challenges, we advocate a simple and effective solution, $k$NN Prompting, which first queries LLM with training data for distributed representations, then predicts test instances by simply referring to nearest neighbors. We conduct comprehensive experiments to demonstrate its two-fold superiority: 1) Calibration-Free: $k$NN Prompting does not directly align LLM output distribution with task-specific label space, instead leverages such distribution to align test and training instances. It significantly outperforms state-of-the-art calibration-based methods under comparable few-shot scenario. 2) Beyond-Context: $k$NN Prompting can further scale up effectively with as many training data as are available, continually bringing substantial improvements. The scaling trend holds across 10 orders of magnitude ranging from 2 shots to 1024 shots as well as different LLMs scales ranging from 0.8B to 30B. It successfully bridges data scaling into model scaling, and brings new potentials for the gradient-free paradigm of LLM deployment. Code is publicly available.

📄 PDF Abstract BibTeX arXiv:2303.13824

Code (1)

benfengxu/knnprompting 공식 구현 pytorch

Tasks

In-Context Learning

Methods 이 논문이 사용한 방법론

Test 설명 없음
ALIGN In the ALIGN method, visual and language representations are jointly trained from noisy image alt-text data. The image and text encoders are learned via contrastive loss…

Similar Papers 제목 키워드 기반

Calibrate to Discriminate: Improve In-Context Learning with Label-Free Comparative Inference

2024-10-03 · Wei Cheng, Tianlu Wang, Yanmin Ji, Fan Yang 외

While in-context learning with large language models (LLMs) has shown impressive performance, we have discovered a unique miscalibration behavior where both correct and incorrect predictions are assigned the same level o…

In-Context Learning

Fact-and-Reflection (FaR) Improves Confidence Calibration of Large Language Models

2024-02-27 · Xinran Zhao, Hongming Zhang, Xiaoman Pan, Wenlin Yao 외

For a LLM to be trustworthy, its confidence level should be well-calibrated with its actual performance. While it is now common sense that LLM performances are greatly impacted by prompts, the confidence calibration in p…

Common Sense ReasoningQuestion Answering

Token-based Decision Criteria Are Suboptimal in In-context Learning

2024-06-24 · Hakaze Cho, Yoshihiro Sakai, Mariko Kato, Kenshiro Tanaka 외

In-Context Learning (ICL) typically utilizes classification criteria from output probabilities of manually selected label tokens. However, we argue that such token-based classification criteria lead to suboptimal decisio…

ClassificationIn-Context Learning

N2C2: Nearest Neighbor Enhanced Confidence Calibration for Cross-Lingual In-Context Learning

2025-03-12 · Jie He, Simon Yu, Deyi Xiong, Víctor Gutiérrez-Basulto 외

Recent advancements of in-context learning (ICL) show language models can significantly improve their performance when demonstrations are provided. However, little attention has been paid to model calibration and predict…

Cross-Lingual Sentiment ClassificationIn-Context LearningPredictionSentiment Analysis+1

Distribution-free uncertainty quantification for classification under label shift

2021-03-04 · Aleksandr Podkopaev, Aaditya Ramdas

Trustworthy deployment of ML models requires a proper measure of uncertainty, especially in safety-critical applications. We focus on uncertainty quantification (UQ) for classification problems via two avenues -- predict…

ClassificationConformal PredictionGeneral ClassificationPrediction+1