Formula

Formula for Memory as a Cumulative Average of Keys and Values

The cumulative average of the keys and values for a memory component (Mem\mathrm{Mem}) is formulated as a tuple containing the cumulative average of key vectors (kj\mathbf{k}_j) and value vectors (vj\mathbf{v}_j) up to a given index ii. This is achieved by summing all vectors from the start of the sequence (index j=0j=0) to the current index ii, and then normalizing by the total number of elements, i+1i+1. The mathematical representation is: Mem=(j=0ikji+1,j=0ivji+1)\mathrm{Mem} = \Big( \frac{\sum_{j=0}^{i} \mathbf{k}_j}{i+1}, \frac{\sum_{j=0}^{i} \mathbf{v}_j}{i+1} \Big)

Image 0

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