This is because the loss function actually is logarithm over probability, so it should never be negative. It helps me find out a bug in my own implementation. This is the paper: https://arxiv.org/pdf/1603.01360.pdf 162