プリンキピア

第11章注意機構とTransformer

11.1.3. Exercises11.1.3 練習問題

  1. Suppose that you wanted to reimplement approximate (key, query) matches as used in classical databases, which attention function would you pick?
    英語のヒント
    古典的なデータベースで使われるような近似的な(キー、クエリ)の一致を実装し直したいとしたら、どの注意の関数を選ぶか。
  2. Suppose that the attention function is given by a(𝐪,𝐤i)=𝐪⊤𝐤i and that 𝐤i=𝐯i for i=1,…,m. Denote by p(𝐤i;𝐪) the probability distribution over keys when using the softmax normalization in (11.1.3). Prove that ∇𝐪Attention⁡(𝐪,𝒟)=Covp(𝐤i;𝐪)[𝐤i].
    英語のヒント
    注意の関数がa(𝐪,𝐤i)=𝐪⊤𝐤iで与えられ、i=1,…,mについて𝐤i=𝐯iだとする。(11.1.3)のソフトマックスによる正規化を使うときのキー上の確率分布をp(𝐤i;𝐪)と表す。∇𝐪Attention⁡(𝐪,𝒟)=Covp(𝐤i;𝐪)[𝐤i]を証明せよ。
  3. Design a differentiable search engine using the attention mechanism.
    英語のヒント
    注意機構を使って、微分可能な検索エンジンを設計せよ。
  4. Review the design of the Squeeze and Excitation Networks (Hu et al., 2018) and interpret them through the lens of the attention mechanism.
    英語のヒント
    Squeeze and Excitation Networks(Hu et al., 2018)の設計を見直し、注意機構という観点から解釈せよ。