Svashasan Logo
Simulated data

AI and Machine Learning · Model architecture

Transformer

Also known as transformer network, self-attention model, vision transformer, ViT

AdvancedSource-checked · awaiting technical reviewLast reviewed 6 December 2026

A transformer is a neural network architecture built around attention, in which each element of an input sequence or set computes a weighted combination of the others. Introduced for machine translation in 2017, it is now used for language, vision and multi-sensor perception.

Explanation

Vaswani et al. ('Attention Is All You Need', NIPS 2017) proposed an encoder-decoder model that dispenses with recurrence and convolution. Each of its six encoder and six decoder layers combines multi-head self-attention with a position-wise feed-forward network, residual connections and layer normalisation. Because attention itself has no notion of order, positional encodings are added to the input embeddings.

Attention lets every token interact with every other token within one layer, capturing long-range relationships, but the attention matrix grows with the square of the number of tokens, which drives memory use and latency. Vision variants split images into patches or use learned queries. In driving, BEVFormer uses grid-shaped bird's-eye-view queries with spatial cross-attention over several camera views and temporal self-attention over earlier BEV features.

Transformers are demanding on embedded hardware, so inference runtimes provide dedicated fusions for attention, GELU and layer normalisation, and deployment usually needs careful precision choices.

How it works

Inputs are embedded as vectors, and each attention head projects them into queries Q, keys K and values V. Scaled dot-product attention computes softmax(QKᵀ / √d_k)·V, so each output is a weighted sum of values, weighted by query-key similarity. Several heads run in parallel and are concatenated, then a feed-forward network processes each position independently. Stacking such layers builds contextual representations.

Automotive applications

  • Multi-camera bird's-eye-view perception
  • Trajectory prediction with agent-to-agent attention
  • Sensor-fusion networks
  • In-cabin voice and language assistants
  • End-to-end driving research

Example

A surround-view perception network places BEV queries on a grid around the vehicle. Each query attends to the camera image regions that project onto its location and to the previous frame's BEV features, producing a feature map used for 3D object detection.

An illustrative example: any figures in it are worked numbers, not measurements.

References

  1. Attention Is All You Need (Vaswani et al., NIPS 2017) (opens in a new tab)

    arXiv · Paper · 3 Model Architecture · retrieved 6 December 2026

  2. BEVFormer: Learning Bird's-Eye-View Representation from Multi-Camera Images via Spatiotemporal Transformers (Li et al., ECCV 2022) (opens in a new tab)

    arXiv · Paper · Abstract · retrieved 6 December 2026

  3. Graph Optimizations in ONNX Runtime (opens in a new tab)

    ONNX Runtime documentation (onnxruntime.ai) · Project documentation · Extended Graph Optimizations (Attention, GELU and Layer Normalization fusion) · retrieved 6 December 2026

Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.