25/29
Part 6 of 6 · What interviewers ask nextLearn and do

A repetition penalty has to push down, whatever the sign

Another knob fights the repetition that greedy falls into.

logit, penalty = torch.tensor([2.0, -1.0]), 1.2
print(logit / penalty)
print(torch.where(logit > 0, logit / penalty, logit * penalty))
Predict

A repetition penalty of 1.2 should make both tokens less likely. What does dividing [2.0, -1.0] by 1.2 do?

Pick one to see what it prints.
Pick an answer above to see the rest