Skip to main content

Command Palette

Search for a command to run...

How Anki's Algorithm Works

In Plain English

Updated
3 min read
How Anki's Algorithm Works

Anki is a flashcard program I heavily use for work. To me, the default settings provided by Anki are not optimal for studying medicine so I spent a lot of time wandering around the internet and getting my feet wet with different setting combinations used by other people. It didn't take that much time to hit me that Anki settings are subjective hence the best way to optimise the program for my study patterns is to understand how the algorithm actually works under the hood.

Anki uses a modified version of an algorithm called supermemo-2 (read the spec here - added that for completeness but the way it is presented makes it really hard to comprehend )

Let's begin.

Learning vs Graduated Cards

First line one has to draw lies between Learning and Graduated states. Anki's algorithm only applies to graduated cards. "Graduation" is simply when the user presses "Good" or "Easy" on a "Learning" card a certain number of times as defined in deck options and Anki moves it from the "Learning" state to "Graduated" state. ie: learnt and needs review.

Graduation interval is a setting the user can tweak in the deck settings page. For an example if I change graduation interval to, 1m 10m Anki would show me the card in the learning phase one time. If I press "good" it will show it to me in 10 minutes and If I press "good" again it will move the card from the "Learning" state to "Graduated" state. Pressing "again" will show me the card every 1 minute until I press a different button. From Anki v2.1 pressing "hard" will repeat the same step but the interval would be between 1 and 10 minutes and you can tweak it as you wish by tweaking "Hard Interval" setting. This value would decide how close the "hard" interval should be relative to the current interval step the card is on.

Graduating Interval

Another important setting is the graduation interval. When a card graduates Anki assigns this interval to it. Which means you will first see the card after this interval has passed.

For an example if I give a graduation interval of 10d Anki will show my newly graduated card to me again in 10 days.

After that. When you press "good" it will generate the new interval using the following formula

new interval = graduating interval * interval modifier * small random number * starting ease The small random number changes a bit to make sure your brain does not associate two cards in the same note with each other. ( This is specially useful in cloze based cards) The default starting ease is 250%.

Relapsing

If you press "hard" or "again" on a graduated card it will be considered a lapse and moved into the re-learning cue. Re-learning cue has it's own set of intervals the user can tweak, just like the learning cue and it would reduce 20% and 15% for "Again" and "Hard" cards, respectively. ( This is for the v1 scheduler - actual values may differ but the concept remains the same)

See, the only way to change the starting ease is by pressing either "hard", "again" or "easy" on a graduated card. Pressing "Again" or "Hard" on cards that are in learning or re-learning cues won't affect the ease value at all.

Easy

This is the most confusing button in Anki (At least for me) Easy button would ignore all the learning OR relearning steps (depending on the current state of the card) and graduate your card in one go. It would also add an "easy bonus" to the starting ease and make the card appear for reviews less frequently.

I think this helps anyone who wants to know about how Anki works under the hood. Thanks for reading :)