NumPy allowed · plain Python earns 10 bonus points
Q · Kᵀ / √d scores normalized with softmax
Implement perplexity computation — the standard metric for evaluating language model quality, measuring how well the model predicts held-out text.
Implement compute_perplexity(log_probs) that computes exp(-mean(log_probs)) from per-token natural log-probabilities.
compute_perplexity(log_probs: list[float]) -> float