0
$\begingroup$

I read here:

Attention is a generalized pooling method with bias alignment over inputs.

What do they mean by bias alignment?

My understanding is that Attention (full diagram below) is a circuit where the output is a weighted sum of values from a K-V store, where input queries can be compared with keys. This query-key comparison can be done in a number of ways and is often called the Attention layer (depicted as a white box below).

Is this a correct interpretation? If so, what's the bias, and what do they mean by alignment?

               

$\endgroup$
1
$\begingroup$

Attention is a generalized pooling method with bias alignment over inputs.

I would suggest not to dwell on that if you understand the maths. I think it's a bad phrasing that you're meant to parse "[bias [alignment over inputs]]" (not a compound of "bias" and "alignment"). Bias here is taken to mean "inductive bias", not parameters that bias an output.

The rest is correct. I'd call "attention layer" all the parameters and the computation in general thanks to which you obtain the output (the weighted sum).

$\endgroup$
5
  • $\begingroup$ Thanks. Where does the inductive bias come from? And is that bias desirable and learned? $\endgroup$
    – Josh
    Jun 24 '20 at 18:40
  • $\begingroup$ Do you know what an inductive bias is? It is a very vague term that means "whatever design/prior/mechanism is put in your algorithm to make you learn a task". It is not learned, it is something engineered and specified before learning (except in meta-learning: you could argue that at the object level, the inductive bias is learned). Inductive biases are specific to certain tasks: the no-free lunch theorem says that there is no algorithm that is good at learning every distribution. $\endgroup$
    – bomzh
    Jun 24 '20 at 18:44
  • $\begingroup$ The attention mechanism was invented by Bahdanau & al. specifically for machine translation, because they thought that this would compute a soft-alignment. Some people have disputed this view since then. But whatever happens behind the hood, this bias IS definitely super useful and is now pervasive in NLP (and more broadly, in ML?). $\endgroup$
    – bomzh
    Jun 24 '20 at 18:46
  • $\begingroup$ Thanks, got it. When you wrote "Some people have disputed this view since then." what were you referring to? (that attention would "compute a soft-alignment", or that it was actually introduced first by Bahdanau et al.?) $\endgroup$
    – Josh
    Jun 24 '20 at 19:45
  • 1
    $\begingroup$ Yes, the first claim: "compute a soft-alignment". For example, this paper (haven't read): What does Attention in Neural Machine Translation Pay Attention to?, Ghader and Monz (2017). $\endgroup$
    – bomzh
    Jun 25 '20 at 0:00
0
$\begingroup$

Not sure but bias alignment might refer to the detail that both query and keys vectors are offset by positional encoding, i.e. the attention query can be specified more like: "[How] is this source token, with respect to it's position, related to this target token with respect to it's position?".

But more likely the wording is supposed to be interpreted like what bomzh explained in his answer.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.