minGPT icon indicating copy to clipboard operation
minGPT copied to clipboard

Strange model behavior when taking the softmax in the wrong dimension

Open Cloud299 opened this issue 4 months ago • 0 comments

https://github.com/karpathy/minGPT/blob/37baab71b9abea1b76ab957409a1cc2fbfba8a26/mingpt/model.py#L64

I accidentally changed the softmax dimension to -2 instead of -1 and got incredibly low losses on both the training and validation set when using the tiny_shakespeare dataset. However, when generating from the model, I get very low-quality result. What is the explanation ?

My guess is that I'm somehow leaking information when taking the softmax in the wrong dimension, which may explain why the training loss is very low. However, I don't quite get why validation loss would also be low.

image

@karpathy Any idea why this is the case?

Cloud299 avatar Feb 14 '24 17:02 Cloud299