I am a long-time Anki user and current Ph.D. student. In part prompted by this post on reddit, I’ve been thinking about how one might experimentally tweak the Anki scheduling algorithm. The most straightforward way one might try to find optimal spacing parameters would be just to run an RCT, but it seems possible to do better than that.
In particular, one direction that seems like it might be sensible would be to develop a scheduling bandit. This is not entirely trivial—at first blush, it seems like to get decent results, you might have to do something with hierarchical models and try to pool across decks (within each individual user) and across users.
From an implementation perspective, the former (pooling across decks) doesn’t seem like it would be especially difficult, but the latter (pooling across users) seems potentially thorny. In particular, I don’t see how you could accomplish that completely “client side.” One solution would be to create an add-on which overrides the default scheduling algorithm and does (something like) the following:
- Every time a user answers the card, it posts the user (or, say, a hash of their AnkiWeb user ID), the deck, and information about the card (e.g., number of previous failures, whether the most recent answer was correct, etc.) to an API.
- The bandit uses the information to choose the next review interval, which is sent as the response to the API request.
- The user’s local copy of Anki uses the response to schedule the next review interval.
Step 2, since it happens completely server-side, isn’t an issue from an implementation perspective. Likewise, my sense—which could be completely wrong—is that it would be reasonably easy to use existing hooks to implement Step 3. However, I don’t have a clear enough understanding of the Anki source code to understand what is involved in Step 1. For instance, is it possible to simply import the python
requests library or
urllib to handle the API call? Base Anki obviously does something similar to this to sync with AnkiWeb, but I don’t know exactly how that functionality is implemented.
If that’s true, it would seem like something like this wouldn’t actually be prohibitively difficult to put together. (Not to say that spinning up a server and API for the bandit is necessarily a snap, but there’s no question that that’s possible to implement.)
Thanks! Also, if this or something similar has been tried before, please let me know!