Skip to main content
. 2026 Jan 9;5:1733003. doi: 10.3389/fradi.2025.1733003

Figure 4.

Diagram of an encoder in a transformer neural network. It shows three connected blocks, each containing a self-attention layer in green and a feed-forward layer in blue. Arrows indicate data flow from input to decoder, with a legend explaining the layers' colors.

The architecture of the encoder in a transformer neural network. A transformer is a deep learning model that adopts the mechanism of self-attention, differently weighing the significance of each part of the input data. The encoder's job is to process the input data, such as a sentence in a source language, and convert it into a high-dimensional representation.