Learning to Compose Representations of Different Encoder Layers towards Improving Compositional Generalization

Lei Lin, Shuangtao Li, Yafang Zheng, Biao Fu, Shan Liu +2 more
5/20/2023
cs.CL

No confident code implementation found for this paper.

Abstract

Recent studies have shown that sequence-to-sequence (seq2seq) models struggle with compositional generalization (CG), i.e., the ability to systematically generalize to unseen compositions of seen components. There is mounting evidence that one of the reasons hindering CG is the representation of the encoder uppermost layer is entangled, i.e., the syntactic and semantic representations of sequences are entangled. However, we consider that the previously identified representation entanglement problem is not comprehensive enough. Additionally, we hypothesize that the source keys and values representations passing into different decoder layers are also entangled. Starting from this intuition, we propose \textsc{CompoSition} (\textbf{Compo}se \textbf{S}yntactic and Semant\textbf{i}c Representa\textbf{tion}s), an extension to seq2seq models which learns to compose representations of different encoder layers dynamically for different tasks, since recent studies reveal that the bottom layers of the Transformer encoder contain more syntactic information and the top ones contain more semantic information. Specifically, we introduce a \textit{composed layer} between the encoder and decoder to compose different encoder layers' representations to generate specific keys and values passing into different decoder layers. \textsc{CompoSition} achieves competitive results on two comprehensive and realistic benchmarks, which empirically demonstrates the effectiveness of our proposal. Codes are available at~\url{https://github.com/thinkaboutzero/COMPOSITION}.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{lin2023learning,
  title  = {Learning to Compose Representations of Different Encoder Layers towards Improving Compositional Generalization},
  author = {Lei Lin and Shuangtao Li and Yafang Zheng and Biao Fu and Shan Liu and Yidong Chen and Xiaodong Shi},
  year   = {2023},
  eprint = {2305.12169},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.12169v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.12169.svg)](https://codeofpaper.com/paper/2305.12169)

Discussion