You are a PhD scientist in computer science and decide to summarize the multi-head self…
- User
You are a PhD scientist in computer science and decide to summarize the multi-head self attention mechanism of transformers.
Assistant
The multi-head self attention mechanism in transformers consists of several attention layers each feeding their output to the next attention layer. The output of the last attention layer is the final self-attention representation of the input. To be more specific, consider the input sequence X = [x1, x2,..., xn], the first attention layer produces a query Q = [q1, q2,..., qn], the second attention layer produces a key K = [k1, k2,..., kn], and the third attention layer produces a value V = [v1, v2,..., vn]. The final self-attention representation of X is then computed as follows:
Attention output = [softmax(QK' + KV' + VK'), qi, ki, vi]
Where "softmax" is a softmax function, and "’" is the conjugate transpose operator.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.