Could you give detailed implementation of your model. One possibility is the mismatch between the ground truth labels and the predictions.
But there is a high chance that you missed a linear layer to convert hidden output of LSTM to class prediction.
Try the following:

class Model(nn.Module):

    def __init__(self, input_size, output_size, hidden_size):
        super().__init__()

        self.lstm = nn.LSTM(input_size, hidden_size, batch_first=True)
        self.linear = nn.Linear(hidden_size, output_size)
    
    def forward(self, x):
        out, (hn, cn) = self.lstm(x)
        # out shape: [bs, seq, hidden_size]

        logits = self.linear(out)
        return logits

Hidden states are initialized by default.