How SM-2 Works in SmartRecall
How SM-2 Works in SmartRecall
SM-2 is the spaced-repetition algorithm Piotr Wozniak published in his 1987 SuperMemo paper. It's also the algorithm behind Anki and Mnemosyne. This page documents exactly how SmartRecall implements it — every constant, every transition, with a worked example.
The 60-second summary
After every review, you rate how the recall felt:
- Again (0) — failed, didn't recall
- Hard (3) — recalled, but with serious effort
- Good (4) — recalled with normal effort
- Easy (5) — trivial recall
SM-2 uses that rating to update two numbers per card:
- Interval (
I) — days until the next review - Ease factor (
EF) — a multiplier that controls how fast the interval grows
Higher ratings → bigger EF → faster-growing intervals. Lower ratings → smaller EF → tighter intervals. A failure resets the interval but only nudges EF down.
The exact rules SmartRecall uses
Initial values for a new card:
I = 0 (will be set on first review)
EF = 2.5
reps = 0 (consecutive successful reviews)
On review with quality q (0–5):
if q < 3: // lapse
reps = 0
I = 1 // back to 1 day
// EF still updates below
else: // success
if reps == 0: I = 1
elif reps == 1: I = 6
else: I = round(I_prev * EF)
reps = reps + 1
EF = max(1.3, EF + (0.1 - (5 - q) * (0.08 + (5 - q) * 0.02)))The EF formula collapses to friendly numbers at each rating:
| Rating | q | EF change |
|---|---|---|
| Again | 0 | −0.80 |
| Hard | 3 | −0.14 |
| Good | 4 | 0.00 |
| Easy | 5 | +0.10 |
EF is clamped at a minimum of 1.3 — we never let a card grow exponentially slower than that, no matter how many lapses.
A worked example
A new card on "What is the spacing effect?":
| Review | Rating | q | reps after | EF after | I after | Next review |
|---|---|---|---|---|---|---|
| 1 | Good | 4 | 1 | 2.50 | 1 day | tomorrow |
| 2 | Good | 4 | 2 | 2.50 | 6 days | +6 d |
| 3 | Easy | 5 | 3 | 2.60 | 16 days | +16 d |
| 4 | Hard | 3 | 4 | 2.46 | 39 days | +39 d |
| 5 | Again | 0 | 0 | 1.66 | 1 day | tomorrow (lapse) |
| 6 | Good | 4 | 1 | 1.66 | 1 day | +1 d |
| 7 | Good | 4 | 2 | 1.66 | 6 days | +6 d |
A few things to notice:
- The first two intervals (1 d → 6 d) are fixed, not multiplied. SM-2 hard-codes them so brand-new cards don't immediately fly out to 30 days because of a high
EF. - After review 4, the interval is
round(16 * EF) = round(16 * 2.46) = 39. - Review 5 is a lapse —
repsresets to 0,Iresets to 1, butEFonly drops by 0.80 (not back to 2.5). The card is "wounded," not erased. - After the lapse, the schedule does not repeat the 1 → 6 ramp; it continues from
reps = 1after review 6 because review 6 was successful.
What SmartRecall changes
SM-2 is the floor, not the ceiling. We make three pragmatic adjustments:
- Soft-lapse on Hard ratings. If you rate Hard three times in a row, we cap the next interval at
I_prev— so a card you keep struggling with stops growing until you flip to Good. Pure SM-2 would keep multiplying byEFand surface it less often. - Leech detection. If a card lapses 8 times total, we tag it as a leech and surface it on your dashboard so you can rewrite it. A bad card is a workflow problem, not an algorithm problem.
- Deterministic seeding from generation time. When the AI emits a 200-card deck, we don't drop them all on day one — we spread the initial
I = 1reviews across the next 5 days using a deterministic hash of the card ID. That keeps the daily review queue flat.
Everything else — EF formula, the 1/6 day ramp, the 1.3 floor, the lapse semantics — is exactly the 1987 paper.
Why not FSRS?
FSRS is a more recent scheduler that learns per-user retention curves from review history. It's measurably better than SM-2 once you have ~1000 reviews. We're working on it as an opt-in scheduler — track Updates for the rollout.
Further reading
- Wozniak, P. (1990). Optimization of learning. The original SM-2 specification.
- Cepeda, N. J., et al. (2006). Distributed practice in verbal recall tasks: A review and quantitative synthesis. Psychological Bulletin. Meta-analysis of the spacing effect across 317 experiments.
- Karpicke, J. D., & Roediger, H. L. (2008). The critical importance of retrieval for learning. Science. The testing-effect paper SM-2 implicitly depends on.
