This is the repository associated with the paper
"Abstractors and relational cross-attention: An inductive bias for explicit relational reasoning in Transformers" --- Awni Altabaa, Taylor Webb, Jonathan D. Cohen, John Lafferty.
The arXiv version is here: https://arxiv.org/abs/2304.00195.
The following is an outline of the repo:
abstracters.pyandabstractor.pyimplement different variants of the Abstractor module.autoregressive_abstractor.pyimplements sequence-to-sequence abstractor-based architectures.seq2seq_abstracter_models.pyis an older, less general, implementation of sequence-to-sequence models.multi_head_attention.pyis a fork of tensorflow's implementation which we have adjusted to support different kinds of activation functions applied to the attention scores.transformer_modules.pyincludes implementations of different Transformer modules (e.g.: Encoders, Decoders, etc.). Finally,attention.pyimplements different attention mechanisms for Transformers and Abstractors (including relational cross-attention).- The
experimentsdirectory contains the code for all experiments in the paper. See thereadme's therein for details on the experiments and instructions for replicating them. - The
paperdirectory contains the source for the paper itself.