Upgrade to Pro — share decks privately, control downloads, hide ads and more …

論文読み会 SNLP2019 Ordered neurons: Integrating tree structures into recurrent neural networks

S
May 17, 2023

論文読み会 SNLP2019 Ordered neurons: Integrating tree structures into recurrent neural networks

第11回最先端NLP勉強会
Ordered neurons: Integrating tree structures into recurrent neural networks (ICLR2019)
https://sites.google.com/view/snlp-jp/home/

S

May 17, 2023
Tweet

More Decks by S

Other Decks in Research

Transcript

  1. Ordered Neurons: Integrating Tree Structures into Recurrent Neural Networks. In:

    ICLR 2019 Yikang Shen, Shawn Tan, Alessandro Sordoni, Aaron Courville 第11回 最先端NLP勉強会 Titech Okazaki Lab/Hottolink: Sakae Mizuki 2019/09/27 ※ スライド中の図表・数式は,断りのないかぎり本論文からの引用です ICLR2019 Best Paper 1
  2. Contents • Tree Structure and Neural NLP • Overview of

    the research • Objective, Novelty, Challenge,… • Methodology • Experiment • Conclusion 2
  3. Tree Structure and Neural NLP • 言語に内在する木構造の獲得/活用は,Neural NLPの一大目標. • 異なる抽象度の表現を獲得するため

    • 合成性・長距離依存関係をモデル化するため • 少ない訓練データで高い汎化性能を得るため • 関連タスクのひとつが grammar induction:平文からの文法獲得. しかし実用化途上である[Williams+, 2018][Yogatama+, 2016][Shen+ 2017] • またRNNは(陽的には系列処理にすぎないが)内部で統語構造を処 理するという報告もある[Gulordava+ 2018][Kuncoro+ 2018][Lakretz+ 2019] • したがって,冒頭の問は open question といえる. NNモデルに木構造のinductive biasを導入すると, 言語現象のモデル化に寄与するか? 定式化の原理/制約・正則化 4
  4. Related works • 木構造の導入は(長距離依存関係などに)有効である. • モデル:RNNG[Dyer+ 2016],Recursive NN[Socher+ 2013] •

    有効性の検証:[Kencoro+ 2018][Bowman+ 2015] • RNNの再帰処理を複線化して,階層構造を導入する試みがある. • モデル:Clockwork RNN[Koutnik+ 2014],[Chung+ 2016][Rippel+ 2014] 5
  5. Proposed idea in this research • RNNの内部状態ベクトルの各要素に,順序(order)をつける.つまり, 先頭要素が末尾要素よりも頻繁に更新される機構を導入する. • 系列学習を行うと,寿命を考慮した更新規則を獲得するのでは?

    • 長期記憶すべき情報が入力された場合は,内部状態全体を更新する. • 短期記憶すべき情報が入力された場合は,先頭付近のみを更新する. • この性質は,構文木の処理に相通ずるはずでは?(下図) RNNに取り込んだ情報の寿命を制御可能にすると, 木構造の処理が誘導・強化されるのではないか? 末尾 先頭 6
  6. Overview of the Research (1/2) • Novelty • ON-LSTM (Ordered

    Neurons LSTM) の提案 • Objective • 言語に内在する木構造を獲得/活用する統計モデルを提案すること • 当該モデルのinductive biasが有効に機能することを,実験的に示すこと • Challenge • 木構造(=構文木)を訓練データとして使用しないこと • 実用化に耐えうる,簡潔な定式化を用いること • Previous Approach • Grammar induction model,RNNの再帰処理を複線化 8
  7. Research Overview (2/2) • Key to the Success • Gate操作の構造化:Master

    input/forget gateの導入 • 説得力のある実験の設計 • Experiment Result • 教師なし構文解析タスク Gate操作(=内部状態の更新操作)が,構文木とよく対応付くことを検証 • 文法性判断・論理式推論タスク 長距離依存関係が関わる設定で,標準LSTMの性能を上回ることを検証 9
  8. ON-LSTM (Ordered Neurons LSTM) • ON-LSTMとは master input/forget gate を導入したLSTMのこと.

    • 通常のinput/forget gateも存在する.これは”original”と呼称しよう. • Input/forget gateの開閉はmasterとoriginalの協調により決まる.た だしmasterの判断がoriginalの判断に優先される. • i.e. 開閉の全体的な挙動はmasterが決める.詳細な挙動はoriginalが決める. 𝑪𝑡 (内部状態) output ベクトル ゲート input ෪ 𝑪𝑡 + forget master input master forget original forget original input 講演者による作図 11
  9. ON-LSTM:master gates • 以下では簡単のため,boolean{0,1}を用いてgate操作を説明(本来は実数) • master gatesの活性化関数(6)はcumax=cumsum+softmax. • cf. cumaxはCDFの近似のようなもの

    • cumax関数により,gateは 0の区間(閉) と 1の区間(開) に二分される. • forget gateは単調増加(0→1),input gateは単調減少(1→0) 名称 記号・式 gateの値 master forget ෩ 𝑓𝑡 0 0 0 0 0 0 1 1 1 master input ෩ 𝑖𝑡 1 1 1 1 0 0 0 0 0 14 ? ? (内部状態 ) output input ? ? ? + forget master input master forget original forget original input
  10. ON-LSTM:gate open/close operation • Input/forget gateの開閉(式12,13)はmasterとoriginalの協調により決まる…が master input/forgetの1(開)の区間が重ならない場合は,masterのみで決まる. 名称 記号・式

    gateの値 master forget ෩ 𝑓𝑡 0 0 0 0 0 0 1 1 1 master input ෩ 𝑖𝑡 1 1 1 1 0 0 0 0 0 (11) 𝜔 = ෪ 𝑓𝑡 ∘ ෩ 𝑖𝑡 0 0 0 0 0 0 0 0 0 original forget 𝑓𝑡 x x x x x x x x x original input 𝑖𝑡 y y y y y y y y y forget (13) ෡ 𝑓𝑡 = 𝑓𝑡 ∘ 𝜔𝑡 + (෩ 𝑓𝑡 − 𝜔𝑡 ) 0 0 0 0 0 0 1 1 1 input (14) ෡ 𝑖𝑡 = 𝑖𝑡 ∘ 𝜔𝑡 + (෩ 𝑖𝑡 − 𝜔𝑡 ) 1 1 1 1 0 0 0 0 0 15 ? ? (内部状態 ) output input ? ? ? + forget master input master forget original forget original input
  11. ON-LSTM:gate open/close operation • master input/forgetの1(開)の区間が重なる場合はoriginalが開閉を決める. つまりmasterとoriginalが協調する. 名称 記号・式 gateの値

    master forget ෩ 𝑓𝑡 0 0 0 1 1 1 1 1 1 master input ෩ 𝑖𝑡 1 1 1 1 1 1 0 0 0 (11) 𝜔 = ෪ 𝑓𝑡 ∘ ෩ 𝑖𝑡 0 0 0 1 1 1 0 0 0 original forget 𝑓𝑡 x x x x x x x x x original input 𝑖𝑡 y y y y y y y y y forget (13) ෡ 𝑓𝑡 = 𝑓𝑡 ∘ 𝜔𝑡 + (෩ 𝑓𝑡 − 𝜔𝑡 ) 0 0 0 x x x 1 1 1 input (14) ෡ 𝑖𝑡 = 𝑖𝑡 ∘ 𝜔𝑡 + (෩ 𝑖𝑡 − 𝜔𝑡 ) 1 1 1 y y y 0 0 0 16 ? ? (内部状態 ) output input ? ? ? + forget master input master forget original forget original input
  12. ON-LSTM:summary • Master input/forget gateを導入して,Gate操作を構造化したもの • Master input/forget gateは,開区間と閉区間に二分する •

    Master input/forget gateの開区間が重ならない場合は,masterのみで gateの開閉が決まる • Master input/forget gateの開区間が重なる場合は,originalがgateの開閉 を決める 𝑪𝑡 (内部状態) output ベクトル ゲート 色付き=開 input ෪ 𝑪𝑡 + forget master input master forget original forget original input 講演者による作図 inductive bias 17
  13. Experiments:hypothesis and design • 目的は,ON-LSTMのinductive biasが有効に機能する,と示すこと. • そのために用意された仮説は,以下の2つ. 1. Gate操作の挙動を,構文構造と対応付けできる(ref.

    p.6) • ex. 構成素が閉じるときに,内部状態を大きく更新する 2. 木構造を内在する系列データのタスクを,うまく処理できる • ex. 自然言語の長距離依存関係,論理式(論理記号列)の推論 • 筆者らが選定したタスクは,以下の4種類である. • 言語モデル[Language modeling](⇒2.) • 教師なし構文解析[Unsupervised constituency parsing] (⇒1.) • 文法性判定[Targeted syntactic evaluation] (⇒2.) • 論理的推論[Logical inference] (⇒2.) • 本スライドでは,言語モデルを除く3タスクを説明する. 19
  14. Unsupervised constituency parsing:Setting • 仮説:Gate操作の挙動を,構文構造と対応付けできる • タスク:平文のみを訓練データとして,構文木構造を推論 • 評価指標:木構造の一致度 •

    提案手法 • Model:3-Layer ON-LSTM language model (trained on PTB-train) • Inference:master forget gateの閉区間長を基準として分岐を作成 • Baselines:PRPN[Shen+ 2017]など • データセット:WSJ10 および WSJ 20
  15. Unsupervised constituency parsing:Setting • 提案手法による推論処理を詳述すると,以下のとおり. 1. 言語モデルを学習したON-LSTMを用意する. 2. token列を入力して,各時点のmaster forget

    gateの開区間長を求める. • 参照するLayerにより性能が異なる,とのこと.本論文では2nd layerを採用. 3. 開区間長が短い(≒内部状態の更新量が多い)順にソートする. 4. 貪欲法(top-down greedy parsing[Shen+ 2017])を用いて,分岐を作成する. 21 Top-down greedy parsing token all prices are as of monday ‘s close master forget length rank 2 7 1 3 4 5 6 8 ※ 実際の計算結果ではありません 開区間
  16. Targeted syntactic evaluation:Setting • 仮説:木構造を内在する系列データのタスクを,うまく処理できる • タスク:文・非文ペアに対して,非文よりも文に高い確率を付与 • 提案手法:2-Layer ON-LSTM

    language model (trained on Wikipedia) • Baseline:標準LSTM • データセット:proposed in [Marvin & Linzen 2018] • Subject-verb-agreement, reflexive anaphora, negative polarity items • The bankers knew the officer smiles. • *The bankers knew the officer smile. • 短距離依存関係・長距離依存関係の両方を収録 23
  17. Logical inference:Setting • 仮説:木構造を内在する系列データのタスクを,うまく処理できる • タスク:論理式ペアに対して,論理関係を識別 • 提案手法:ON-LSTM (no pre-training)

    • Baseline:標準LSTM,RRNet[Jacob+ 2018],TreeLSTM • TreeLSTMの場合は,系列ではなく木構造を入力する.他より有利な条件である. • データセット:proposed in [Bowman+ 2015] • 論理変数:6種類,論理演算子:3種類,論理関係:7 • テストデータには,訓練データよりも長い論理式が含まれている.このため, 本タスクの性能は,木構造(binary expression tree)処理の汎化能力が問われる. 25 Table 1: Examples of logical expressions and logical relations, cited from [Bowman+ 2015]
  18. Logical Inference:Result • 論理式の長さが訓練データ以下の場合 (青点線左側) ON-LSTM, LSTM, TreeLSTMは拮抗 • 論理式の長さが訓練データ超過の場合

    (青点線右側) ON-LSTMはLSTMを上回る性能 • 木構造処理の汎化能力は,ON-LSTMが LSTMを上回ることを示唆 26 X軸:論理式の長さ 訓練≧テスト 訓練<テスト
  19. Conclusion • 言語に内在する木構造を獲得/活用する統計モデルとしてON-LSTM (Ordered Neurons LSTM)を提案. • Master gatesの導入により,Gate操作を構造化.これにより,木構 造処理の誘導・強化を企図した.

    • 実験により, Gate操作が構文木とよく対応付くこと,および長距離 依存関係・木構造処理を必要とするタスクで有効であることを検証. 28
  20. Referenced Works [Williams+, 2018] AdinaWilliams, Andrew Drozdov*, and Samuel R

    Bowman. Do latent tree learning models identify meaningful structure in sentences? Transactions of the Association of Computational Linguistics, 6:253–267, 2018. [Yogatama+, 2016] Dani Yogatama, Phil Blunsom, Chris Dyer, Edward Grefenstette, and Wang Ling. Learning to compose words into sentences with reinforcement learning. arXiv preprint arXiv:1611.09100, 2016. [Shen+ 2017] Yikang Shen, Zhouhan Lin, Chin-Wei Huang, and Aaron Courville. Neural language modeling by jointly learning syntax and lexicon. arXiv preprint arXiv:1711.02013, 2017. [Gulordava+ 2018] Kristina Gulordava, Piotr Bojanowski, Edouard Grave, Tal Linzen, and Marco Baroni. Colorless green recurrent networks dream hierarchically. In Proc. of NAACL, pp. 1195–1205, 2018. [Kuncoro+ 2018] Adhiguna Kuncoro, Chris Dyer, John Hale, Dani Yogatama, Stephen Clark, and Phil Blunsom. Lstms can learn syntax-sensitive dependencies well, but modeling structure makes them better. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 1426–1436, 2018. [Lakretz+ 2019] Yair Lakretz, German Kruszewski, Theo Desbordes, Dieuwke Hupkes, Stanislas Dehaene, and Marco Baroni. The emergence of number and syntax units in lstm language models. In Proc. of NAACL, 2019. [Dyer+ 2016] Chris Dyer, Adhiguna Kuncoro, Miguel Ballesteros, and Noah A Smith. Recurrent neural network grammars. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 199–209, 2016. 30
  21. Referenced Works [Socher+ 2013] Richard Socher, Alex Perelygin, Jean Wu,

    Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pp. 1631–1642, 2013. [Grefenstette+ 2015] Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to transduce with unbounded memory. In Advances in Neural Information Processing Systems, pp. 1828–1836, 2015. [Koutnik+ 2014] Jan Koutnik, Klaus Greff, Faustino Gomez, and Juergen Schmidhuber. A clockwork rnn. arXiv preprint arXiv:1402.3511, 2014. [Chung+ 2016] Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural networks. arXiv preprint arXiv:1609.01704, 2016. [Rippel+ 2014] Oren Rippel, Michael Gelbart, and Ryan Adams. Learning ordered representations with nested dropout. In International Conference on Machine Learning, pp. 1746–1754, 2014. [Marvin & Linzen 2018] Rebecca Marvin and Tal Linzen. Targeted syntactic evaluation of language models. arXiv preprint arXiv:1808.09031, 2018. [Jacob+ 2018] Athul Paul Jacob, Zhouhan Lin, Alessandro Sordoni, and Yoshua Bengio. Learning hierarchical structures on-the-fly with a recurrent-recursive model for sequences. In Proceedings of The Third Workshop on Representation Learning for NLP, pp. 154–158, 2018. [Bowman+ 2015] Samuel R Bowman, Christopher D Manning, and Christopher Potts. Tree-structured composition in neural networks without tree-structured architectures. arXiv preprint arXiv:1506.04834, 2015. 31
  22. Future works and insights (IMHO) • Generative modelとしての有効性を検証する • Serialized

    treeのdecoderとして使う • NNのinternal representationをlistやpriority queueにする方策を考え ると,よいことがあるのかもしれない 34