@techreport{oai:ipsj.ixsq.nii.ac.jp:00235092, author = {山本, 悠士 and 松崎, 拓也}, issue = {1}, month = {Jun}, note = {現在,Transformer は自然言語処理分野において最も人気のアーキテクチャであるが,その主要モジュールである Self-Attention の計算量は系列長に対して二次関数的に増加するため,長系列の推論に大きな計算コストを要する.一方,状態空間モデルに基づく言語モデルである Mamba は,計算量を線形に抑えつつ,Trasnformer に匹敵する性能を発揮したと報告されている.このため,長系列を扱うタスクにおいて,Transformer に代わる新しい選択肢として注目されている.本研究では,Mamba の主要モジュールである Selective SSM が帰納ヘッドタスクを実行する際の内部状態を分析した.ここで,帰納ヘッドタスクとは,トークンを生成する際に入力系列中の似た文脈から情報を取得する,いわゆる Few-shot のような状況を抽象化した人工タスクである.分析の結果,Selective SSM は入力系列中の bi-gram の表現を内部状態に記憶していて,同じ bi-gram の前半が再び出現した際に,記憶された bi-gram の後半の表現を出力していることが分かった., Transformer is currently the most popular architecture in the field of natural language processing, but the space complexity of its main module, i.e. Self-Attention, increases quadratically with the length of the sequence, making the inference for long sequences computationally expensive. On the other hand, Mamba, a state-space model-based language model, achieved a performance comparable to Transformer while keeping the computational complexity linear. Therefore, Mamba is expected to be an alternative to Transformer for long-sequence tasks. In this study, we analyzed the mechanism by which Selective SSM, the main module of Mamba, performs induction head tasks. The induction head task is a synthetic task that abstracts the so-called few-shot scenario, in which information is retrieved from similar contexts in the input sequence when generating tokens. We found that the Selective SSM stores the representations of the bi-grams in the input sequence in its hidden state and outputs the stored representation of the second half of a bi-gram when the first half of the same bi-gram appears again.}, title = {Mambaブロックが帰納ヘッドタスクを実行するメカニズム}, year = {2024} }