Anki unable to pickup up new cards at RANDOM order

I have so much trouble in getting Anki present new cards at random order. I have this options

<I’ll paste in next post, there;s some limit>

And it seems to work initially. But If I make any shifting of cards between decks (typically combining items into one bigger deck), this starts to fail and is not random at all.

The only thing that works for me is using “Random Sequential Order” - this shows a warning that it is not recommended with v3 scheduler. But this in turn requires me to turn this option on and off all the time, after moving cards arounds decks or importing new cards (from CSV). And also I read you consider removing this option.

Is this a bug? It looks to me Anki doesn’t pickup cards randomly, but maybe tries some weird strategy instead, which for me fails entirely.

Here is a deck which I just attempted to study. Vefore study, it contained 187 “new” sentences, each with one of 3 words. Of course I hope for some random distribution, like seeing a couple of sentences with one word, and then some with the other. Not 20 with the same word in a row.

And here is detailed look after learning some items or so. As you see, Anki only pulled ~17 sentences with “yue” word (visible over “Due” column"), and nothing for other words. Screenshots altogether show complete list.

I know everything can happen when things are random, you can get 10 heads if you flip a coin sometimes. But I have same situations all the time, every single day. What am I doing wrong?

Here are my deck settings:

My deck settings:

  1. Are you sure that all of your decks are using this preset? Since this is about Display Order settings, the deck that matters is the parent deck you click to study, not necessarily the subdeck the cards are actually in.
  1. Were any of the notes/cards created or moved to the deck after you studied on this particular day?

  2. I notice that all the cards in your screenshot are "Card 2"s. Where are their Card 1 siblings?

  3. Have you run Tools > Check Database lately? If your New-queue is struggling, that might set it right.

1 Like

Thank you for taking time to answer. Somehow the forum didn’t send me any email, when you answered. Just got one now with “forum summary”.

I think all my settings were right in deck settings. I feel like there’s something weird going on when you move many cards from one deck to another.

As for “Card 2”, I just decided to only use this one, and thus configured Card 1 to be empty, which makes Anki not generate this card from a Note.

But anyway, I now switched to a very different way of learning where I don’t need randomness, I rather want cards to appear sequentially and this works fine for me.

Old topic was marked as “solved”, link is here: https://forums.ankiweb.net/t/anki-unable-to-pickup-up-new-cards-at-random-order/67609 so I make a new one. It turned out I need randomization feature again. And I hit the problem immediately.

I was able to reproduce the problem in a small isolated scenario.

Please see the video: https://youtu.be/ZtEDolztnk8 . In the video:

  • I learn 25 new “A” items (out of 50)
  • I add 25 “B” items.
  • Settings tell to pick “new” cards first. So now I have 25 new “A” cards, and 25 “B” cards, 50 in total.
  • I would think that probability of selecting “A” or “B” should be 50%
  • But Anki pulls 13 “B” cards in a row.
  • And it does it always, super repeatable.
  • This happens always when more learning material is added.

I also made a collection package, which can be used for testing: drive.google.com/file/d/18TeBxEPc2PcYuUgBjjZWksiOjoCkcZxu/view?usp=sharing

In the package, there are 50 new items to learn (25 “A” and 25 “B”). You can hit on “Study” in a parent deck, and see Anki presenting only “B” cards for a long time.

Why is this happening?? Drives me nuts.

And a bit of explanation, on why this is a problem. For me, whenever I add more “learning material” to what I already have, Anki will only present me this added material for a long time. Although there is still a lot of “new” items from old batches, it will only show me what I just created. This isn’t random at all.

And it works this way independent of how I organize my things. In video above, “new material” (B) was in a subdeck. But there would be exactly same problem, if I would just add new material to the same deck. Actually this is very easy to test with the collection package I attached (I just tested).

Also, whenever I run this test, Anki seems to pull 13 “B” cards, before coming to “A”.

Why is 13 such a magic number? I don’t know.

But your base isn’t clean. Okay, I tried checking 5 in one subdeck and 5 in another subdeck.
I run it once, and the order is:

b2, a3, b4, a2, a4, b1, b5

(Do you have the same order? This is important to understand.)

If I load the collection again and try again, the order will still be the same.
Even if I run each subdeck separately, the order will be the same (for cards that are, of course, part of the deck).
I can’t dig deep into the source code, but if you look at the deck’s database, it’s completely unclear why these specific cards are given in this order, and it doesn’t change, so there’s no question of any randomness.

Before launching, save your entire collection or better yet, launch it on a separate test profile!!!

drive.google.com/file/d/1pzxEhNTa2DhP0DmjzUtgpJy6Y91e6PAw/view?usp=sharing

I de-linked your link, because you shared a COLPKG file. No one should import a COLPKG of someone else’s collection, because importing it will overwrite their entire collection. There are not enough warnings in the world to make that worthwhile. If you want to share something useful, please make it an APKG.

1 Like

That’s what the author did and posted his: randomization_problem.colpkg

And he didn’t even warn me, so it’s good that I’m running it on my test machine.

So his link should be deleted too.

File: “D.apkg“

I’m sorry for the wrong file, I wasn’t aware of it.

Here’s apkg just in case it is needed, now with no learning done yet: https://drive.google.com/file/d/1CNMEjD8Nd2cTiQgt66Y0EeoET4woRniG/view?usp=sharing

This time database has completely reset progress:

Now another way to simulate the problem is just to learn 25 items out of the “a” deck. Select “a”, click “Study”, then go through 25 items (I answer “Again” always). Then we get this:

And now we have 25 “new” items of “A” and 25 “new” items of “B”. I select “Some deck” and study, and expect items to come in random order. But I’m only getting “B” items first. Just did this test, got “B” 10 times. And I’m there:

Video: https://youtu.be/gRWxvsukBYk

Few more observations

  • today I’m getting 10x B, while yesterday I was getting 13x B. Not sure why it’s different today, but it is very consistent among the day.
  • actually, I just found that whenever I do this test (reset progress for all items, study “a” deck 25x, then start to study parent deck), I’m always getting items in same order. Just like in the video above. B17, B4, B11, B18, B14, B10, B23…. always same order.
  • also if I study deck “a” on fresh database (items reset), I also get same order always, A3, A21, A37, A30, A26, A10… Same order each time.

I wonder how “random notes” option works then?

I think I don’t understand what you mean by “checking 5 in one subdeck and 5 in another subdeck.” but happy to do the test once I know.

One more thing, I’m sorry for typing so much.

To me, it looks like Anki, instead of trying to pick items randomly, rather tries to create a nice “distribution”. So if you have a list of - let’s say - 100 items, Anki tries to pull items to learn in a way so there are no “big areas” of “new” items in this list nor there are “big areas” of “reviewed” items. So “new” and “reviewed” items distribute nicely among the whole list.

But then, if you add new items to the list, you suddenly create a big “island” of new items, all in one area, of the list, and this makes Anki pull items only from this area to make “distribution” nice again.

That’s just a theory, but it looks like that to me.

Perhaps so, but I can’t easily access the planner.
You yourself previously wrote that simply sequentially is better. Often, data is simply arranged in order, and it’s important to study it that way. And when you study, the cards will already be in their order anyway, and there’s no point in this randomness or pseudo-randomness.
So, I tested it by changing the time by 1 day, by several hours, by 2 days, and by setting the deck to the previous day and playing through the deck now.
The test revealed that it doesn’t depend on the deck’s creation time, and the randomizer works based on your computer’s current time, though not exactly to the minute, but most likely there will be a difference after an hour.
And it doesn’t necessarily generate cards evenly from both decks. No, it could have been:

a3, a4, a2, a5, b2

although there are 5 cards from subdeck A and there are also 5 cards from subdeck B.

I haven’t tested how it would work in complex cases like yours, but perhaps there’s some logic to it.
And if this method bothers you, it’s easier to do as others do: gradually add cards and go through, say, 10. You can also filter; I’m currently going through one deck this way, simply highlighting which ones need to be studied with a red flag, and then I study those. Once I’ve learned them, I’ll mark them green if it was difficult, then orange. Something could be worked out. Some people only keep cards for studying and make long settings for their progress:

1m 10m 1h 6h 1d 3d 7d 21d

So I even made an addon for them: https://ankiweb.net/shared/info/1873164405

No, this must be a misunderstanding. I didn’t write sequential is better, it depends what you learn. I changed how I organize my material and sequential isn’t an option at all now. I need randomization.

So, I tested it by changing the time by 1 day, by several hours, by 2 days, and by setting the deck to the previous day and playing through the deck now.
The test revealed that it doesn’t depend on the deck’s creation time, and the randomizer works based on your computer’s current time, though not exactly to the minute, but most likely there will be a difference after an hour.
And it doesn’t necessarily generate cards evenly from both decks. No, it could have been:

a3, a4, a2, a5, b2

although there are 5 cards from subdeck A and there are also 5 cards from subdeck B.

But how did you make the test?

Crucial part is that some items are already reviewed. This confuses Anki. In my artificial case, 25 “A” items were already reviewed once. And then, trying to learn both “A” and “B” makes Anki only show “B” cards for a very long time.

Today, out of 50 items (25xA and 25xB) Anki again pulls B all the time, for 13 times. Todays winning sequence is B4, B15, B21, B13, B9, B2, B8, B5, B1, B11, B16, B12, B24 and only after that there’s the first A card shown.

And of course problem is much bigger with more cards, I can see Anki stuck for 50 cards at some items you just added, completely ignoring the rest.

And if this method bothers you, it’s easier to do as others do: gradually add cards and go through, say, 10. You can also filter; I’m currently going through one deck this way, simply highlighting which ones need to be studied with a red flag, and then I study those. Once I’ve learned them, I’ll mark them green if it was difficult, then orange. Something could be worked out. Some people only keep cards for studying and make long settings for their progress:

I’m sorry but this can’t work for me. I obviously don’t learn A’s and B’s, but describing my process I think is out of scope here. At the end I worked hard to find an isolated, easy to reproduce scenario to show the problem :slight_smile:

As of now, the only way to get some better randomness is to set “Insertion order” to random, and I really hope developers don’t remove this option, until v3 scheduler gets better randomization. This option also acts weird at times, but I think it doesn’t make sense to look into this, as it is outdated now.

Damn, I just tried “Insertion order” on this sample database and it’s having same problem, and even pulls B cards at same order :frowning:

So, instead of doing this first, we need to copy the deck, then run it and actually check that 13 in a row is rolled. Then we can try to replicate it. For now, I can’t say that everything is the same for me.
The example you previously provided, randomization_issue.apkg, doesn’t allow me to identify a similar problem.

No no, no need to copy.

Just make sure everything is set initially so there are 75 new items to learn this day.

Then learn 25 from deck A.

Then start learning from “Some deck” and see only B cards coming.

I found the randomization algorithm not only doesn’t randomize, but rather fixes card to some weird order. It also makes it even if you randomize cards some other way. I can randomize cards by using random sequential order. I can also randomize them with “Reposition…” function. But having “random” set in the scheduler will anyway bring it back to this weird order. This is super weird.

So far I think I found a workaround for me. Disable randomness in the scheduler entirely. And instead use this anytime I add new learning material:

If you’ve found a solution, that’s great.
But I’ve run tests, and there really is an effect, just as you’d expect: that while it’s random, it balances out the results so that each deck is studied equally.
Initially, it’s 50/25, and if I only study deck B, it becomes 50/5. Then, I want to study both, and I get 35-40 in a row from deck A.
It was 50/25, but now it’s 13/5—meaning the algorithm maintained the balance of new cards in each subdeck and didn’t allow one or the other to be overly biased, and all subdecks will be studied evenly with this algorithm.
I think they did the right thing. And if you want to bias your learning, always study the subdecks yourself in the order you need.

Exactly, this is what I’m getting.

Except, that Anki isn’t equalizing items in decks. If you mix A + B items in the same deck, and half of “A” is already reviewed (because, for example, you add B to the deck later), result is exactly the same. It will pull B all the time.

And I think it’s not a great thing at all. It isn’t random, and it has 2 major problems.

If you look at some of my decks:

These are sentences to study, on different “language islands”. It’s called Pinterest2 because sentences describe photos from there.

And now there are 2 big problems:

  • whenever I add new material, either a new “language island” (in a subdeck), or just add a lot of sentences to one of existing decks, then learning parent deck (Pinterest2) will only show me this new material, for a long time.
  • If I study one of subdecks directly (like “kitchen”) because I feel I need to learn it more, then later, when studying “Pinterest2”, it will NOT include “kitchen” items for a long time.