Nowadays, running your own LLM can be very handy in some situations, so learning more deeply about it would be beneficial.

One such concept is KV Caching.

In this article, I will show what KV Caching is.

What is KV Caching?

KV caching, which is short for Key-Value Caching, is a key optimization technique used in LLMs.

The highlight of this is that it makes text generation much faster.

The problem that KV caching solves

LLMs generate text one token at a time. (A token is roughly a word or part of a word.)

They use a part of the transformer architecture called the attention.

It is basically where the model looks back at all the previous tokens to decide the next one.

Without KV Caching

  • For each new token, the model would recompute attention over the en…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help