1
1

More than 3 years have passed since last update.

Attention Is All You Need のQuery, Key, Valueは、Query, Query, Queryぐらいの解釈でも問題ない(と思う。)

Last updated at Posted at 2021-02-11

概要

以下の記事などで示しているように、単なる興味で、論文「Attention Is All You Need」を理解しようとしている。

Attention Is All You Need の 『Attention』を、段階を踏んで、理解する手段

第一段階の目標として、

query,key,value:tada:に慣れる

を設定していたが、
いまさらのように、ちょっと、気づいたことがあるので、記事にする。

Query, Key, Valueは、Query, Query, Queryぐらいの解釈でも問題ない(と思う。)

本来のQuery, Key, Valueとは

本来のQuery, Key, Valueとは、以下の論文等にあるように、
Key-Valueのペアを利用して、Queryに対応するValueを得る(上手く検索したりする)ものだと思う。

https://arxiv.org/pdf/1606.03126.pdf
Key-Value Memory Networks for Directly Reading Documents

attentionのQuery, Key, Valueとは

全然、違う!
何が違うとかというと、

  • 準備されたkey-valueのペアがあるわけではない。

とにかく、全然、違う。
keyとvalueの値が同じ特殊形と考えることができるのか???

参考

以下の記事などは、参考になるかも。
この記事は、粛々と説明がされている。
What exactly are keys, queries, and values in attention mechanisms?

結論

Attention Is All You Need のQuery, Key, Valueは、Query, Query, Query :tada:ぐらいの解釈でも問題ない(と思う。)

まとめ

特にありません。

参考(自分の関連記事)

自己注意Self-Attention の解説でわかりやすいと思った記事N選 (まだ、N=8)

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1