SM-2 Algorithm: How the Spaced-Repetition Formula Works
The SM-2 algorithm is a rule for scheduling the next review. It keeps an interval and an ease factor, accepts a recall grade from 0 to 5, and turns those values into a number of days. In the original version, successful reviews use gaps of 1 day, then 6 days, then the previous interval multiplied by the ease factor. A failed review restarts the interval sequence.
The complication is that “uses SM-2” does not tell you every date an app will choose. Starting values, rounding, learning steps, and the unit being scheduled can all change the result. The name identifies the underlying recipe, while each app still makes implementation choices around it.
What the SM-2 algorithm stores
Original SM-2 works with the smallest item the learner can review independently. For each item, it needs four pieces of information:
- Repetition count: how many successful reviews have happened in the current run.
- Previous interval: the last gap between reviews, measured in days.
- E-Factor: a multiplier representing how quickly that item’s intervals may grow.
- Quality grade: the learner’s rating of the latest response, from 0 to 5.
Piotr Wozniak’s original SM-2 description starts a new item with an E-Factor of 2.5. A perfect response receives 5; a correct response with hesitation receives 4; a difficult but correct response receives 3. Grades below 3 mean the answer was not recalled correctly.
The algorithm does not inspect the answer. It receives the grade you or the surrounding app supplies. Give it an optimistic rating and it will perform the arithmetic with admirable confidence.
The original SM-2 formula, step by step
For a successful response, the first two intervals are fixed:
I(1) = 1 day
I(2) = 6 days
After that, the previous interval is multiplied by the current E-Factor:
I(n) = I(n - 1) × EF
The original instructions round a fractional interval up to the next whole day. Only after choosing the interval does SM-2 update the E-Factor using the quality grade q:
EF' = EF + (0.1 - (5 - q) × (0.08 + (5 - q) × 0.02))
The update is easier to read as a small table:
| Grade | Meaning in the original description | Change to E-Factor |
|---|---|---|
| 5 | Perfect response | +0.10 |
| 4 | Correct after hesitation | 0 |
| 3 | Correct with serious difficulty | -0.14 |
| 2 | Incorrect, but the answer felt familiar | Failure: keep E-Factor |
| 1 | Incorrect, then remembered | Failure: keep E-Factor |
| 0 | Complete blackout | Failure: keep E-Factor |
Any calculated E-Factor below 1.3 is raised to 1.3. When the grade is below 3, the successful-repetition count restarts, so the next interval returns to the opening sequence. The original method also asks for same-day repeats of anything graded below 4; many app implementations handle that learning step differently.
A worked SM-2 example
Suppose a new item starts at E-Factor 2.5 and every review receives grade 4. That grade leaves the factor unchanged.
| Successful review | Calculation | Next interval | E-Factor after review |
|---|---|---|---|
| 1 | Fixed opening interval | 1 day | 2.5 |
| 2 | Fixed opening interval | 6 days | 2.5 |
| 3 | 6 × 2.5 | 15 days | 2.5 |
| 4 | 15 × 2.5 = 37.5, rounded up | 38 days | 2.5 |
| 5 | 38 × 2.5 | 95 days | 2.5 |
A grade of 5 would increase the factor by 0.1 after that review, allowing later gaps to grow faster. A grade of 3 would subtract 0.14, unless the 1.3 floor stopped it. A grade below 3 would send the interval back to 1 day without changing the factor.
This trace explains the mechanism, not an ideal schedule for every learner. The formula does not know the importance of the material, the cost of forgetting it, or whether the grade was honest. For practical choices outside an adaptive app, see the spaced-repetition schedule guide.
What Spacey’s current implementation returns
We ran deterministic inputs against the behavior defined by Spacey’s current SM2Calculator.swift and checked the overlapping outputs against its existing XCTest fixtures. This tests the calculation, not whether those dates improve retention.
Spacey’s adaptive plan creates its first pending topic review with an ease factor of 1.3. With repeated Good ratings, which map to grade 4, the calculator returns:
| Successful strike supplied | Previous interval | Previous ease | Returned interval | Returned ease |
|---|---|---|---|---|
| 0 | 1 | 1.3 | 1 day | 1.3 |
| 1 | 1 | 1.3 | 6 days | 1.3 |
| 2 | 6 | 1.3 | 8 days | 1.3 |
| 3 | 8 | 1.3 | 10 days | 1.3 |
| 4 | 10 | 1.3 | 13 days | 1.3 |
Repeated Perfect ratings, or grade 5, raise the ease factor after every call:
| Successful strike supplied | Previous interval | Previous ease | Returned interval | Returned ease |
|---|---|---|---|---|
| 0 | 1 | 1.3 | 1 day | 1.4 |
| 1 | 1 | 1.4 | 6 days | 1.5 |
| 2 | 6 | 1.5 | 9 days | 1.6 |
| 3 | 9 | 1.6 | 14 days | 1.7 |
The interval uses the previous ease factor; the rating updates ease for the next call. An Average grade of 3 tries to reduce ease, but the 1.3 floor keeps it at 1.3. A grade of 2 after a 13-day interval returns a 1-day interval and preserves the prior ease.
Where Spacey differs from original SM-2
The implementation keeps the recognizable SM-2 core: grades 3–5 count as successful, the first two calculated intervals are 1 and 6, later intervals use the previous interval and ease, the ease-update equation is the same, and ease cannot fall below 1.3.
Two choices materially change the dates.
First, Spacey’s adaptive plan starts at E-Factor 1.3 rather than the original 2.5. A run of grade-4 reviews therefore grows as 1, 6, 8, 10, and 13 days in the tested calculator calls, not 1, 6, 15, 38, and 95 days.
Second, the Swift code rounds later intervals to the nearest integer. Original SM-2 says to round upward. With a previous interval of 8 and ease 1.3, Spacey rounds 10.4 to 10; the original ceiling rule would return 11.
There is also a difference in what gets scheduled. Original SM-2 describes separate, small items. Spacey applies adaptive timing to a whole study topic. A topic might be a chapter, course module, or concept rather than one question with one objectively correct response. That makes the self-rating broader and explains why an implementation can use SM-2 arithmetic without behaving like a flashcard deck.
Current Anki documentation makes the larger point explicit: Anki offers an SM-2-derived option and FSRS, and its SM-2-based scheduler differs from the original in several ways. The algorithm name is a starting point for inspection, not a compatibility standard.
What SM-2 does not prove
SM-2 gives you a transparent feedback loop. It does not estimate a live probability of recall, target a chosen retention percentage, understand why an answer failed, or prove that one interval is best for every kind of knowledge. Its equation was built heuristically, and later schedulers use different models.
The algorithm can still be useful precisely because it is small. You can inspect the state, reproduce the next interval, and see how a rating changes future timing. That is enough for many scheduling jobs. It is not a certificate of learning quality.
Where Spacey fits
Spacey uses an SM-2 calculation for its adaptive plan, but its role remains narrow: it schedules when a study topic returns. You choose what to learn elsewhere, decide what a useful review looks like, and rate how the review went. Spacey then creates the next review date from that input.
If you prefer predictable dates, Spacey also has fixed review plans. With the adaptive plan, the schedule begins conservatively, expands after successful reviews, grows faster after stronger ratings, and returns to a short gap after a failed one. The calculation is transparent; the judgment supplied to it is still yours.
Ready to Remember More?
Download Spacey and start scheduling your reviews today.
Frequently Asked Questions
What does SM-2 stand for?
SM-2 is the name of the algorithm used in SuperMemo 2.0, the popular version of Piotr Wozniak's early computer-based learning software. The algorithm was developed in the late 1980s and described in his 1990 thesis.
What is the SM-2 ease factor?
The ease factor is a multiplier attached to an item. After the first two successful reviews, SM-2 multiplies the previous interval by this value to calculate the next gap. The recall grade can raise or lower the factor, with the original algorithm setting a floor of 1.3.
Is SM-2 still used by Anki?
Current Anki offers both an SM-2-derived scheduler and FSRS. Anki's own documentation notes that its SM-2-based behavior differs from the original in its learning steps, answer choices, late-review handling, and other details.
Does Spacey use the original SM-2 algorithm exactly?
No. Spacey's adaptive plan uses the original ease-update equation, 0–5 rating range, 1.3 floor, and 1-then-6 opening intervals, but its current implementation starts at ease 1.3 for topic reviews and rounds later intervals to the nearest day rather than always upward.