Thanks Thomas, really appreciate your reply!  Probably I didn’t explain myself well: I assume perfect_prediction is more similar to ylabel than predict blank, since perfect_prediction contains a prediction path that is exactly the same as ylabel, while predict_blank will only be reconstructed as a empty sequence.  If this is right, then why perfect_prediction will ever have a higher loss than predict_blank? (The former should always have lower loss, no?)  The experiment on the changing length is less relevant, I’m just surprised this behavior is not monotonic and is related to input_length.
BTW, do you mind explaining ‘So if you need enough blanks, assigning a high probability to them will reduce the loss’? Maybe I’ve missed some part.
The context here is: I’m training an OCR model with CTCLoss, and during training I can see the loss goes down but the model just keep predicting all blanks (seems other people also have similar observation), and I’m not sure where the bug is, which leads to my above loss comparison.