Learn Before
Concept

k-NN as a Popular Retrieval-Based External Memory Method

The kk-nearest neighbors (kk-NN) algorithm is a popular retrieval-based method for implementing external memory. It operates by creating a datastore of key-value pairs, with each pair representing a specific context state. The concept of 'context' is flexible and not restricted to a single sequence's history; it can be as broad as an entire dataset. This allows for retrieving the most relevant context from a large collection of sequences, not just the current one. When presented with a new query, the model uses kk-NN to find the most similar context representations from the datastore to enhance its predictions.

Image 0

0

1

Updated 2026-04-23

Contributors are:

Who are from:

Tags

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences