Short Answer

Memory Usage Comparison: Recursive vs. Naive Cumulative Average

Consider two methods for calculating the cumulative average of key-value pairs for a memory component in a sequence of length 'N'.

  • Method A: Uses a recursive formula, updating the average at each step based only on the previous step's average and the current key-value pair.
  • Method B: Re-calculates the average at each step by summing all key-value pairs from the beginning of the sequence up to the current step.

Analyze and compare the memory storage requirements for both methods as 'N' becomes very large. Which method is more memory-efficient and why?

0

1

Updated 2025-10-06

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

Analysis in Bloom's Taxonomy

Cognitive Psychology

Psychology

Social Science

Empirical Science

Science