Activity (Process)

k-NN Memory Retrieval

In the kk-nearest neighbors (kk-NN) retrieval process, a datastore of key-value pairs, kj\mathbf{k}_j and vj\mathbf{v}_j, is maintained, often within a vector database. For a given query qi\mathbf{q}_i, the system identifies its kk nearest neighbors from the set of keys by conceptually expanding a sphere centered at qi\mathbf{q}_i until it encompasses exactly kk data points in kj\mathbf{k}_j. This search results in a retrieved long-term memory set, denoted as Memknn\mathrm{Mem}_{k\mathrm{nn}}, which contains the kk keys along with their corresponding values.

0

1

Updated 2026-05-02

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

Related