NumPy allowed · plain Python earns 10 bonus points
Softmax(logits) → probability distribution
Implement standard greedy autoregressive decoding by selecting the argmax logit with stable softmax confidence.
Implement greedy_decoding_step(logits). Find the token index with the highest logit (breaking ties by lower index). Compute its softmax probability using numerically stable subtraction of the maximum logit, rounded to 4 decimal places. Return a dict with keys chosen_token (int), is_deterministic (bool, True), and confidence (float). Raise ValueError if logits is empty.
greedy_decoding_step(logits: list[float]) -> dict