# Algorithm – KYW

The algorithm combines FSRS-6 for the long-term schedule with our own in-session drilling engine. The first makes sure you return to a word right before you forget it. The second governs card order and repetition dynamics during the session itself.

_https://keepyourwords.org/en/about/algorithm_

This is what actually happens to your word: the order cards appear in, how a word moves between stages, and the rules that set your next meeting with it.

### Two mechanisms

KYW is made of two independent parts. **FSRS-6**, a research-backed memory model, keeps the calendar and answers the question “which day should I come back to this word”. The in-session engine answers a different one – “in what order should cards appear right now”; it thinks in steps rather than days: how many intervening cards before this word shows up again. The parts do not overlap: the order inside a session never moves the schedule, and the schedule never interferes with the order.

### Order of the stages

A session always follows one route: **review → new words → drill and early practice**. Movement is forward only; an empty stage is skipped. The one exception is the “new words” button in the feed settings: it jumps ahead to new words, but only when nothing overdue is left. Otherwise overdue words would be skipped, and they matter more than early practice.

### Stage 1. Review: two passes

Everything that has come due lands here. The order of the first pass is not random: words are sorted by the current probability of recall, and whatever has sagged furthest comes first. Each word is shown once.

Then comes the reason there are two passes. A word has three possible outcomes, and they are three different states of memory:

- **Produced right away.** An ordinary review: the schedule moves forward, nothing is reset.

- **Missed, then produced on the second pass.** The missed words are reshuffled and come round again – now that you have seen the correct answer. If the word is typed this time, it counts as an ordinary review, **with no lapse**. You had not forgotten it, you just could not reach it immediately: one look was enough to bring it back.

- **Missed twice.** The word does not drop out of the session, but it is not settled here either: it goes to the third stage, after the new words. Only there does it take an honest lapse – at the worst grade you gave it.

The second pass is reshuffled rather than replaying the first: otherwise you would be memorising the sequence instead of the words.

A typo – one wrong letter in a long enough word that matches none of your other words – is suggested as Hard. If the grade stays that way, the word goes to the second pass but does not become a lapse once you type it there.

### Stage 2. New words: introduction and rounds

How many new words to take is the daily limit minus whatever you have already taken today. “Today” is not the calendar day: if you have been away longer than a set number of hours, the counter resets and a new logical day begins. That suits people who study at night or across time zones.

- **Introduction.** Every new word is shown together with its definition; nothing to type. The order is shuffled.

- **Full pass.** All the new words, shuffled, this time typed.

- The pass went through **without a single mistake** – the stage is closed and the words enter the schedule.

- There were mistakes – **sub-passes** run over the missed words only, repeating until one of them comes out clean.

- Then a **full pass over all the words again**, including the ones you already produced. This repeats until some full pass is clean.

The point is the threshold, not the number of repetitions. A schedule is only worth building for a word you can already produce at least once – mixed in with the others, not straight after itself while it is still sitting in short-term memory.

On release each word gets its first schedule entry, and it depends on how hard the word came: the number of misses in the session counts, but with decay – the first miss weighs considerably more than the fifth. Otherwise a word you wrestled with for a long time would get an unreasonably short first interval.

### Stage 3. Drill and early practice

The last stage opens with your failures: the words missed on both review passes arrive here. They are not dealt with immediately – the new words come in between. That is not a pause for its own sake: it tests whether you can recall the word once the context has moved on.

Into them the engine mixes everything that is neither new nor due, ordered by probability of recall – whatever holds on worst comes first. It mixes them in gradually: while many failures are still in play, the chance of drawing an unseen card falls close to zero. The priority emerges from the maths rather than from a fixed order.

A word does not leave this stage. Answer it correctly and its step grows, so it simply recedes and surfaces more rarely. That is why the stage never ends by itself: the feed stops when you stop.

One record per word reaches the schedule, written when you leave. A failed review is recorded as an honest lapse at the worst grade of the session – that is a measurement of long-term memory and must not be softened. Early practice is recorded more gently: misses add up with decay, each weighing half the previous one, so however many times a word is missed inside a session the effect never exceeds twice that of a single miss. Such practice is not counted as a lapse: you were training, not missing a deadline.

### How the next card is chosen

Inside a session every word carries a step – how many intervening cards before it shows up again. Your answer changes it: Good and Easy stretch the step, Hard and Again shrink it sharply, Again the hardest. While the step is short the word counts as “hot”.

The more hot words pile up, the higher the pressure – and the more rarely the engine reaches for fresh cards, concentrating on what is falling apart. With no hot words, fresh ones come almost every time.

Among the words that are due, the next one is not taken by maximum but by weighted lottery: the further past its step a word is, the better its chances. Otherwise the order would quickly become a memorised jingle and you would be recalling a word's place in the queue rather than the word.

### How the grade is set

A grade is suggested automatically, but the final say is yours – four buttons from “didn't know” to “easy”.

- Typed correctly – Good.

- A typo – Hard.

- A different word typed – Again.

- A hint used – no better than Hard.

- **The automatic grade is never Easy**: that is a deliberate human decision.

When timing is switched on, what counts is not total time but pure recall: reading the definition and typing the answer are subtracted from it. It is compared against this card's own history, not somebody else's norm; noticeably slower than usual drops Good to Hard. Outliers – you got distracted, you went for tea – are cut off at the global 99th percentile. Until a card has five correct answers behind it, timing is not trusted at all.

### Word statuses

New → learning → learned. “Learned” is not “answered correctly a few times in a row” but several **separate days** with a clean answer since the last mistake. Two answers on the same day count as one: what matters is the gap between them, not the count. Any mistake resets the counter, and after Again the bar is set higher than after Hard.

“Difficult” is a separate mark for a word you fail again and again. It is set once the word has been forgotten on schedule several times (three by default) and still comes hard to you. What counts is how often the failures repeat: a word that was merely hard on the day you learned it will not be marked, while a mature word that keeps collapsing will be. The threshold is adjustable.

### If a session is interrupted

An unfinished session is closed out from its last state: review failures each take one lapse, and half-learned new words get their first entry with the misses accounted for. Words you only saw during the introduction but never typed stay new and come back next time.
