How Spaced Repetition Works — and the Exact Algorithm This Site Uses

The forgetting curve, why expanding intervals work, and the exact SM-2-variant math FlashDeck runs — ease factor, interval ladder, lapse rules.

Published 2026-09-24

The problem the algorithm solves

In 1885 Hermann Ebbinghaus measured himself memorizing nonsense syllables and re-testing at intervals, and the curve he drew is still the shape of forgetting: memory decays steeply at first, then flattens. Most of what you cram tonight is gone in days unless something interrupts the decay.

The interrupt that works is retrieval at the edge of forgetting. Reviewing while the memory still needs a small effort to surface — not too early, when it’s trivial, and not too late, when it’s gone — strengthens the trace and slows the next decay. That’s the spacing effect, and it’s among the most replicated findings in memory research: a 2006 meta-analysis by Cepeda, Pashler, Vul, Wixted and Rohrer, aggregating more than a century of verbal-recall experiments, found distributed practice beating massed practice in essentially every material and population studied.

The engineering question is when “the edge of forgetting” is for each item — and that’s what a scheduler computes. Every card gets its own timeline because each card has a different difficulty and a different history with you.

SM-2: the published algorithm

The best-known open scheduler is SM-2, which Piotr Wozniak developed for SuperMemo in the late 1980s and described publicly. It tracks three numbers per item:

  • EF — easiness factor. Starts at 2.5. Updated after every review by EF' = EF + (0.1 − (5−q) × (0.08 + (5−q) × 0.02)), where q is recall quality on a 0–5 scale. EF can never drop below 1.3 — the floor that stops a hard card from collapsing its own intervals — and has no ceiling.
  • Repetition count. How many times you’ve passed the card in a row.
  • Interval in days. I(1) = 1, I(2) = 6, and for n ≥ 3, I(n) = round(I(n−1) × EF). A pass on quality q ≥ 3 advances the count; a fail (q < 3) resets repetitions to zero and the item restarts the ladder.

With EF untouched at 2.5 the ladder runs 1 → 6 → 15 → 38 → 95 days… Easy items (q=5, EF rising) stretch faster; hard items (q=3, EF falling −0.14 each time) grow slower. The elegance is that a single formula handles both.

What FlashDeck runs, exactly

Our scheduler is an SM-2 variant — the core algorithm adapted to four buttons, documented here so you can audit it:

Button Key Maps to SM-2 quality EF change Interval effect
Again 1 q = 2 −0.32 Lapse: reps reset to 0, card re-enters the same session as relearning, next pass → 1 day
Hard 2 q = 3 −0.14 Advance one rung on the ladder
Good 3 q = 4 ±0.00 Advance one rung on the ladder
Easy 4 q = 5 +0.10 Advance one rung on the ladder

Two deliberate choices to notice:

All passing grades share the next interval. In SM-2, the interval depends on the repetition rung and EF — the grade you give changes EF, which changes every future multiplication. So Good and Easy both send a rep-2 card to 6 days, but the Easy-graded card will then jump to 16 days instead of 15 (EF 2.6 vs 2.5). The benefit compounds rather than arriving up front.

A lapse comes back in the same session. SM-2 says a failed item repeats until recalled. We implement that literally: press Again and the card is re-inserted a few positions later in the current queue, marked relearning. Once you pass it, it restarts the ladder at 1 day with the −0.32 ease penalty applied.

The due queue itself is simple: scheduled cards with due ≤ now, sorted most-overdue-first, with new cards dealt in at a one-per-three-reviews ratio up to the deck’s per-session cap.

How this differs from Anki — honestly

People reasonably ask “is this the Anki algorithm?” It is not, and the differences matter if you move between the two:

  • Learning steps. Anki holds new and lapsed cards in minute-scale learning steps (1m, 10m, …) inside the day. FlashDeck’s equivalent is the same-session re-queue: a lapsed card returns a few cards later, not a stopwatch later.
  • Easy bonus & hard multiplier. Anki applies an immediate ×1.3 interval bonus for Easy and ×1.2 for Hard on review cards. FlashDeck keeps SM-2’s shared rung and lets EF carry the difference.
  • Interval fuzz and caps. Anki jitters intervals so siblings don’t collide and caps the maximum interval (default ~100 years). FlashDeck schedules the exact computed day with no cap and no fuzz.
  • Day boundaries. Anki counts a “day” to the next-4am rollover; FlashDeck’s interval is a literal 24-hour multiple from the moment of grading.

None of this makes one “right” — Anki’s additions are pragmatic tunings, and our core is the published original. What matters for trust is that the formula on this page is the formula in the code: open the deck manager, watch a card’s interval, and check it against the table above.

What the algorithm can’t fix

Spaced repetition schedules retrieval; it doesn’t create understanding. Cards for material you don’t understand will feel like arbitrary noise and lapse forever — SM-2’s own documentation lists “do not learn what you do not understand” as rule zero. And a scheduler tuned for ~85–90% recall still means forgetting 1 in 7ish reviews; that’s the intended operating point, not a failure of yours or the math’s. The card-writing guide and the session guide cover the two halves the algorithm leaves to you.

Frequently asked questions

Is SM-2 the same thing Anki uses?

Anki's scheduler is descended from SM-2, but it is not SM-2: Anki adds learning steps measured in minutes, graduating intervals, an easy-interval bonus, interval fuzz, a maximum interval cap and its own lapse model. FlashDeck implements a documented SM-2 variant — the core Wozniak published — not Anki's scheduler, and this page states the exact differences.

Why does 'Easy' not give a longer interval right away?

In SM-2 the grade changes the ease factor, not the current rung. Easy raises EF by +0.10, which makes every later interval multiply faster — the benefit compounds instead of arriving once. Anki chose differently (its Easy applies an immediate interval bonus); we document ours rather than imitate it.

What happens to a card I keep failing?

Each lapse cuts ease by −0.32 (floor 1.3) and sends the card back through the 1-day → 6-day ladder once you finally pass it. A card that lapses three or more times is telling you the card is the problem — split it, shorten it, or add context. The card-writing guide covers the fixes.

Can two decks share one schedule?

No — scheduling is per card, and cards belong to exactly one deck. If you want a merged session, export both decks to CSV, concatenate the files, and import as one deck (they'll arrive as new cards).

Is more spacing always better?

Up to a point. Intervals that grow faster than memory decays produce a recall rate around 85–90% — the range SM-2 was tuned for. Stretching reviews too far converts retrieval practice into re-learning; keeping them too short wastes effort on material you'd have recalled anyway.