guevara / read-it-later

read it later
226 stars 0 forks source link

Anki SRS Algorithm #9166

Open guevara opened 1 year ago

guevara commented 1 year ago

Anki SRS Algorithm

https://ift.tt/1PzRp75

Julien Sobczak

The SM-2 algorithm, on which Anki is based, was released in 1987 in SuperMemo 1.0. It was revised several times since:

Each version iterates over deficiencies of the previous one. You can find a short summary of the main changes or a (very) long summary of the history of SuperMemo. The short version is probably too terse to understand the improvements, and the long version is probably too detailed to understand everything. (It took me more than 5 hours to read it but it was worth the reading!)

SuperMemo 2 was great. Its simple algorithm has survived in various mutations to this day in popular apps such as Anki or Mnemosyne. However, the algorithm was dumb in the sense that there was no way of modifying the function of optimum intervals. The findings of 1985 were set in stone. Memory complexity and stability increase were expressed by the same single number: E-factor. It is a bit like using a single lever in a bike to change gears and the direction of driving.

— Piotr Wozniak
Original author of SuperMemo

From a high-level perspective, the main motivation for every version is to determine better optimal intervals (= the ideal periods between reviews of a single card) so that the forgetting index is close to 10% (= recall of 90% is acceptable).

From a low-level perspective, several approaches were experimented by SuperMemo. The first major version (SM-2) introduced the ease factor to capture the difficulty of an item (the lower the ease factor = the more difficult = the shorter the interval). The ease factor was multiplied by the previous interval to determine the next interval.

The successive iterations become more and more elaborate by adding new dimensions, in particular, what is called by SuperMemo the two-component model: stability and retrievability (in complement to difficulty represented by the E-Factor). Stability tells you how long a piece of knowledge can last in memory. Retrievability tells you how easy it is to recall a piece of knowledge. These notions may appear similar but they aren’t. "If you take two memories right after a review, one with a short optimum interval, and the other with a long optimum interval, the memory status of the two must differ," declares Piotr Wozniak, "Both can be recalled perfectly (maximum retrievability) and they also need to differ in how long they can last in memory (different stability)."

What follows is an example of the optimum factors (OF) matrix used in SM-4/SM-5. The matrix ignores the retrievability dimension, which was introduced in SM-6.

A two-dimensional matrix is easier to represent but the logic is similar with more dimensions. Initially, the matrix was defined based on prior measurements in SuperMemo. After each answer, the grade tells SuperMemo how well the interval "performed." If the grade is low, the interval was too long. If the grade is high, the interval was too short. The entry in the matrix is updated in consequence and matrix smoothing is applied (= if a value increases, a smaller increase can be beneficial to neighbors too).

The two-component model of long-term memory still represents the foundation of SuperMemo since its introduction in SM-4 in 1989. Piotr Wozniak was pessimistic about a better, faster, and more effective algorithm as soon as 1994. The versions of the algorithm that appeared after that didn’t introduce a breakthrough improvement like SuperMemo did when it abandoned the SM-2 algorithm in 1989, the same algorithm that keeps popping up in new applications.

"New" Applications

Many applications relying on SRS appeared in popular app stores more or less recently: Quizlet, Memrise, Duolingo, LingoDeer, Brainscape, Lingvist, Chegg, RemNote, Mochi, Memcode, …​

  • Mochi's algorithm is very simple. The card interval is doubled after each correct answer, and cut in half otherwise.

  • Memrise's algorithm is similar to Mochi's. The card interval increases using the following steps: 4 hours, 12 hours, 24 hours, 6 days, 12 days, 48 days, 96 days, and 6 months. Any wrong answer moves back the card to the first interval.

  • Quizlet’s algorithm has known several iterations. The first implementation simply repeats all the questions you got wrong. The second implementation is similar to Anki where the card interval increases by approximately 2.2 and wrong answers reset the interval to one day. The next implementation relies on machine learning and uses the millions of answers to determine the recall probability, which is the chance you answer correctly. This allows, for example, to reduce the interval for words with irregular spellings when learning a foreign language.

  • Duolingo's algorithm is similar to Quizlet. Duolingo has millions of students who generate billions of statistics about language learning every day. Like Quizlet, Duolingo uses machine learning to predict how likely you are to remember any given word at any time. This is represented by the strength meter (still strong, pretty good, time to practice, overdue) below every lesson.

  • RemNote’s algorithm is customizable like Anki and most settings will look familiar to Anki users, especially after following this tutorial.

  • Memcode’s algorithm also uses SM-2.

In my opinion, Anki is not perfect but there is no need to focus too much on optimizing it:

  • Adding more dimensions? What if you review inadvertently a card, for example when explaining the idea to a coworker. No algorithm can exploit this and postpone the next review. No algorithm will ever be perfect.

  • Using machine learning? Applying the lessons from other learners is great for common datasets. For example, if most French users have trouble learning a particular English word, chances are future French users will need shorter intervals too. But what about custom-edited cards about subjects such as science, management, and parenting. What about your interest in any of these subjects. We remember more easily what passionates us. Machine learning excels when there are patterns but learning is profoundly a personal, unique experience.

Therefore, I think we should focus more on optimizing our practices rather than the tools. Here are two key practices:

  • Devote time to understand. Learning is a 3-steps process: encoding, storage, and retrieval. Anki helps to store information for a longer period by reviewing it ("use it or lose it"). But Anki is dependent on how good the encoding happened. You cannot learn something you haven’t understood first. Therefore, you must devote (a lot of) time writing your own flashcards. A poor encoding process will make the best SRS algorithm useless.

  • Devote time to learn. Trying Anki is easy. Sticking to it is hard. Many users quickly abandon Anki probably because its benefits can only be visible after several years of making it a habit. And everyone knows changing habits is hard, otherwise Atomic Habits would not be the #1 best-selling book on Amazon last year. A lack of motivation will make the best SRS algorithm useless.

One last important thing,

Learning is one of the most enjoyable things in the world.

— Piotr Wozniak

To Remember

  • A Spaced Repetition System (SRS) counteracts the effect of the forgetting curve. Memory decay is inevitable but can be influenced.

  • SRS systems can be implemented with or without a computer. The Leitner system remains popular.

  • SRS systems often target a retention close to 90% (= 10% of cards are wrongly answered).

  • SuperMemo introduced the first SRS algorithm running on a computer (SM-2).

  • SM-2 continues to be used by most applications including Anki, despite having been abandoned in SuperMemo three decades ago.

  • Anki makes the SM-2 highly configurable and uses different queues to manage cards differently based on if they are new, in learning, or simply in review.

  • Most algorithms use the item difficulty (known as the ease factor) to determine optimal intervals. SuperMemo goes well beyond and also uses memory stability and memory retrievability.

  • Recent SRS applications rely on machine learning to exploit the specificities of the learning materials (ex: English words with irregular syntax) and to use the information collected from their massive dataset of users to tune their algorithm. SuperMemo never chose this approach.

  • The perfect SRS algorithm will never exist. No algorithm can determine if you are passionate about a subject, or if you review by chance the content of a card at work during a discussion with a coworker (in which case an "ideal" algorithm must postpone the next review).

  • Creating great flashcards and making reviewing them a habit have probably a far bigger impact than any improvement in the SRS algorithm you use.







via I'm lovin' I.T. by Julien Sobczak

December 28, 2022 at 05:47PM

xXWarMachineRoXx commented 7 months ago

Good read