Skill Zuno · skillzunos.com · AI
Transformers interview questions
Prepare for Transformers interviews on Skill Zuno. This practice book covers Transformers interview questions across New, Easy, Medium, Hard, and Diff levels so you can work through real interview-style problems on skillzunos.com.
Open Transformers on Skill ZunoAlso see the Transformers tutorial.
The transformer is the neural network architecture behind modern language models, introduced in the 2017 paper 'Attention Is All You Need'. It replaces recurrence with self-attention, which lets every token attend to every other token and allows highly parallel training. Interviews cover self-attention, multi-head attention, positional encoding, encoder, decoder and encoder-decoder variants, and the cost of long contexts.
Sample Transformers interview questions
How does self-attention work?
Each token is projected into a query, key and value. Attention weights are the softmax of query-key dot products divided by the square root of the dimension, and each output is the weighted sum of values.
Why divide by the square root of the key dimension?
Dot products grow with dimension, which pushes softmax into regions with tiny gradients. Scaling keeps the values in a range where training is stable.
Why do transformers need positional encodings?
Attention treats its input as a set and has no built-in sense of order. Positional encodings, such as rotary embeddings, add information about each token's position.
What is the difference between BERT and GPT?
BERT is an encoder trained to fill in masked tokens using context on both sides, which suits understanding tasks. GPT is a decoder trained to predict the next token, which suits generation.
What is the KV cache?
During generation, the keys and values of earlier tokens are stored so each new token only computes attention for itself. It makes generation much faster at the cost of memory.
What you can practice
- Transformers interview questions for beginners and experienced developers
- Level-based practice: New, Easy, Medium, Hard, and Diff
- AI topics alongside Transformers on skillzunos.com