FSRS, the 21-parameter memory model for scheduling Anki reviews, and how to evaluate it: analysis
Transcript · Report with the audio
Bai, a machine learning engineer, explains FSRS, a 21-parameter model that predicts when an Anki user will forget a flashcard and schedules the next review (Bai 0:00). He contrasts it with SM-2, Anki’s default algorithm, which uses hand-picked constants and can trap cards in “ease hell” (Bai 1:35; Bai 3:10). He then covers the FSRS forgetting curve, the stability and difficulty state it keeps for each card, how it is trained, and the Anki revlogs benchmark (Bai 4:46; Bai 6:19; Bai 8:02). FSRS beats SM-2 on log loss, and a 2-million-parameter RWKV model tops the leaderboard. Bai argues that predicting recall well is not the same as scheduling well (Bai 9:35; Bai 10:28). He ends on non-identifiability and runaway intervals, and says only an A/B test could settle which scheduler is better, which is not feasible given how Anki operates (Bai 11:17; Bai 13:01).
People
- Bai (100.0% of talking time, 2,699 words): The only speaker. A machine learning engineer with a PhD in natural language processing, presenting a solo explainer video (Bai 0:00). He likes that FSRS learns its parameters and that many of them can be read directly, but he is careful about evaluation. He argues that winning on log loss does not prove FSRS is the better scheduler (Bai 10:28; Bai 12:06). He states the caveats behind headline claims, such as SM-2 not producing probabilities (Bai 9:35).
Chapters
- Intro: Anki and how cards are reviewed [0:00]. Bai introduces a 21-parameter neural model inside the Anki flashcard app and gives his background (Bai 0:00). Anki has been open source since 2006 and is popular for language learning and medical school (Bai 0:00; Bai 0:47). Each card has a front and a back, and the user grades each review as Again, Hard, Good or Easy (Bai 0:47).
- SM-2 and its problems [1:35]. SM-2 dates from the late 1980s and gives each card an ease that starts at 250%. The next interval is the current interval times the ease. A lapse resets the interval to one day and cuts ease by 20 points, and ease never drops below 1.3 (Bai 0:47; Bai 1:35). Bai describes “ease hell”: early lapses push ease down, only the Easy button raises it again, and the card stays stuck on short intervals (Bai 2:24). The constants were picked by hand, are the same for everyone, and have only been patched by community hacks (Bai 3:10).
- How FSRS models memory [3:57]. FSRS came from the Chinese app MaiMemo. In Anki it is an experimental opt-in setting, and SM-2 stays the default (Bai 3:57). It models a forgetting curve, an exponential decay set by stability. The user’s desired retention, for example 90%, decides when the next review is due (Bai 4:46; Bai 5:33). Each card’s state is a stability and difficulty pair, which the model updates like a recurrent network cell from the button pressed and the time since the last review (Bai 5:33; Bai 6:19).
- Training and the dataset [7:11]. The model never reads card text. It sees only the sequence and timing of button presses (Bai 7:11). Training uses backpropagation through time on the pass/fail log likelihood with the Adam optimizer, and is cheap enough to run on a phone (Bai 7:11). Many parameters can be read directly; the first four are the initial stabilities for each button. Users can keep the defaults or optimize on their own reviews (Bai 8:02). The Anki revlogs dataset holds anonymized review histories from 10,000 users, each with at least 5,000 reviews (Bai 8:02).
- Benchmark results and RWKV, the leaderboard leader [8:49]. Models are scored mainly on log loss, with AUC as a secondary metric. The test set is split by user and by a time cutoff (Bai 8:49). FSRS is on its seventh version. SM-2 ranks below even the constant baseline, but it predicts intervals rather than probabilities, so the comparison is not direct (Bai 9:35). RWKV, with over 2 million parameters, ranks first but is too large for phones, and some variants produce no forgetting curve, so they cannot schedule cards (Bai 9:35; Bai 10:28).
- Prediction versus scheduling: non-identifiability and evaluation [10:28]. Bai argues the benchmark scores recall prediction on fixed reviews, while what matters is whether a scheduler saves study time (Bai 10:28; Bai 11:17). His example is a card passed after gaps of 3 and 12 days. A next interval of 40 days and one of 3 years both fit the data, because almost no users have gaps that long. This is non-identifiability, and some users see it as runaway schedules after optimizing (Bai 11:17; Bai 12:06). Simulations show a smaller gap between SM-2 and FSRS, but the simulator is trained on the same data, so the argument is circular. An A/B test would settle it but is not feasible for Anki, so log loss remains the proxy metric (Bai 13:01).
- Closing [13:46]. Bai concludes that even a very simple model raises real problems in edge case handling and evaluation, and asks viewers to like and subscribe (Bai 13:46).
Follow-ups
- Bai asks viewers to like the video, subscribe and watch his other videos (Bai 13:46).
- Bai proposes an A/B test to compare schedulers: randomly assign users to SM-2 or FSRS, then measure how much they retained against how much they studied. He says this is not feasible given how Anki operates (Bai 13:01).
Open threads
- Should FSRS become Anki’s default? It beats SM-2 for 98% of users on log loss, but that metric does not fully match scheduling quality in real use, so it stays opt-in (Bai 12:06). (Bai 9:35)
- Non-identifiability: nothing in the data rules out very long intervals, so a model optimized on a user’s own reviews can schedule cards years ahead. Bai describes no fix (Bai 11:17; Bai 12:06).
- Should FSRS optimize automatically? Most users don’t know the optimize feature exists (Bai 12:06).
- No trustworthy offline measure of scheduler effectiveness exists. Simulators are trained on the same data, which makes them circular, and A/B tests are not feasible (Bai 13:01).
- SM-2 outputs intervals, not probabilities, so its place on the log loss leaderboard is not a direct comparison (Bai 9:35).
- Bai calls the model a twenty-one-parameter model at the start and a twenty-parameter model later (Bai 0:00; Bai 10:28).
Mentions
- Anki (tool): Flashcard app, open source since 2006, and the setting for the whole video (Bai 0:00; Bai 0:47).
- SM-2 (tool): Anki’s default scheduling algorithm, from the late 1980s and built on hand-picked constants. Bai criticizes it (Bai 0:47; Bai 1:35; Bai 3:10). (Bai 9:35)
- FSRS (tool): Free Spaced Repetition Scheduler, the 21-parameter memory model. It is an experimental opt-in setting in Anki and is on its seventh version (Bai 3:57; Bai 9:35). (Bai 12:06)
- MaiMemo (tool): Chinese flashcard app where FSRS was first used (transcribed as “My Memmory”). Its authors published papers on the model (Bai 3:57).
- Anki revlogs dataset (work): Freely downloadable, anonymized review histories from 10,000 users, used to train and benchmark models (Bai 8:02).
- RWKV (tool): Model with over 2 million parameters that tops the benchmark but is impractical as a scheduler (Bai 9:35; Bai 10:28).
- Adam optimizer (tool): Optimizer used with gradient descent to train FSRS (Bai 7:11).
- Ease hell (other): SM-2 failure where early lapses leave a card stuck at minimum ease and short intervals (Bai 2:24). (Bai 1:35)
- Non-identifiability (other): Different forgetting curves fit the same data equally well but give very different intervals (Bai 11:17). (Bai 12:06)
Quotes
I’m going to talk about a small one that has just twenty-one parameters
Bai 0:00. Introduces the subject: a tiny neural model inside a flashcard app.
So you can see it’s pretty simple, but it has a bunch of magic constants that aren’t really explained.
Bai 1:35. Bai’s main criticism of SM-2.
So this gives the user a knob of how much I want to study.
Bai 5:33. Desired retention trades study load against how much the user remembers.
It’s worth noting that the algorithm does not look at the card’s text at all.
Bai 7:11. FSRS works only from review timing and button presses.
Well, actually, this model is, uh, very good at predicting if a user is going to, uh, remember or forget a card, but it’s pretty terrible as a scheduler.
Bai 9:35. Why RWKV, the leaderboard leader, is not used.
The best model on the leaderboard is not necessarily the best model in practice.
Bai 10:28. The video’s main lesson about evaluation.
This problem is known as non-identifiability.
Bai 11:17. Names the cause of runaway long intervals.
the scheduler starts to schedule cards many years into the future
Bai 12:06. What some FSRS users report after optimizing on their own data.
So really, the only way to settle this is some sort of A/B test.
Bai 13:01. Bai’s view on how to measure scheduler quality.
Despite being such a simple model, it poses some real challenges in edge case handling and model evaluation.
Bai 13:46. Bai’s closing summary.
Statistics
Computed from the times of the transcript’s words. A turn runs until someone else takes the floor. A backchannel, a reply of at most 3 words and 1.5 s such as “yeah” or “mm-hmm” after which the speaker before it carries on, does not take the floor. The pause before speaking runs from the previous speaker’s last word to this speaker’s first.
| Bai | |
|---|---|
| Talking time | 13:54 |
| Share of talking time | 100.0% |
| Words | 2,699 |
| Words per minute | 194 |
| Turns | 1 |
| Median turn | 841.4 s |
| Longest turn | 841.4 s |
| Backchannels | 0 |
| Median pause before speaking |
Handovers. Each cell counts how often the row’s speaker was followed directly by the column’s.
| Bai | |
|---|---|
| Bai | 0 |
The floor changed hands 0 times, 0.0 times a minute on average, and most often at 0:00, 0 times in that minute. The longest silence is 0.0 s, at 0:00.