Skip to main content
QUICK REVIEW

[Paper Review] Introduction to Transformers: an NLP Perspective

Tong Xiao, Jingbo Zhu|arXiv (Cornell University)|Nov 29, 2023
Topic ModelingComputer Science10 citations
TL;DR

This paper introduces the basic Transformer architecture, key refinements, and applications, summarizing core ideas, strengths, and limitations of Transformer models from an NLP perspective.

ABSTRACT

Transformers have dominated empirical machine learning models of natural language processing. In this paper, we introduce basic concepts of Transformers and present key techniques that form the recent advances of these models. This includes a description of the standard Transformer architecture, a series of model refinements, and common applications. Given that Transformers and related deep learning techniques might be evolving in ways we have never seen, we cannot dive into all the model details or cover all the technical areas. Instead, we focus on just those concepts that are helpful for gaining a good understanding of Transformers and their variants. We also summarize the key ideas that impact this field, thereby yielding some insights into the strengths and limitations of these models.

Motivation & Objective

  • Explain the standard Transformer encoder–decoder architecture and its sub-layers (self-attention, FFN, layer norm) and how positional encoding is used.
  • Survey major refinements and variants that improve efficiency, scalability, and performance in NLP tasks.
  • Summarize representative applications (language modeling, text encoding, translation, multimodal models) and practical trade-offs.

Proposed method

  • Describe the Transformer architecture and its sub-layers with equations for self-attention, FFN, and cross-attention.
  • Explain positional encoding, including sinusoidal absolute encodings and their role in input representations.
  • Introduce multi-head attention, QKV formulation, and the rationale for multiple heads.
  • Discuss training/inference workflow and post-norm vs pre-norm residual structures.
  • Present a table of parameter counts and time complexities for encoder/decoder modules to illustrate efficiency considerations.
Figure 20 : An overview of Transformers.
Figure 20 : An overview of Transformers.

Experimental results

Research questions

  • RQ1What constitutes the core Transformer encoder–decoder architecture and how are its main sub-layers computed?
  • RQ2How does positional encoding enable sequence ordering in Transformers?
  • RQ3What are the practical efficiency considerations (parameters, time complexity) for Transformer components in NLP systems?
  • RQ4What variants and refinements have improved Transformer models for different NLP tasks?
  • RQ5What are the typical applications and limitations of Transformer-based models as described in the survey?

Key findings

  • Transformer encoders and decoders use stacked layers with self-attention and feed-forward networks, with layer normalization and residual connections.
  • Multi-head attention (QKV) enables learning from multiple sub-spaces and improves modeling of global context.
  • Sinusoidal positional encoding provides absolute position information to embeddings, aiding sequence modeling.
  • Pre-norm vs post-norm architectures have trade-offs in optimization and representation learning.
  • FFNs with larger hidden sizes (e.g., dffn ~ 4d) improve practical performance but increase parameter count.
  • A summarized parameter/time complexity table highlights where computational bottlenecks lie across encoder and decoder modules.
Figure 21 : A heat map of the positional embedding model of Eqs. ( 208 ) and ( 209 ) ( $b_{\textrm{model}}=10,000$ and $d_{\textrm{model}}=512$ ). Consider a position $i$ (i.e., the $i$ -th row), then move another position $j$ from $i$ upwards or downwards. Intuitively, when $i$ and $j$ are closer,
Figure 21 : A heat map of the positional embedding model of Eqs. ( 208 ) and ( 209 ) ( $b_{\textrm{model}}=10,000$ and $d_{\textrm{model}}=512$ ). Consider a position $i$ (i.e., the $i$ -th row), then move another position $j$ from $i$ upwards or downwards. Intuitively, when $i$ and $j$ are closer,

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.