A loss function measures how wrong the model is at a certain prediction. The choice of a good loss function can significantly improve the training process and final performance.