All words at onceTous les mots à la fois
TRA6008 S2 · in classS2 · en classe
Attention is all you need
The 2017 paper that changed the field has its thesis in its title: “Attention Is All You Need” (Vaswani et al., 2017). The architecture it introduced, the transformer, drops reading order entirely. All the words of the input are processed at the same time, and each word can draw information directly from any other, whatever the distance between them. The first word of a long sentence no longer has to survive a relay to reach the last: the two are one connection apart.
This seminal paper, arguably among the most important ones to trigger the AI evolution we are currently experiencing, was actually about machine translation machine translation (MT)traduction automatique (TA) translationtraduction The use of a computer system to produce content in a target language that conveys content expressed in a source language.Utilisation d'un système informatique pour produire, dans une langue cible, un contenu qui rend un contenu exprimé dans une langue source. ! The architecture was introduced, trained and measured as a translation model, on English to German and English to French, where it beat everything before it (Vaswani et al., 2017) (see also the impact on machine translation page) (voir aussi la page L'incidence sur la traduction automatique).
What about word order?
Dropping sequence creates an obvious problem. If nothing is processed “first”, how does the model know that the dog follows Jean differs from Jean follows the dog? The words alone no longer say.
The transformer’s answer is to make position part of each word’s representation. Before processing starts, every word’s vector is combined with a numerical encoding of where in the text it sits, like page numbers on a manuscript that has been taken apart: the pages can then be handled in any order without the original arrangement being lost.
Click the drawing, or a line below, to build it up stage by stage. Cliquez sur le dessin, ou sur une ligne ci-dessous, pour le construire étape par étape.
Attention is all you need
L’article de 2017 qui a changé le domaine annonce sa thèse dans son titre : « Attention Is All You Need » (Vaswani et al., 2017). L’architecture qu’il présente, le transformeur, abandonne complètement l’ordre de lecture. Tous les mots de l’entrée sont traités en même temps, et chaque mot peut puiser de l’information directement dans n’importe quel autre, quelle que soit la distance. Le premier mot d’une longue phrase n’a plus à survivre à une course de relais pour atteindre le dernier : les deux sont à une seule connexion l’un de l’autre.
Cet article fondateur, sans doute l’un des plus importants pour déclencher l’évolution de l’IA que nous vivons actuellement, portait en fait sur la traduction automatique machine translation (MT)traduction automatique (TA) translationtraduction The use of a computer system to produce content in a target language that conveys content expressed in a source language.Utilisation d'un système informatique pour produire, dans une langue cible, un contenu qui rend un contenu exprimé dans une langue source. ! L’architecture a été présentée, entraînée et mesurée comme un modèle de traduction, de l’anglais vers l’allemand et de l’anglais vers le français, où elle a battu tout ce qui la précédait (Vaswani et al., 2017) (see also the impact on machine translation page) (voir aussi la page L'incidence sur la traduction automatique).
Et l’ordre des mots ?
Abandonner la séquence crée un problème évident. Si rien n’est traité « en premier », comment le modèle sait-il que le chien suit Jean diffère de Jean suit le chien ? Les mots seuls ne le disent plus.
La réponse du transformeur est de faire de la position une partie de la représentation de chaque mot. Avant que le traitement commence, le vecteur de chaque mot est combiné à un encodage numérique de sa place dans le texte, comme des numéros de page sur un manuscrit qu’on a défait : les pages peuvent ensuite être manipulées dans n’importe quel ordre sans que l’agencement d’origine soit perdu.
Click the drawing, or a line below, to build it up stage by stage. Cliquez sur le dessin, ou sur une ligne ci-dessous, pour le construire étape par étape.
Sources
- Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). https://doi.org/10.18653/v1/N19-1423
- Mikolov, T., Chen, K., Corrado, G., & Dean, J. (2013a). Efficient Estimation of Word Representations in Vector Space. arXiv preprint arXiv:1301.3781 (ICLR 2013 Workshop Track). https://arxiv.org/abs/1301.3781
- Peters, M. E., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., et al. (2018). Deep Contextualized Word Representations. Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers). https://doi.org/10.18653/v1/N18-1202
- Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., et al. (2017). Attention Is All You Need. Advances in Neural Information Processing Systems 30 (NIPS 2017). https://papers.nips.cc/paper_files/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html
Sources
- Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). https://doi.org/10.18653/v1/N19-1423
- Mikolov, T., Chen, K., Corrado, G., & Dean, J. (2013a). Efficient Estimation of Word Representations in Vector Space. arXiv preprint arXiv:1301.3781 (ICLR 2013 Workshop Track). https://arxiv.org/abs/1301.3781
- Peters, M. E., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., et al. (2018). Deep Contextualized Word Representations. Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers). https://doi.org/10.18653/v1/N18-1202
- Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., et al. (2017). Attention Is All You Need. Advances in Neural Information Processing Systems 30 (NIPS 2017). https://papers.nips.cc/paper_files/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html