Skip to content
ml-recall

#end-of-sequence

1 question from LLM Fundamentals & Prompting

Timed test

1 question · 1 min · score and explanations at the end

Take a test
Q 1 / 1Score 0 / 0

Question 1: Single choice

mediumAI-checkedLLM Fundamentals & Prompting

The book's generate stops early with if idx_next == eos_id: break. You call it with a batch of two prompts, and at some step the next tokens are:

eos_id = 50256
idx_next = torch.tensor([[50256], [13]])   # shape (2, 1): one sequence just ended
if idx_next == eos_id:
    print("stop")

What happens?

Choose one option