Algorithm deep dive

The SM-2 Algorithm Explained

SM-2 is the scheduling algorithm that decides when you'll see a flashcard again. It was designed in 1987 by Piotr Woźniak for SuperMemo, later became the algorithm behind Anki, and is what WeaveWords uses to schedule every vocabulary review. It's simple enough to compute by hand, which is part of why it's remained the default choice for spaced repetition apps for decades.

The inputs: a single quality rating

After you review a card, SM-2 asks for one thing: how well did you remember it? Traditionally scored 0–5 (WeaveWords uses the same 1–5 scale), where roughly:

  • 0–2 — you didn't remember it (a "fail")
  • 3 — you remembered, but it was a struggle
  • 4–5 — you remembered it easily

That single number drives everything else the algorithm does.

The three numbers SM-2 tracks per card

For every flashcard, SM-2 maintains three values:

  • Repetition count (n) — how many times in a row you've successfully recalled the card.
  • Ease factor (EF) — a multiplier, starting at 2.5, representing how "easy" the card is for you. It only moves within a floor of about 1.3.
  • Interval (I) — the number of days until the next review.

How the interval is calculated

On a successful recall (quality ≥ 3):

  • First successful review: interval = 1 day
  • Second successful review: interval = 6 days
  • Every review after that: interval = previous interval × ease factor

So a card with an ease factor of 2.5 that's been reviewed successfully several times in a row grows its interval fast — 1 day, 6 days, 15 days, 38 days, and so on — because each success is evidence you don't need to see it as often.

On a failed recall (quality < 3), the repetition count resets to zero and the interval drops back to 1 day — you'll see the card again tomorrow, regardless of how far out it had drifted.

How the ease factor adjusts

The ease factor itself updates after every review using the quality score, roughly:

EF' = EF + (0.1 − (5 − q) × (0.08 + (5 − q) × 0.02))

In plain terms: rating a card 5 (effortless) nudges its ease factor up slightly, so it will be spaced out faster in the future. Rating it 3 (a struggle) nudges the ease factor down, so it keeps coming back more frequently even after you "pass" it. This is why two cards you've both technically memorized can still have very different review frequencies — SM-2 is tracking not just whether you remember, but how much effort it took.

Why this matters for vocabulary learning

The practical effect for a language learner: words that come naturally get out of your way quickly, and words that keep tripping you up stay in heavy rotation until they don't. You never have to manually decide what to review — the algorithm reallocates your review time toward your weak spots automatically, every single day.

See SM-2 scheduling in action

WeaveWords implements SM-2 scheduling on every vocabulary card you add — free, with AI-generated translations and examples built in.

Start learning for free