You’re right to observe that not every sample within the given batch (or minibatch) is treated the same in any given iteration. Here’s a thread which talks about that point and also if you read all the way through shows some experiments which demonstrate that it doesn’t make that much difference if you treat all the samples in the batch the same.