QUESTION 10 OF 10

Why do transformers need padding masks?

Reveal the answer and explore the explanation.

10
Hard

Why do transformers need padding masks?

Answer
Answer

Indicates positions that should not contribute as real tokens.

Practical example

Prevent a transformer from attending to padding.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As