Visualizers

Learn by moving things

Interactive explainers for the ideas behind retrieval, embeddings, and agents. A formula tells you what is true; dragging a vector shows you why. Each one also appears inside the article it belongs to, and runs entirely in your browser, so drag, poke, and break it.

Portrait of Sachin Gupta rendered in binary

A tiny 4-slot cache, like a small desk. Touch an item and it moves to the front; when a new item arrives and the desk is full, the one untouched longest goes back on the shelf.

LRU: a full cache forgets the coldestauto
accessing-
most recentleast recent (evicted first)

A 4-slot cache. Watch it fill, then evict the least recently used to make room.

A 4-slot cache that ranks by use-count, not recency. Every access bumps an item's count; when it fills, the least-used item leaves, so an old-but-popular item outlives a fresh newcomer.

LFU: the least-used item leavesauto
accessing-
ranked by use count, not by recencylowest count leaves first

A 4-slot cache that ranks items by how many times each has been used. Watch it fill, then drop the least used.

Every item carries a countdown timer. Each tick all timers drop; when one hits zero the item expires and leaves, no matter how recently or often it was used. Age decides, not access.

TTL: items expire on a timerauto
tick: every timer counts down
A4s left
B3s left
C2s left
D5s left
expiry is about age, not use: the timer decides, not the last read

Every item carries a timer. Each tick all timers count down; when one hits zero it expires and leaves, whatever else is true about it.

Visualizers — Sachin Gupta