import torch


def evaluate_nll(confidences: torch.Tensor,
                 true_labels: torch.Tensor) -> float:
    """
    Args:
        confidences (Tensor): a tensor of shape [N, K] of predicted confidences.
        true_labels (Tensor): a tensor of shape [N,] of ground truth labels.
    
    Returns:
        nll (float): average negative-log-likelihood of predictions.
    """
    nll = torch.nn.functional.nll_loss(
        torch.log(1e-12 + confidences), true_labels
    ).item()

    return nll