Well, what is instinct? It is an inherent behavior, right?
So, one would think that if it were instinct, they'd already know what leaves are bad and not collect them. But a specific colony actually learns after collecting a bad leaf once. It's not pre set, since they collected the leaf unaware and then discover that the leaf is a bad leaf.
So, in essence, they are able to adaptively monitor the condition of the fungus, and have some type of memory of what leaf they collected, and make the connection that this leaf out of the millions of other leaf types is related to the condition of the fungus.
Sure maybe they don't think it out in their little ant brains like a human does, but they don't need to. It follows though that for such adaptive behavior, they must have some type of memory, the ability to identify leaves, connect them to the state of the fungus - possibly in combinations that have not been tried before, making instinct kind of no help, trial and error - and they have some mechanism that forbids them from collecting the leaf again after the initial mistake, which is avoidance of a future consequence. They have to identify the leaf, which means they somehow have to remember it, in order to not collect it.