anki-rwkv · factory overview · model architectures · R01 campaign · 8k/2k run · data quality

Predicting memory with RWKV

RWKV is a recurrent network: it reads your Anki reviews one at a time and keeps a small, fixed-size memory for every card, note, deck, preset and you. From that memory it predicts how likely you are to remember a card after any delay. This page shows how, step by step.

1. One history, five timelines

A made-up user reviewing five cards over two weeks. Each square is one review, coloured by card, with the grade inside (A = Again, H = Hard, G = Good, E = Easy). Pick a stream to see which reviews it links together, then click a review.

2. The memory: a small matrix that learns while it reads

Inside each stream, every head keeps a state matrix S. Each review writes a value at a key; a later review reads the matrix with its own receptance vector and gets back what was stored near it. This toy uses 4×4 instead of 32×32 and four slightly overlapping keys, one per card, and reads each card back with its own key.

State S (rows: value dims, columns: key dims)

Reading each card’s key back

Bars: what S returns for that key. Black ticks: the last value written for it. Right: the error.

3. From memory to a forgetting curve

The output head does not predict a single number. It predicts a whole forgetting curve, built as a weighted mix of simpler curves. The models on this site build that mix in two different ways; switch between them. Hover the chart to read a probability.

 

Each basis curve is an exponential decay 0.9t / s with a fixed stability s; the model only chooses the weights. Drag the bars to set them (they are normalised to sum to 1), or try a preset. Mixing fast and slow curves gives a long tail that a single exponential cannot: a card can be partly forgotten within a day yet keep a stable core for months. The real heads use 128 (Alex) or 64 (the older compact-model iter36 config trained in this repository) basis curves from 0.1 s to about 100 years, and add a learned correction at the same number of time points. The compact model from outside research does not work this way: see the learned power-law curves.

Either way, a separate Instant head predicts the four grades for the review that is about to happen.

Putting it together