Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider the time period between card creation date and first review date in S0 calculation #713

Open
user1823 opened this issue Dec 4, 2024 · 12 comments
Labels
enhancement New feature or request research spaced repetition algorithm research

Comments

@user1823
Copy link
Collaborator

user1823 commented Dec 4, 2024

Consider three cards:

  • Card 1: Created and rated Good today
  • Card 2: Created 1 week ago and rated Good today
  • Card 3: Created 1 month ago and rated Good today

Currently, FSRS assigns the same S0 to all of these cards. But, if we can find a way to use the time period between card creation date and first review date in calculating S0, we can assign a higher S0 to Card 3 than Card 2 and Card 1.

Obviously, this feature will be useful only for people who make their own cards and not for those who use pre-made decks. But still...

@user1823 user1823 added enhancement New feature or request research spaced repetition algorithm research labels Dec 4, 2024
@Expertium
Copy link
Collaborator

Expertium commented Dec 4, 2024

I don't think that's possible

  1. As far as I know, in Anki we can't access the card creation date during optimization anyway
  2. Even if we can do 1, we can't distinguish between pre-made cards and cards made by the user himself
  3. I can't think of any meaningful way to incorporate this into S0

@brishtibheja
Copy link

brishtibheja commented Dec 4, 2024

After spending this year in the forums, I think most users make their own cards rather than get shared decks. Could be useful for a lot of people.


Just throwing an idea out there, note modification date might be better than card creation? You can modify a note to change the flashcard's formulation. Or you may cloze some additional parts of the note to create new cards.

@user1823
Copy link
Collaborator Author

user1823 commented Dec 4, 2024

As far as I know, in Anki we can't access the card creation date during optimization anyway

card creation date is deduced from cid, which is obviously available

we can't distinguish between pre-made cards and cards made by the user himself

In general, the time difference would be much larger for pre-made cards. Just for research purposes, one can filter out cards whose first review was done at least 1 year after card creation date. Once we get some idea on how to use the info, we can develop a better filter.

I can't think of any meaningful way to incorporate this into S0

One crude idea:
Let (first revlog id - cid)/(86400 * 1000) = x

For each first rating, group cards by x.
In each group, calculate S0 just like we do it now.

For each first rating, find a curve that fits the S0 values for each value of x.

@Expertium
Copy link
Collaborator

Oh, so cid is a unix timestamp? Interesting, I didn't know that.

I don't understand your suggestion, though. Wouldn't that result in having to calculate tons of S0's for every possible x? X is days between the card creation date and the first review, right?

@user1823
Copy link
Collaborator Author

user1823 commented Dec 4, 2024

Wouldn't that result in having to calculate tons of S0's for every possible x?

Yes, but after that, we can try to find a curve that fits most of them.

Oh, so cid is a unix timestamp? Interesting, I didn't know that.

In Anki, almost every type of id is a unix timestamp.

@Expertium
Copy link
Collaborator

Yes, but after that, we can try to find a curve that fits most of them.

Can you write some Python code or pseudocode to make it easier to understand exactly what you have in mind?

@user1823
Copy link
Collaborator Author

user1823 commented Dec 4, 2024

I still don't know how would the data (S0 for each X) look like. Once the data is available, we can try to find a function that can relate S0 and X so that we won't have to store the values of S0 in the parameters. After that, we will just need to store the 1-2 parameters that will be required in that function.

@Expertium
Copy link
Collaborator

Alright, but I still don't think that this is better than just calculating S0 the way it's done right now.

@user1823
Copy link
Collaborator Author

Just to record my thoughts:

I still don't think that this is better than just calculating S0 the way it's done right now.

When the user makes a card themselves and reviews it in Anki, they are not using Anki to learn the information. Rather, they are using Anki to retain what they have learnt from other sources.

So, if the first rating is Good, it means that they could successfully recall what they learnt earlier outside Anki. So, realistically speaking, we are calculating the next stability and not the initial stability.

Clearly, the next stability depends upon the previous stability (the one before the first rating). Unfortunately, we don't have a good way to measure the previous one. But, at least, we can say that the cards rated Good after 30 days will, on average, have a greater stability than the cards rated Good after 7 days.

Currently, FSRS treats these cards in the same way. Calculating the S0 separately after grouping the cards by number of days between card creation and first review will likely improve the calculation of S0.


A quick and dirty way to test this idea:

  • Group the cards by number of days between card creation and first review (x)
  • Use the current formula to calculate S0 for each group and prepare a matrix containing S0 for each rating and x.
  • Use this matrix to get the S0 for calculating the subsequent memory states.

Advantage over the previously proposed method:

  • It can be done quickly (for testing); we don't need to spend time thinking about the relation between x and S0.

Disadvantages over the previously proposed method:

  • Can't be used in Anki (the matrix is too large to be stored in Anki)
  • Some groups will have low number of cards, which can make this more susceptible to noise. Using a mathematical relation (as previously proposed) will solve this issue.

@DerIshmaelite
Copy link

When the user makes a card themselves and reviews it in Anki, they are not using Anki to learn the information. Rather, they are using Anki to retain what they have learnt from other sources.

That is not true. There are people (I for one) who are using Anki as the starting point from which people begin to acquire information.

@user1823
Copy link
Collaborator Author

user1823 commented Dec 14, 2024

If you are creating your own cards, you must first see that information outside Anki, right? It's ok if you don't know it that well but you still know it at the time you are creating the card.

Even if I my assumption about your use-case is wrong, there are at least some (or maybe even many) people who Anki to retain the information learnt outside Anki.

I believe that my suggestion would significantly improve the accuracy of FSRS for them. Once we have it working, we can discuss how to identify the users who Anki in this way.

@Expertium
Copy link
Collaborator

Honestly, I highly doubt it will be worth it, and it will probably be very difficult to figure out how to calculate the new S0. So unless Jarrett wants to work on it, I don't think this will be done, since I don't see the point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request research spaced repetition algorithm research
Projects
None yet
Development

No branches or pull requests

4 participants