Skip to content
ml-recall

#text-generation

3 questions from Language Modeling, LLM Fundamentals & Prompting

Timed test

3 questions · 3 min · score and explanations at the end

Take a test
Q 1 / 3Score 0 / 0

Question 1: True or false

mediumAI-checkedLanguage Modeling

This loop generates 100 tokens:

input_tokens = tokenizer.encode(prompt)
with torch.no_grad():
    for _ in range(100):
        logits = model(torch.LongTensor(input_tokens).unsqueeze(0)).logits[0, -1, :]
        probs = nn.functional.softmax(logits, dim=-1)
        top_token = torch.argmax(probs).item()
        input_tokens.append(top_token)

True or false: dividing logits by a temperature of 0.2 before the softmax would change which tokens this loop generates.

Choose one option