English

On Biasing Transformer Attention Towards Monotonicity

Computation and Language 2021-04-09 v1

Abstract

Many sequence-to-sequence tasks in natural language processing are roughly monotonic in the alignment between source and target sequence, and previous work has facilitated or enforced learning of monotonic attention behavior via specialized attention functions or pretraining. In this work, we introduce a monotonicity loss function that is compatible with standard attention mechanisms and test it on several sequence-to-sequence tasks: grapheme-to-phoneme conversion, morphological inflection, transliteration, and dialect normalization. Experiments show that we can achieve largely monotonic behavior. Performance is mixed, with larger gains on top of RNN baselines. General monotonicity does not benefit transformer multihead attention, however, we see isolated improvements when only a subset of heads is biased towards monotonic behavior.

Keywords

Cite

@article{arxiv.2104.03945,
  title  = {On Biasing Transformer Attention Towards Monotonicity},
  author = {Annette Rios and Chantal Amrhein and Noëmi Aepli and Rico Sennrich},
  journal= {arXiv preprint arXiv:2104.03945},
  year   = {2021}
}

Comments

To be published in: Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT 2021)

R2 v1 2026-06-24T00:58:34.652Z