Olumino blog
How FSRS-7's Dual-Trace Memory Model Works
Learn how FSRS-7 combines fast and slow memory traces using mixture weights, forgetting curves, mathematical examples, and working C++ code.
FSRS-7 uses two memory traces to predict recall. Each trace has its own stability, forgetting curve, and mixture weight. The model updates both stability values after a review, allowing them to change at different rates even when they receive the same rating.
What are fast stability and slow stability?
A reviewed flashcard has three stored memory values in FSRS-7.
This is the MemoryState struct from my C++ implementation in Olumino:
struct MemoryState {
double stabilitySlow;
double difficulty;
double stabilityFast;
};| Variable | C++ member | Purpose |
|---|---|---|
| S_s | stabilitySlow | Controls the slow memory trace |
| D | difficulty | Influences forgetting and memory updates |
| S_f | stabilityFast | Controls the fast memory trace |
Both stability values are measured in days. Difficulty ranges from 1 to 10.
Retrievability is calculated from these values and elapsed time. It does not need to be stored as a permanent memory value because it changes as time passes.
Throughout this article, I'll use the 34-weight parameter vector in my C++ engine as inspected on November 25, 2026. Different trained or later parameter sets can produce different numerical results.
How does FSRS-7 initialize both stability values?
When a card receives its first rating, it does not have an existing memory state to update.
The initialState() function creates one:
MemoryState initialState(Rating rating) {
const int ratingNumber =
static_cast<int>(rating);
const double stability =
clampStability(WEIGHTS[ratingNumber - 1]);
const double difficulty =
std::clamp(
unclampedInitialDifficulty(rating),
1.0,
10.0
);
return {
stability,
difficulty,
clampStability(FAST_TO_SLOW * stability)
};
}The first four values in the WEIGHTS array determine initial slow stability.
0.1104, 2.2395, 3.9221, 11.7841,Each corresponds to a review rating.
The fast stability starts at 80% of slow stability before applying stability bounds.
constexpr double FAST_TO_SLOW = 0.8;Mathematically:
Where G is the rating number, ranging from 1 to 4.
Using the parameters above:
| First rating | Slow stability | Fast stability |
|---|---|---|
| Again | 0.1104 | 0.08832 |
| Hard | 2.2395 | 1.79160 |
| Good | 3.9221 | 3.13768 |
| Easy | 11.7841 | 9.42728 |
A Good rating creates a slow stability of 3.9221 days and a fast stability of 3.13768 days.
Neither value represents the exact number of days until predicted recall reaches 90%. The model must calculate the combined forgetting curve to find that interval.
The 80% relationship applies during initialization and is used again as a cap after forgetting. It does not constrain every successful review.
How does FSRS-7 represent the two forgetting curves?
Each forgetting curve needs three calculated values:
- A decay exponent that affects its shape.
- A speed value that controls its time scale.
- A mixture coefficient that determines its relative influence.
I store these calculated values in a separate Curve struct:
struct Curve {
double fastDecay, fastSpeed, fastWeight;
double slowDecay, slowSpeed, slowWeight;
};The MemoryState struct stores information about the card. The Curve struct contains the values needed to evaluate its forgetting curves.
The curveFor() function calculates those values from the memory state and the model's parameters.
This distinction helps separate stored memory from the calculations performed using that memory.
How does fast stability affect the forgetting curve?
The fast trace has a decay exponent that depends on fast stability.
The following function calculates it:
double fastDecay(double stabilityFast) {
return -std::clamp(
WEIGHTS[23] *
std::pow(
stabilityFast,
WEIGHTS[33] - 0.3
),
0.01,
0.95
);
}Written mathematically:
The exponent is restricted to the range from -0.95 to -0.01.
This keeps it negative, allowing the recall probability to decrease as time increases.
The speed of the fast curve is calculated by another function:
double fastSpeed(
double decay,
double stabilityFast
) {
return (
std::exp(
std::min(
60.0,
std::log(WEIGHTS[25]) / decay
)
) - 1.0
) / stabilityFast;
}Its mathematical equivalent is:
Once the decay exponent and speed are known, the fast recall probability is:
Fast stability appears in both the decay exponent and the speed calculation. It can therefore affect the shape and time scale of the forgetting curve.
What does the fast stability value represent?
The fast curve is constructed so that, when the exponent cap is inactive, its recall probability reaches w_{25} when elapsed time equals fast stability.
In the parameter vector used here:
Suppose fast stability is 0.05 days.
Since a day contains 1,440 minutes:
After 72 minutes, the fast component reaches approximately 24.21% predicted recall.
That percentage applies only to the fast trace. The card's combined recall probability also depends on the slow trace and both mixture coefficients.
How does FSRS-7 calculate the slow forgetting curve?
The slow trace uses a fixed decay exponent for a given parameter set.
The following lines are from curveFor():
const double timeScale = std::exp(
(difficulty - 5.0) *
(WEIGHTS[32] - 0.3)
);
curve.slowDecay = -std::clamp(
WEIGHTS[24],
0.01,
0.95
);
curve.slowSpeed = (
std::pow(
WEIGHTS[26],
1.0 / curve.slowDecay
) - 1.0
) * timeScale / slow;The decay exponent is:
The speed is:
The slow recall probability is then:
The difficulty term deserves closer attention:
Using w_{32}=0.5333, it becomes:
| Difficulty | Time scaling |
|---|---|
| 1 | 0.393 |
| 3 | 0.627 |
| 5 | 1.000 |
| 7 | 1.595 |
| 10 | 3.211 |
At difficulty 5, the scaling factor equals one.
Increasing difficulty makes the slow curve decline more quickly, assuming slow stability remains unchanged and the chosen parameter values remain fixed.
The time scaling factor affects the slow component. It does not directly multiply the decay rate of the combined recall prediction.
This is one of the differences from FSRS-6, where difficulty affects memory updates but does not directly appear in the forgetting curve.
What are mixture weights in FSRS-7?
The fast and slow traces produce separate recall probabilities. Mixture weights determine how much each probability influences the final prediction.
The raw coefficients are calculated inside curveFor().
curve.fastWeight =
WEIGHTS[27] *
std::pow(fast, -WEIGHTS[29]);
curve.slowWeight =
WEIGHTS[28] *
std::pow(slow, WEIGHTS[30]) *
std::exp(
(difficulty - 5.0) *
(WEIGHTS[31] - 0.5)
);The corresponding equations are:
These raw coefficients do not need to add up to one.
To interpret them as relative shares, divide each coefficient by their sum:
For example, if the fast coefficient equals 2 and the slow coefficient equals 8:
The fast trace receives 20% of the mixture, and the slow trace receives 80%.
A raw coefficient of 2 does not represent a probability. Its relative size determines how much influence it has.
How does FSRS-7 combine the two memory traces?
The recallChance() function evaluates both curves at the requested elapsed time.
const Curve c = curveFor(memory);
const double fast = std::pow(
1.0 + c.fastSpeed * days,
c.fastDecay
);
const double slow = std::pow(
1.0 + c.slowSpeed * days,
c.slowDecay
);At this point, fast and slow each contain a recall probability.
The following line combines them:
const double blend =
(c.fastWeight * fast + c.slowWeight * slow)
/ (c.fastWeight + c.slowWeight);Mathematically:
The function finishes with a numerical adjustment:
return blend * (1.0 - 2.0 * RECALL_EDGE)
+ RECALL_EDGE;The constant is defined as:
constexpr double RECALL_EDGE = 1e-5;Immediately after a review, both component curves evaluate to one.
Without the adjustment, the combined recall probability would also equal one.
Instead, the function returns:
The resulting recall probability is 99.999%.
Keeping probabilities away from zero and one also prevents logarithms of zero when evaluating prediction errors using binary cross-entropy.
Why can fast stability increase without changing its mixture weight?
This behavior comes from the value of w_{29}.
In the parameter vector used in my engine:
Substituting those values into the fast mixture equation:
Because fast stability is positive:
Therefore:
The raw fast mixture coefficient remains constant regardless of fast stability.
I calculated recall after one hour while keeping slow stability at 10 days and difficulty at 5.
| Fast stability | Fast recall | Fast mixture share | Combined recall |
|---|---|---|---|
| 0.005 days | 17.51% | 5.16% | 95.71% |
| 0.05 days | 24.90% | 5.16% | 96.09% |
| 0.5 days | 35.68% | 5.16% | 96.65% |
| 5 days | 51.44% | 5.16% | 97.46% |
Fast stability increased by a factor of 1,000 across these memory states.
The fast component's recall probability increased by approximately 34 percentage points. The combined prediction increased by less than two percentage points.
The fast component represents only 5.16% of the mixture in these examples, limiting the effect of its changing recall probability.
A trained parameter vector with a nonzero value for w_{29} can behave differently.
Why does increasing slow stability change the mixture weights?
The slow mixture coefficient contains the following term:
In this parameter vector:
Increasing slow stability increases the raw slow coefficient, assuming the remaining values stay fixed.
Since both normalized shares must add up to one, increasing the slow coefficient reduces the relative influence of the fast trace.
I kept fast stability at 0.05 days and difficulty at 5, then calculated recall after one day.
| Slow stability | Fast mixture share | Slow mixture share | Combined recall |
|---|---|---|---|
| 1 day | 16.71% | 83.29% | 81.38% |
| 10 days | 5.16% | 94.84% | 94.91% |
| 100 days | 1.45% | 98.55% | 98.69% |
Increasing slow stability changes both the slow forgetting curve and its share of the mixture.
At 100 days of slow stability, the fast trace accounts for less than 1.5% of the combined prediction in this experiment.
Do mixture weights change as time passes?
The mixture weights depend on the card's memory state and model parameters. Elapsed time does not appear in either weight equation.
As long as the memory state and parameters remain fixed, the mixture weights stay constant.
Consider this memory state:
const fsrs::MemoryState memory{
10.0, // Slow stability
5.0, // Difficulty
0.05 // Fast stability
};The fast mixture share is approximately 5.16%.
| Elapsed time | Fast recall | Slow recall | Combined recall |
|---|---|---|---|
| Immediately | 100.00% | 100.00% | 99.999% |
| 5 minutes | 36.54% | 100.00% | 96.72% |
| 1 hour | 24.90% | 99.97% | 96.09% |
| 1 day | 15.24% | 99.25% | 94.91% |
| 10 days | 10.68% | 94.64% | 90.31% |
| 30 days | 9.01% | 89.55% | 85.39% |
The fast mixture share remains 5.16% throughout this table.
What changes is the recall probability of each trace.
After one hour, the fast trace's weighted contribution is approximately:
That is approximately 1.29 percentage points of the combined probability before the small epsilon adjustment.
The mixture share remains 5.16%.
Separating a component's mixture share from its weighted recall contribution helps explain why the combined forgetting curve changes even while its weights remain fixed.
How does FSRS-7 update both memory traces after a review?
The model uses separate groups of parameters for the two stability updates.
| Parameter range | Purpose |
|---|---|
| w_0 to w_3 | Initial stability |
| w_4 to w_6 | Difficulty |
| w_7 to w_{14} | Slow stability updates |
| w_{15} to w_{22} | Fast stability updates |
| w_{23} to w_{33} | Forgetting curves and mixture coefficients |
Both stability updates use the same general mathematical structure.
Instead of writing two separate update functions, I use these constants to identify where each parameter block begins:
constexpr int SLOW_UPDATE = 7;
constexpr int FAST_UPDATE = 15;The stabilityAfterReview() function accepts the starting index as its first argument.
Here is the function from the engine, formatted across additional lines for readability:
double stabilityAfterReview(
int first,
double stability,
double difficulty,
double chance,
Rating rating
) {
const auto w = [first](int offset) {
return WEIGHTS[first + offset];
};
const double afterForgetting = std::min(
stability,
w(3) *
(std::pow(stability + 1.0, w(4)) - 1.0) *
std::exp((1.0 - chance) * w(5))
);
if (rating == Rating::Again) {
return clampStability(afterForgetting);
}
const double hardPenalty =
(rating == Rating::Hard) ? w(6) : 1.0;
const double easyBonus =
(rating == Rating::Easy) ? w(7) : 1.0;
const double growth =
std::exp(w(0) - 1.5) *
(11.0 - difficulty) *
std::pow(stability, -w(1)) *
(std::exp((1.0 - chance) * w(2)) - 1.0) *
hardPenalty *
easyBonus;
return clampStability(
std::max(
afterForgetting,
stability * (1.0 + growth)
)
);
}This one function handles both memory traces and all four ratings.
How does the parameter offset work?
The local function w() accesses a parameter relative to the beginning of the selected block:
const auto w = [first](int offset) {
return WEIGHTS[first + offset];
};When updating slow stability, first equals 7.
When updating fast stability, first equals 15.
| Expression | Slow update | Fast update |
|---|---|---|
w(0) | WEIGHTS[7] | WEIGHTS[15] |
w(1) | WEIGHTS[8] | WEIGHTS[16] |
w(2) | WEIGHTS[9] | WEIGHTS[17] |
w(6) | WEIGHTS[13] | WEIGHTS[21] |
w(7) | WEIGHTS[14] | WEIGHTS[22] |
Both traces follow the same equations. The parameter values determine how each trace responds.
How is stability growth calculated?
For successful reviews, the growth expression can be written as:
Where:
- k is the starting parameter index.
- S is the stability being updated.
- D is the current difficulty.
- q is the recall probability used by that trace.
- H is the Hard penalty.
- E is the Easy bonus.
The successful stability candidate is:
The function compares this candidate with the lapse stability value and applies the stability bounds before returning the updated value.
For a Good rating, both H and E equal one.
Hard and Easy change their corresponding multipliers. Again returns through the earlier forgetting branch.
There is no need for a separate stability update function for each rating.
Why do the two traces use different recall probabilities?
The slow trace uses the card's combined recall probability.
The fast trace uses its own recall probability.
The distinction appears directly inside the existing review() function:
const double chance = recallChance(
currentMemory,
daysSinceLastReview
);
const double newSlow = stabilityAfterReview(
SLOW_UPDATE,
slow,
currentMemory.difficulty,
chance,
rating
);
double newFast = stabilityAfterReview(
FAST_UPDATE,
fast,
currentMemory.difficulty,
fastRecallChance(fast, daysSinceLastReview),
rating
);Both calls receive the same difficulty and rating.
They differ in the parameter block, stability value, and recall probability being passed to the function.
Recall the hypothetical memory state from earlier:
After one hour, the predicted probabilities are:
| Recall measurement | Probability |
|---|---|
| Combined recall | 96.09% |
| Fast recall | 24.90% |
The slow update receives approximately 0.9609.
The fast update receives approximately 0.2490.
The term (1-q) in the growth equation will therefore have different values:
With the positive growth parameters used here, a lower predicted recall probability can result in more stability growth after a successful review.
The separate parameter blocks further change how each trace responds.
Can fast stability become larger than slow stability?
Yes. Fast stability starts at 80% of slow stability, but successful reviews can change that relationship.
I calculated independent Good reviews using the same hypothetical starting memory state:
const fsrs::MemoryState memory{
10.0,
5.0,
0.05
};Calling the existing engine after one hour:
const fsrs::MemoryState updated = fsrs::review(
memory,
1.0 / 24.0,
fsrs::Rating::Good
);The resulting memory values are approximately:
stabilitySlow: 15.3782
difficulty: 4.9523
stabilityFast: 32.2997Changing the elapsed time gives the following results:
| Time before Good rating | New slow stability | New fast stability | New difficulty |
|---|---|---|---|
| 5 minutes | 14.4921 | 19.9307 | 4.9523 |
| 1 hour | 15.3782 | 32.2997 | 4.9523 |
| 1 day | 17.0622 | 47.7501 | 4.9523 |
Fast stability exceeds slow stability in each example.
The large growth comes from the low initial fast stability, its recall probability, and the parameters used in its update.
These are deliberately constructed memory states used to examine the algorithm. They are not typical growth measurements collected from students.
The fast component can still have a different decay exponent and speed from the slow component, even when its stability becomes larger.
What happens to the two traces when you forget a card?
When a rating is Again, stabilityAfterReview() calculates the lapse stability and returns before reaching the successful growth calculation.
The lapse equation is:
The model then applies the stability bounds.
After calculating both updated traces, the review() function applies an additional rule for Again:
if (rating == Rating::Again) {
newFast = std::min(
newFast,
FAST_TO_SLOW * newSlow
);
}Using the constant defined earlier:
This cap is applied after forgetting. The final stability bounds are applied when the updated state is returned.
It prevents a forgotten card from keeping an excessively large fast stability relative to its updated slow stability.
Why can fast stability increase while its mixture weight decreases?
Using the earlier Good-rating experiment, the mixture shares after each review are:
| Memory state | Slow stability | Fast stability | Fast mixture share |
|---|---|---|---|
| Before review | 10.0000 | 0.0500 | 5.16% |
| Good after 5 minutes | 14.4921 | 19.9307 | 4.20% |
| Good after 1 hour | 15.3782 | 32.2997 | 4.06% |
| Good after 1 day | 17.0622 | 47.7501 | 3.84% |
After the one-day review, fast stability is approximately 955 times its original value.
Its relative mixture share falls from 5.16% to 3.84%.
The raw fast coefficient remains constant because w_{29}=0 in this parameter set.
Slow stability increases, raising the slow coefficient. The small change in difficulty also affects that coefficient.
The fast trace can therefore become more stable while accounting for a smaller fraction of the combined prediction.
I would avoid using mixture weight alone as a measure of memory strength. Both stability and mixture coefficients are needed to understand how a trace affects predicted recall.
How can you experiment with the FSRS-7 memory model in C++?
You can examine the model using the four functions declared in the existing fsrs.h header:
double retrievability(
MemoryState memory,
double daysSinceLastReview
);
double nextInterval(
MemoryState memory,
double desiredRetention
);
MemoryState initialState(Rating rating);
MemoryState review(
MemoryState currentMemory,
double daysSinceLastReview,
Rating rating
);These functions cover memory initialization, recall prediction, interval calculation, and memory updates.
For the following experiments, use the existing engine rather than rewriting the algorithm.
Experiment 1: Compare the recall probability of two memory states
Create two states with identical slow stability and difficulty but different fast stability values.
const fsrs::MemoryState a{10.0, 5.0, 0.05};
const fsrs::MemoryState b{10.0, 5.0, 5.0};
const double recallA =
fsrs::retrievability(a, 1.0 / 24.0);
const double recallB =
fsrs::retrievability(b, 1.0 / 24.0);The calculated probabilities after one hour are approximately:
| Card | Predicted recall |
|---|---|
| A | 96.09% |
| B | 97.46% |
Only fast stability differs between the two cards.
Experiment 2: Compare reviews at different times
Start with a memory state initialized using Good:
const fsrs::MemoryState memory =
fsrs::initialState(fsrs::Rating::Good);Simulate a successful review after five minutes:
const fsrs::MemoryState early = fsrs::review(
memory,
5.0 / 1440.0,
fsrs::Rating::Good
);Then simulate one after eight hours:
const fsrs::MemoryState late = fsrs::review(
memory,
8.0 / 24.0,
fsrs::Rating::Good
);Compare the returned stability values.
| Updated memory | After 5 minutes | After 8 hours |
|---|---|---|
| Slow stability | 5.3656 | 7.3812 |
| Fast stability | 23.5283 | 108.7317 |
Both calls receive the same starting memory and rating. The elapsed time produces different recall inputs, leading to different stability updates.
Experiment 3: Calculate the next review interval
Use the updated memory states from the previous experiment:
const double earlyInterval =
fsrs::nextInterval(early, 0.90);
const double lateInterval =
fsrs::nextInterval(late, 0.90);The approximate intervals are:
| Memory state | Interval at 90% retention |
|---|---|
| Good after 5 minutes | 9.07 days |
| Good after 8 hours | 15.47 days |
These are raw intervals returned by the memory engine. A flashcard application may apply additional limits before choosing the final due date.
The experiments show how elapsed time affects recall, how recall influences each stability update, and how the resulting memory state determines the next calculated interval.
Each step uses the same functions that the application uses to model memory.
Sources
- Open Spaced Repetition. FSRS-7 Model Documentation
- Flashside. FSRS-7 in Flashside: What Changes, What We Measured
- Haskell FSRS 7.1.0. FSRS.Algorithm
- Haskell FSRS 7.1.0. FSRS.Parameters
Study what you're learning
Paste a list of terms or questions and Olumino makes the flashcards. No account needed.
Make a deck