Bird
0
0

Which of the following is the correct Python expression to apply temperature scaling to logits before softmax?

easy📝 Syntax Q3 of 15
NLP - Text Generation
Which of the following is the correct Python expression to apply temperature scaling to logits before softmax?
Ascaled_logits = logits / temperature
Bscaled_logits = logits * temperature
Cscaled_logits = logits + temperature
Dscaled_logits = logits - temperature
Step-by-Step Solution
Solution:
  1. Step 1: Recall temperature scaling formula

    Logits are divided by temperature to adjust sharpness before softmax.
  2. Step 2: Check each option

    Only dividing logits by temperature matches the correct formula.
  3. Final Answer:

    scaled_logits = logits / temperature -> Option A
  4. Quick Check:

    Divide logits by temperature to scale [OK]
Quick Trick: Divide logits by temperature, never multiply or add [OK]
Common Mistakes:
MISTAKES
  • Multiplying logits by temperature instead of dividing
  • Adding or subtracting temperature to logits
  • Confusing temperature scaling with bias addition

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NLP Quizzes