AI Paper Atlas

Research map / Large language models / Language, safety and interpretability

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

Benfeng Xu, Quan Wang, Zhendong Mao, Yajuan Lyu, Qiaoqiao She, Yongdong Zhang

ICLR 2023Large language models › Language, safety and interpretabilityapproach: In-context learning analysis12 citations (OpenAlex)

University of Science and Technology of China · Beijing University of Posts and Telecommunications

Read the paperPlace an idea next to itCheck your own paper ↗

9measured effects
6improved
2hurt
1mixed

AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add kNN Prompting (anchor datastore + KL-based nearest neighbor prediction) instead of standard ICLGPT2 XL, few-shot m=8 · 6 tasks, few-shot m=8AVG accuracy: +13.86Improved
Use kNN Prompting instead of Noisy Channel calibrationGPT2 XL, few-shot m=8 · 6 tasks, few-shot m=8AVG accuracy: +7.07Improved
Scale training data to 128 shots with kNN Prompting instead of ICL EnsembleGPT2 0.8B, low resource m=128 · 10 tasks, m=128AVG accuracy: +16.08Improved
Increase model scale for kNN Prompting above 6BkNN Prompting vs finetuning (GPT Large FT) · 10 tasks, m=128AVG accuracyImproved
Scale demonstration/anchor data from 32 to 1024 shots with kNN PromptingGPT2 0.8B to OPT 30B · 10 tasks, m=32 to m=1024AVG accuracy: +13.58 over ICL at 32 shots (0.8B)Improved
Mask non-label words so only label-word probabilities are used (Partial) instead of full LM distribution (ablation)kNN Prompting, GPT2 XL, few-shot · 6 tasks, m=8AVG accuracy: -4.21Hurt
Replace full LM distribution with contextual representation and L2 distance (ablation)kNN Prompting, GPT2 XL, 10 tasks · 10 tasks, m=128 analysisAVG accuracy: -1.57Hurt
Use averaged centered anchors per class (normalization trick)kNN Prompting under imbalanced label scenario · SST2 imbalancedaccuracyMixed
Compare kNN Prompting against demonstration selection (PromptCompose) approacheskNN Prompting vs retrieval-based prompt composition · full resultsaccuracyImproved

Later papers that compared with this method

1 later accepted paper reports kNN Prompting as a baseline in their results tables; 1 of them report a better number on most of the results they share with it.

Matched by method name in results tables read by AI. Authors' own tables tend to favour the newer method, and a comparison can be missed when a method is renamed.

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy