Skip to content
ml-recall

#next-token-prediction

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: Short answer

mediumAI-checkedLLM Fundamentals & Prompting

The book's dataset cuts a tokenized text into input/target pairs with a sliding window:

token_ids = list(range(100, 110))          # 10 token IDs
max_length, stride = 4, 2
inputs, targets = [], []
for i in range(0, len(token_ids) - max_length, stride):
    inputs.append(token_ids[i:i + max_length])
    targets.append(token_ids[i + 1:i + max_length + 1])
print(len(inputs), targets[1])

The last line prints (the number of pairs) and a list whose first element is .

Fill in every blank (hints in the boxes). Enter moves to the next blank.