English
Related papers

Related papers: Generalization through Memorization: Nearest Neigh…

200 papers

Large language models (LLMs) often hallucinate and lack the ability to provide attribution for their generations. Semi-parametric LMs, such as kNN-LM, approach these limitations by refining the output of an LM for a given prompt using its…

Computation and Language · Computer Science 2025-04-28 Minghan Li , Xilun Chen , Ari Holtzman , Beidi Chen , Jimmy Lin , Wen-tau Yih , Xi Victoria Lin

Speech recognition performance varies by language, domain, and speaker characteristics such as accent, but fine-tuning a model on any of these categories may lead to catastrophic forgetting. Token-level $k$ nearest neighbor search ($k$NN),…

Computation and Language · Computer Science 2025-02-12 Maya K. Nachesa , Vlad Niculae

Interpretability techniques in NLP have mainly focused on understanding individual predictions using attention visualization or gradient-based saliency maps over tokens. We propose using k nearest neighbor (kNN) representations to identify…

Computation and Language · Computer Science 2020-10-20 Nazneen Fatema Rajani , Ben Krause , Wengpeng Yin , Tong Niu , Richard Socher , Caiming Xiong

As large language models (LLMs) grow in scale and specialization, routing--selecting the best model for a given input--has become essential for efficient and effective deployment. While recent methods rely on complex learned routing…

Machine Learning · Computer Science 2026-05-18 Yang Li

Pretraining Neural Language Models (NLMs) over a large corpus involves chunking the text into training examples, which are contiguous text segments of sizes processable by the neural architecture. We highlight a bias introduced by this…

Computation and Language · Computer Science 2022-03-22 Yoav Levine , Noam Wies , Daniel Jannai , Dan Navon , Yedid Hoshen , Amnon Shashua

Capturing symmetric (e.g., country borders another country) and antisymmetric (e.g., parent_of) relations is crucial for a variety of applications. This paper tackles this challenge by introducing a novel Wikidata-derived natural language…

Computation and Language · Computer Science 2025-04-24 Zhangdie Yuan , Andreas Vlachos

Nearest neighbor machine translation is a successful approach for fast domain adaption, which interpolates the pre-trained transformers with domain-specific token-level k-nearest-neighbor (kNN) retrieval without retraining. Despite kNN MT's…

Artificial Intelligence · Computer Science 2024-08-20 Hossam Amer , Abdelrahman Abouelenin , Mohamed Maher , Evram Narouz , Mohamed Afify , Hany Awadallah

Contextual embeddings represent a new generation of semantic representations learned from Neural Language Modelling (NLM) that addresses the issue of meaning conflation hampering traditional word embeddings. In this work, we show that…

Computation and Language · Computer Science 2019-06-25 Daniel Loureiro , Alipio Jorge

Neural machine translation has achieved promising results on many translation tasks. However, previous studies have shown that neural models induce a non-smooth representation space, which harms its generalization results. Recently, kNN-MT…

Computation and Language · Computer Science 2023-06-13 Wenhao Zhu , Jingjing Xu , Shujian Huang , Lingpeng Kong , Jiajun Chen

Pre-trained language models (PLMs) have exhibited remarkable few-shot learning capabilities when provided a few examples in a natural language prompt as demonstrations of test instances, i.e., in-context learning. However, the performance…

Computation and Language · Computer Science 2022-12-06 Feng Nie , Meixi Chen , Zhirui Zhang , Xu Cheng

Multimodal models leverage large-scale pre-training to achieve strong but still imperfect performance on tasks such as image captioning, visual question answering, and cross-modal retrieval. In this paper, we present a simple and efficient…

Computer Vision and Pattern Recognition · Computer Science 2024-11-01 Neil Chowdhury , Franklin Wang , Sumedh Shenoy , Douwe Kiela , Sarah Schwettmann , Tristan Thrush

The problem of finding K-nearest neighbors in the given dataset for a given query point has been worked upon since several years. In very high dimensional spaces the K-nearest neighbor search (KNNS) suffers in terms of complexity in…

Machine Learning · Computer Science 2021-02-15 Pramod Vadiraja , Christoph Peter Balada

K-Nearest Neighbor Neural Machine Translation (kNN-MT) successfully incorporates external corpus by retrieving word-level representations at test time. Generally, kNN-MT borrows the off-the-shelf context representation in the translation…

Computation and Language · Computer Science 2023-09-20 Qiang Wang , Rongxiang Weng , Ming Chen

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…

Computation and Language · Computer Science 2023-03-27 Benfeng Xu , Quan Wang , Zhendong Mao , Yajuan Lyu , Qiaoqiao She , Yongdong Zhang

Relation extraction (RE) has achieved remarkable progress with the help of pre-trained language models. However, existing RE models are usually incapable of handling two situations: implicit expressions and long-tail relation types, caused…

Computation and Language · Computer Science 2023-01-31 Zhen Wan , Qianying Liu , Zhuoyuan Mao , Fei Cheng , Sadao Kurohashi , Jiwei Li

Though nearest neighbor Machine Translation ($k$NN-MT) \citep{khandelwal2020nearest} has proved to introduce significant performance boosts over standard neural MT systems, it is prohibitively slow since it uses the entire reference corpus…

Computation and Language · Computer Science 2022-11-23 Yuxian Meng , Xiaoya Li , Xiayu Zheng , Fei Wu , Xiaofei Sun , Tianwei Zhang , Jiwei Li

Large margin nearest neighbor (LMNN) is a metric learner which optimizes the performance of the popular $k$NN classifier. However, its resulting metric relies on pre-selected target neighbors. In this paper, we address the feasibility of…

Data Structures and Algorithms · Computer Science 2018-05-03 Babak Hosseini , Barbara Hammer

This paper presents a hybrid system for intuitive item similarity search that combines a Large Language Model (LLM) with a custom K-Nearest Neighbors (KNN) algorithm. Unlike black-box dense vector systems, this architecture provides…

Information Retrieval · Computer Science 2025-09-29 Ana Rodrigues , João Mata , Rui Rego

Non-parametric, k-nearest-neighbor algorithms have recently made inroads to assist generative models such as language models and machine translation decoders. We explore whether such non-parametric models can improve machine translation…

Computation and Language · Computer Science 2023-05-24 Jiayi Wang , Ke Wang , Yuqi Zhang , Yu Zhao , Pontus Stenetorp

In Natural Language Processing (NLP), finding data augmentation techniques that can produce high-quality human-interpretable examples has always been challenging. Recently, leveraging kNN such that augmented examples are retrieved from…

Computation and Language · Computer Science 2021-06-03 Ehsan Kamalloo , Mehdi Rezagholizadeh , Peyman Passban , Ali Ghodsi