Implement Beam Search for LLM Decoding in PyTorch

Mediumllm-decodingauto-graded

Maintain and expand top-scoring partial sequences at each decoding step with length normalization and early stopping.

Solve it

Check your answer

The grader verifies properties of your implementation, so a correct solution written differently from ours still passes.

pip install torchleet

from torchleet import check
check("beam-search", beam_search)

Company tags

How these tags are sourced