Anki 23.10 Beta 1-4

Hi, how can I specify maximum hard interval now? With custom scheduling FSRS code I just patched

  if (states.hard.normal?.review) {
    states.hard.normal.review.scheduledDays = Math.min(hard_interval, 30);
  }

to make max hard interval = 30 days. But now I don’t know which code would work.

(Btw, it would be nice to have such option out of the box.)

Computing optimal weights trains FSRS on the cards that use the settings preset above, in your case the “1 Raiz (OFF)” settings group. It then puts the weights it got under Model weights.

I’m not exactly sure what the numbers that analyzing gives mean.

Computing the optimal retention tries to give you a balanced retention rate so you don’t end up with too many or too little reviews. It automatically puts it under Desired retention. You can ignore that and just choose a desired retention yourself.

You can read more about it on the FSRS github page under Step 2: Personalizing FSRS

is there already a detailed tutorial explaining what each feature is for?

Nope, but I expect that we will get some in-app documentation and tooltipps before the next stable release. This is very much in early and active development and the interface might change. I’ll try to introduce some concepts and nomenclature:

FSRS is a scheduling algorithm that uses the review history of a card to predict how likely you will remember it in the future. It will show you the card when it thinks that the probability of you remembering it is 90% (or whatever you set Desired retention to).

To do the prediction, it uses a function (“model”) of many parameters, called “weights” (the term weights became popular with machine-learning). The optimal weights can be found by looking at past reviews and then choosing the parameters which best predict how well those past reviews were remembered. This is done automatically by algorithms that minimize some cost function, like for example the Root-Mean-Square-Error (RMSE). This is basically something like a curve-fit or linear regression that you might have seen in school, where you try to find a line that best describes some mearuments, just with more parameters. This model fitting might also be called “training” analogous to the training of AI models. With that knowledge your questions are easy to answer

I don’t understand what this text field above the buttons is for.

This is the Anki query (see the manual) to select the cards/reviews from your collection on which to train FSRS to get the optimal weights. By default FSRS is trained on all past reviews in your preset, because it’s also applied to your preset.

What is the difference between “Compute” and “Analyse”?

Compute initiates the FSRS training and obtains the optimal parameters. Analyze shows some numbers that describe how well you model describes your review history, which is basically what the computation tried to minimise. You can paste model weights that were trained on different decks into the weights text field and see how the RMSE for instance changes, so see how well the weights generalise across different decks. But that’s very technical and Analyze is not needed for the average user or to use FSRS.

What is the difference between “Compute optimal weights” and “Compute optimal retention”?

I explained the weights computation abover, the retention is the recall propability at which FSRS shows you the card. A high retention means that you will get more reviews daily but a higher fraction will be correct, a low retention means that you get fewer reviews (longer intervals), but fail to answer a higher fraction. Your daily study load depends on the number of daily new cards and the requested retention. If you set a lower retention, you will spend less time on reviews and will be able to learn more new cards in the same time as it would take with a higher desired retention and less new cards. The retention computation tries to find the retention value with which you would learn the most cards within x days if you study y minutes every day, and it assumes that you adjust the number of new cards to always hit that time goal. The nice thing is that FSRS can predict how many cards you would be able to correctly recall at any point of time. This is a measure of your knowledge and it’s this number that the retention opimisation computation tries to maximize (for a time after x days). But this is also not required, you can set the retention according to your liking to something between 0.8-0.95.

4 Likes

I believe this would make it a lot clearer for new users.

3 Likes

Built-in FSRS seems to have some problems dealing with filtered decks? It often occurs that cards in filtered decks have disproportionately huge intervals compared to those in normal decks.

E.g. the same card


Another example

1 Like

Yeah I noticed some discrepancies as well. I had noticed differences in weights after optimization but that was likely fixed

I also find this problem:

In the original deck:

In the filtered deck:

I find out the bug:

In the original deck, the elapsed days are correct.

&card.days_since_last_review(&timing).unwrap_or_default() = 23

But in the filtered deck, it’s wrong.

&card.days_since_last_review(&timing).unwrap_or_default() = 24857

@dae

1 Like

Beta 3 is now available: Releases · ankitects/anki · GitHub

Please bear in mind that focus is on functionality at this point, and not all of the UI comments have been addressed yet.

Yes, if we do display them, it should be this way, because that allows the defaults to be adjusted over time.

Custom study still works with the built-in FSRS, so you can just put that code into the custom study section.

3 Likes

If you ever truncated your review logs or used ‘set due date’ to introduce new cards into review, it’s recommended you disable FSRS, save, and re-enable it to ensure the correct memory state is set.

On beta 3 optimal retention computed is still noticeably different than one from web optimizer.
For the same deck with the same weights web version is proposing 0.85, while built in version is proposing 0.80.

Maybe [BUG] Potential inconsistency in optimal_retention.rs · Issue #79 · open-spaced-repetition/fsrs-rs · GitHub?

Not sure if that’s it. Built-in optimizer tends to give me much lower results, since beta 1. I’ve got 0.75-0.82 recommendations for different decks, while web version is recommending values in 0.85-0.93 range for the same decks.
With such difference it starts to become questionable, which value is more beneficial, if any.

Some of the difference is from incorrect stats queried by the built-in version. It has been solved by

Another difference is due to the loss aversion factor, which only applied in the web optimizer. I will add it into the built-in version soon.

1 Like

Probably this belongs in a git issue rather than here, but large enough values in the optimal retention simulator provokes an error message TypeError: Failed to fetch, which is potentially an issue for those of us with large decks and long time-spans in mind.

Even with comparably low values, the window freezes up and becomes unresponsive for me (Qt6, Linux, xorg) but typically completes - I don’t really care, though it might bother some people.

But if I raise the values, though I am typically given a value for optimum retention, it is typically not what I would expect (lower vs. a slightly shorter learning time, ie. it seems to deviate from the expected curve), and the value of % complete is typically around 80% (though sometimes 100%), making me think the process aborts early, and then the error is shown. I’m not sure how to access further debug info. Sometimes the error isn’t shown, but the process seems to have aborted at 80%, and the button to transfer the output retention, though the number changes, is greyed out and unclickable.

This, for example, happens with a deck size of 10000, a learning period of 10 years, and 120 max minutes per day of learning.

Resource consumption during this is not what I would call extreme - 2.56GB RAM (far less than I have to spare, or than my browser uses), 100% of one CPU thread.

If the FSRS Script is present in Custom Scheduling and there are weights in the “Model Weights” box and Desired retention filled, which one will take precedence?

Also, when does FSRS reschedule cards based on this?

Custom Scheduling. Because it is the last one to execute.

Once you update the helper add-on, it will read the weights from “Model Weights” box.

While computing optimal retention for larger deck and a long time I’ve got the result calculated, but then the small window with the error “TypeError: Failed to fetch” appears.
I’ve tried to close it dozen of times, but it still reopens. I had to force quit the Anki process.
Parameters I used, that caused the error:
Deck size: 20700
Days to simulate: 3650
Target minutes of study per day: 60

I am using MacOS 13.6, Anki 23.10 beta 3. If I can do something additional to catch the bug please let me know.

I also reproduced this bug in the latest commit.

1 Like

I believe so, yes. Stability isn’t exactly the same as interval length, and it is recalculated if parameters are changed. Plus, it’s just strange that D and R have graphs, but S doesn’t.