Revisiting k-NN for Fine-tuning Pre-trained Language Models
Not on the map. Why?
Abstract (arXiv)
Pre-trained Language Models (PLMs), as parametric-based eager learners, have become the de-facto choice for current paradigms of Natural Language Processing (NLP). In contrast, k-Nearest-Neighbor (kNN) classifiers, as the lazy learning paradigm, tend to mitigate over-fitting and isolated noise. In this paper, we revisit kNN classifiers for augmenting the PLMs-based classifiers. From the methodological level, we propose to adopt kNN with textual representations of PLMs in two steps: (1) Utilize kNN as prior knowledge to calibrate the training process. (2) Linearly interpolate the probability distribution predicted by kNN with that of the PLMs' classifier. At the heart of our approach is the implementation of kNN-calibrated training, which treats predicted results as indicators for easy versus hard examples during the training process. From the perspective of the diversity of application scenarios, we conduct extensive experiments on fine-tuning, prompt-tuning paradigms and zero-shot, few-shot and fully-supervised settings, respectively, across eight diverse end-tasks. We hope our exploration will encourage the community to revisit the power of classical methods for efficient NLP. Code and datasets are available in https://github.com/zjunlp/Revisit-KNN.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 23 of its 33 references that are in the map. First posted on arXiv 18 Apr 2023.
Builds on
23 of 33 references.
References · 23
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
- 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,140
- 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,255
- 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
- 2020Nearest Neighbor Machine Translationcited by 209
- 2019SimpleShot: Revisiting Nearest-Neighbor Classification for Few-Shot Learningcited by 194
- 2021KnowPrompt: Knowledge-aware Prompt-tuning with Synergistic Optimization for Relation Extractioncited by 180
11 more
- 2019Text Classification Algorithms: A Surveycited by 163
- 2020Reasoning with Latent Structure Refinement for Document-Level Relation Extractioncited by 97
- 2020TACRED Revisited: A Thorough Evaluation of the TACRED Relation Extraction Taskcited by 96
- 2021Efficient Nearest Neighbor Language Modelscited by 93
- 2022Neuro-Symbolic Language Modeling with Automaton-augmented Retrievalcited by 60
- 2020BERT-kNN: Adding a kNN Search Component to Pretrained Language Models for Better QAcited by 36
- 2021GNN-LM: Language Modeling based on Global Contexts via GNNcited by 27
- 2022kNN-Prompt: Nearest Neighbor Zero-Shot Inferencecited by 27
- 2018A Simple Cache Model for Image Recognitioncited by 20
- 2022Reasoning Through Memorization: Nearest Neighbor Knowledge Graph Embeddingscited by 12
- 2021KNN-BERT: Fine-Tuning Pre-Trained Models with KNN Classifiercited by 7
Built on by
Not cited yet.