I don't think we understand Transformers enough. They're the key to Large Language Model performance, and understanding them is critical to understanding how the "brains" of our AI friends work.
By Nate
Published: 2025-02-27
URL: https://natesnewsletter.substack.com/p/transformersa-love-letter-to-a-new
This is a LONG read. Not gonna lie. But I thought it was time to write a real love letter to one of the foundational technologies that is shaping our world. ChatGPT 4.5 is coming tomorrow, probably. The magic intelligence it delivers is built on a Transformer architecture, like other large language models. But most people who use these models—even in tech—have no idea how Transformers actually work, and why they matter so much. I wrote this article to solve that, and to explain how understanding Transformers actually helps us understand a fundamentally new way computers work.
This paper is nerdy! It goes pretty deep on transformers. It’s supposed to. Keep it for a nice read or even have NotebookLM read it to you or something. I promise you, getting a working understanding of transformers is worth it.
Introduction: Transformers Change Computing
In 2017, the now-famous paper “Attention Is All You Need” introduced the Transformer architecture and revolutionized natural language processing. The Transformer demonstrated that a neural network based solely on attention mechanisms – without any recurrent loops or convolution – could achieve state-of-the-art results in machine translation, all while being more parallelizable and faster to train than prior recurrent models. This breakthrough not only accelerated Natural Language Processing tasks but also hinted at a more generalizable design. Indeed, even in that original paper, the authors noted the Transformer “generalizes well to other tasks” beyond translation. Looking back, that should have been a signal for us that something new was happening in computing.
Over the past few years, we’ve witnessed Transformers expand far beyond text processing. The core idea enabling this expansion is tokenization: breaking down diverse data (sentences, images, audio waveforms, graph structures, etc.) into discrete tokens that can be embedded as vectors. Once data is in the form of token sequences, a Transformer can process it using the same attention-based computations, regardless of the modality. This concept has fueled a paradigm shift in AI – viewing all data streams as sequences of tokens and using Transformers as a universal computation engine across domains. I wrote about the cultural implications of tokenization here.
Today I want to think about how tokenization serves as a unifying lens for information processing across many different modalities. We’ll revisit the core components of Transformers (like self-attention, multi-head attention, positional encoding, embeddings) with an eye toward multi-modal data. Then, we’ll examine how the Transformer paradigm has been successfully applied to images, audio, graphs, and even domains like protein folding and decision making. Along the way, we’ll discuss practical benefits (such as scalability and cross-modal fusion) and industry implications of treating diverse data as “token sequences.” Finally, we’ll address challenges and future directions – covering resource constraints, efficient Transformer variants, interpretability, and open research questions. By the end, you should come away with a new mindset: if you can tokenize it, you can probably transform(er) it!
Subscribers get all these posts!
Tokenization as a Conceptual Lens
What is tokenization? In simple terms, it’s the process of decomposing data into small, discrete chunks (tokens) and mapping those tokens into a numerical form (usually vectors) that a model can understand. In the context of Transformers, tokenization is the front-door that makes text, images, audio, and other modalities look the same to the model – all as sequences of embedding-friendly vectors.
Originally, in NLP, tokenization meant splitting text into words or subword units (like WordPiece or BPE tokens). For example, the sentence “Transformers are great” might become tokens ["Tran-sfor-mer", "s", "are", "great"], each of which is then mapped to an embedding vector. These token embeddings capture the meaning of each piece of text. The Transformer processes the sequence of token embeddings with its layers of attention and feed-forward networks, producing an output sequence.
The key realization is that this same process can be applied to non-text data by finding an appropriate way to “discretize” that data into tokens. Virtually any information can be serialized into a sequence of symbols or vectors:
Text – already tokenized as words/subwords or characters.
Images – can be tokenized by splitting an image into patches (small rectangular regions of pixels) or even individual pixels in extreme cases. Each patch acts like a “word” describing a part of the image.
Audio – can be tokenized by breaking a waveform into frames or segments, or by converting the audio into a sequence of spectral features (like frames of a spectrogram). Recent approaches even learn discrete acoustic codes so that audio can be represented as sequences of “sound tokens” .
Graphs – can be tokenized by treating nodes (and possibly edges or subgraphs) as tokens, turning an arbitrary graph structure into a sequence of node feature vectors.
Videos, Sensor Data, Multimodal combinations – all can be linearized into sequences of tokens (for instance, splitting a video into a sequence of frame patches, or serializing multi-sensor inputs together).
No matter the source, once data is tokenized, the tokens are typically embedded into a common vector space. This means we choose a dimensionality (say D = 512 or 1024) and learn or compute a vector of that length for each token. At this point, the data from different modalities all share a similar form: as a sequence of $D$-dimensional vectors. This is incredibly powerful because it lets a single model ingest and reason over any type of content in a unified way. A famous 2021 multimodal model, OpenAI’s CLIP, demonstrated this by jointly training on images and text – mapping both modalities into a shared feature space and aligning them via contrastive learning .
Viewing problems through this tokenization lens encourages a kind of architectural reuse. Instead of designing one network for images, a completely different one for text, and yet another for audio, we can use the same Transformer backbone for all, only changing the frontend that tokenizes and embeds the data. This has given rise to the idea of foundation models or general-purpose architectures that can be trained on massive mixed data and then specialized to tasks – all built on the humble token as the fundamental unit of knowledge.
Core Transformer Components, Revisited
Before diving into the modality-specific applications, let’s briefly revisit the core components of the Transformer architecture – with an emphasis on how they operate on token sequences regardless of where those tokens come from. The Transformer encoder (which we will focus on, as many multimodal models are encoder-based or encoder-decoder in similar ways) is composed of repeated layers, each containing a self-attention mechanism and a feed-forward network, with add-norm (residual connections + normalization) around them. Additionally, Transformers use positional encoding, multi-head attention, and token embedding layers. Here’s a refresher:
Self-Attention: Token Interactions Made General
Self-attention is the beating heart of the Transformer. In a self-attention layer, each token in the input sequence looks at every other token to gather useful information. More concretely, the model creates three vectors for each token – a Query, Key, and Value – by linear transformations of the token’s embedding. The attention mechanism then uses these to compute weighted sums of the values from other tokens, where the weights come from Query-Key interactions (often via dot product). This means each token can dynamically attend to other tokens that it finds relevant, and this happens in parallel for all tokens.
Crucially, self-attention makes no assumptions about the type or position of tokens beyond what we explicitly give it. A token could be the word “cat” in a sentence, a patch of pixels in an image, or a node in a graph – the math of attention is indifferent. As one explainer puts it: “In a Transformer, every input token, for example a word in a sentence or a residue in a protein, can attend to every other input token.” The Transformer will learn which tokens should pay attention to which others based on training data. This allows modeling of rich, long-range dependencies: a word at the beginning of a paragraph can directly influence a word at the end through attention, and similarly a pixel patch in the top-left of an image can potentially interact with one in the bottom-right in a single layer.
Another perspective from a deep learning textbook describes it as follows: each token “has its own query, keys, and values… when computing the representation at the next layer, the token can attend (via its query) to any other token (matching based on their key vectors)… by building a weighted sum over the other tokens.” This “everyone talks to everyone” approach within each layer is what gives Transformers their edge in modeling context so flexibly.
The result of self-attention is that each token’s representation is updated to a new vector that encodes information it gathered from the other tokens. After many Transformer layers, each token embedding is enriched with global context. Whether those tokens were letters, image patches, or audio frames, they’ve now interacted and exchanged information appropriate to their modality and task.
Multi-Head Attention and Positional Encoding: Context and Relationship Modeling
The original Transformer didn’t use just one attention operation – it used multi-head attention. Multi-head attention means that the self-attention process described above is replicated multiple times (with different learned projections) in parallel, called “heads.” Each head can focus on different patterns or parts of the sequence. For example, one head might attend strongly to neighboring tokens (capturing local structure like word collocations or image texture continuity) while another head attends to far-away tokens (capturing long-range dependencies). The outputs of all heads are then concatenated and mixed via another linear layer. This gives the model a chance to learn multiple types of relationships simultaneously. In the context of text, “multi-head attention gives the Transformer greater power to encode multiple relationships and nuances for each word” ; in an image, heads might encode different visual features (color, shape, position relationships); in a graph, different heads might focus on different hop-distances or communities of nodes. The multi-head design is another reason the Transformer is so versatile across modalities.
One thing self-attention doesn’t inherently have is a sense of the sequence order or spatial structure – it treats the input as a bag of tokens, and any token can attend to any other without regard to their original positions. That’s where positional encoding comes in. Transformers add extra information to each token embedding to indicate its position (or other structural info) in the sequence. In the case of text, we often add a sinusoidal positional encoding or a learned positional vector that corresponds to the token’s index in the sequence . This way, the model can learn notions of word order (“dog bites man” vs “man bites dog”). For images, positional encoding might encode the (x, y) location of a patch in the original image grid. Vision Transformers, for instance, add 2D positional embeddings (often flattened to 1D) to patch tokens to represent their row and column in the image. This allows the attention mechanism to respect spatial relationships (e.g., adjacent patches in the sequence are also adjacent in the image, which might be important for continuity). For graphs, the concept of positional encoding is trickier – one must encode graph topology. Some graph Transformer variants add graph positional encodings, such as using node degree or random walk features, or more advanced methods like encoding shortest path distances between nodes as biases in the attention calculation. Graphormer, for example, introduced learnable encodings of centrality and pairwise distances so that the Transformer is aware of which nodes are close or far in the graph structure .
TLDR: multi-head attention enriches the model’s ability to capture diverse relationships, and positional/structural encodings inject knowledge of sequence order or domain structure. Both are essential for a Transformer to handle different modalities. An image patch sequence without positional info would ignore the image layout (losing important spatial context), and a graph token sequence without graph encodings would treat the graph as if fully connected or linear, missing the original connectivity information. When done right, however, positional encodings coupled with attention enable the model to maintain the notion of “where” or “when” each token is coming from, across any domain.
Embeddings: From Raw Data to Token Vectors
We’ve mentioned embeddings a few times – this is the component that actually takes your token (which might be an index or a chunk of data) and produces the vector that goes into the Transformer. In NLP, an embedding layer is essentially a lookup table: e.g., token ID 30522 might correspond to the 512-d vector [0.12, -1.03, … 0.47]. These vectors are learned during training so that words with similar meaning end up with similar embeddings, etc.
For other modalities, the embedding step might look a bit different:
In Vision Transformers, the input image is first divided into fixed-size patches (say 16×16 pixels each). For each patch, the raw pixel values can be flattened into a vector, which is then projected (via a linear layer) into the model’s embedding dimension. So if an image yields 196 patches, you’ll get 196 token embeddings – one per patch. Commonly, a special [CLS] token embedding is also prepended for classification purposes , but fundamentally each patch becomes a token vector .
In Audio Transformers, if using a spectrogram representation, one might split the spectrogram (time-frequency image) into patches similarly and embed each patch. In the Audio Spectrogram Transformer (AST), for example, 128 mel-frequency bins × time frames patches are treated like image patches and passed through a ViT architecture . Another approach is to take short audio frames (small segments of waveform or low-level features) and input them into a convolution or linear layer that produces an embedding per frame. There are also more exotic approaches where an autoencoder compresses audio into a sequence of discrete acoustic tokens (IDs) which are then embedded – this is analogous to how text is discrete. The general theme is that audio, once framed or discretized, results in a sequence of vectors not unlike word embeddings.
In Graph Transformers, if each node has attribute features, those can directly serve as the token features (possibly projected to the model dimension by a linear layer). If nodes don’t have features, one can default to using an ID embedding (like learn a unique vector for each node ID up to some limit) or use generic structural features as the initial embeddings. Some graph transformer models also treat certain structural indicators as special tokens; for instance, one approach is to add a token that encodes a specific structural property (like a “ring” in a molecule graph) and give it an embedding, allowing the model to attend to those as well .
For multimodal models that ingest different types of tokens at once, typically each modality might have its own embedding projection, but they all map into the same dimensional space so that they can be processed together. For example, if a single Transformer is fed both text and image patches (as some research models do), the text tokens might come from a text embedding matrix, and image patch tokens come from a linear projection of pixels – but both end up as 768-dim vectors that go into the shared layers. This creates a shared embedding space where the model can learn correspondences between modalities (like linking the token “cat” with an image patch of a cat, if trained appropriately).
In summary, the embedding component is what transforms raw modality-specific data into the lingua franca of the Transformer: numeric vectors. Once in vector form, the same Transformer operations (attention, etc.) apply universally. This is the essence of why Transformers have become a universal compute paradigm – they assume very little about the inputs, other than that you can present the inputs as a sequence of vectors. If you can come up with a way to do that for your data, the Transformer can probably process it.
Now, with these components in mind, let’s explore how Transformers have been extended beyond text by crafting appropriate tokenization and embedding schemes for various domains.
Transformers Beyond Text
The versatility of Transformers has sparked creative applications in many fields. Here we highlight how the paradigm extends to vision, audio, and graph data, along with some notable case studies that illustrate the power of tokenization in practice.
Vision Transformers: Images as Patch Sequences
One of the earliest and most influential examples of Transformers beyond text is the Vision Transformer (ViT). In late 2020, researchers from Google Brain (Dosovitskiy et al.) asked: can we apply a pure Transformer to image recognition, just like we do for text, and get competitive results? The answer was a resounding yes. The trick was tokenization: ViT splits an image into a grid of small patches (e.g. 16×16 pixels each), then flattens and projects each patch into an embedding vector. These patch embeddings, plus a special class token, are fed into a Transformer encoder. Except for using 2D positional encodings to mark each patch’s location, everything else is the standard Transformer architecture.
The phrase “An image is worth 16x16 words” from the ViT paper title succinctly captures this idea – a 16×16 pixel patch is treated analogously to a word token. Once the image is tokenized in this way, the model doesn’t “see” pixels, it only sees a sequence of patches represented by vectors. Self-attention can then operate over the entire image’s patches, enabling both local interactions (neighboring patches attending to each other can capture texture or edges) and global interactions (a patch in one corner can potentially attend to a patch in another, capturing long-range context like object relationships or symmetry). The ViT paper showed that when trained on sufficient data, a pure Transformer could attain excellent image classification results on benchmarks like ImageNet, even outperforming traditional convolutional networks, “while requiring substantially fewer computational resources to train.” . This was a eye-opener for the vision community: it suggested that convolution (long the king of vision models) might not be strictly necessary if you have a strong enough sequence model and enough data.
Since ViT, transformer-based vision models have proliferated. Variants have introduced improvements like multi-scale patches, hybrid models that combine some convolutional stem with transformers, and transformers for specific tasks like object detection and segmentation. But the core idea remains: images can be successfully represented as sequences of tokens (patches or other primitives), and Transformers can effectively perform visual tasks by modeling those tokens. An intuitive way to think of it is that each image patch token “describes” part of the image (one token might encode something about a portion of a dog’s face, another token a patch of background sky), and the self-attention mechanism allows the model to assemble a holistic understanding by relating these parts to each other (e.g., this patch is part of the same object as that other patch far away, etc.)
The vision domain also gave birth to architectures like DETR (Detection Transformer) for object detection, which tokenize image features and use transformer decoders to output bounding boxes, and Vision-Language models like CLIP and others that combine image patch tokens with text tokens in various ways for multimodal reasoning. We’ll touch on CLIP in the case studies, but it’s worth noting here: once images are tokens, you can even concatenate image tokens with text tokens in a single Transformer and have them attend to each other – effectively performing image-text fusion in a unified model.
Audio Transformers: From Waveforms to Token Sequences
Audio data, like vision, initially seems very different from text. Audio is typically a continuous waveform signal. However, we can tokenize audio by discretizing it in time and/or frequency. A common approach is to convert the audio waveform into a spectrogram, which is essentially an image representing how frequencies (y-axis) vary over time (x-axis). This spectrogram image can then be treated just like an image: divided into patches or columns that become tokens. In fact, the Audio Spectrogram Transformer (AST) (Gong et al. 2021) did exactly this – applying a ViT architecture to audio spectrogram patches . The AST is “the first convolution-free, purely attention-based model for audio classification” and achieved state-of-the-art results on benchmarks like AudioSet, outperforming conventional CNN audio models. This is a strong testament that the transformer paradigm can handle audio events (like classifying a sound clip as “dog barking” vs “plane flying”) when the audio is represented in a suitable tokenized format.
Besides spectrograms, another way to tokenize audio is directly in the time domain. For example, one could split a raw waveform into short frames (like 20ms segments) and treat each frame’s samples as a token (embedding the frame via an FFT or learned projection). Some speech recognition models operate almost this way, though they often use a CNN or LSTM to first encode frames before a Transformer does long-range attention on top (e.g., the Conformer model combines convolution and transformer for audio). But as research progresses, we see more fully transformer-based audio models emerging. One interesting line of work is acoustic tokenizers: using an autoencoder to learn a discrete set of sound units, so that an audio waveform can be compressed into a sequence of discrete indices (each index corresponding to some sound “code”). Facebook’s EnCodec and related models do this, producing sequences of discrete audio codes that can then be modeled by a Transformer for generating new audio (as done in AudioLM, SoundStream, etc.). Essentially, they learn a “vocabulary” of audio tokens. This approach brings audio truly on par with text – the audio is no longer a continuous signal but a sequence of token IDs.
Even without an explicit tokenizer model, simply treating audio features as sequences has allowed Transformers to shine in tasks like speech recognition, speaker identification, and music analysis. For instance, in music generation, the MIDI events or note sequences can be tokenized (each note or event is a token with attributes) and Transformers have been used to generate music by modeling those token sequences. The general trend is clear: whether it’s a spectrogram patch or a learned acoustic code, turning audio into tokens unlocks the ability to use Transformers for audio understanding and generation. And as with images, multiple modalities can mix – recent models like Meta’s Voice-Enabled Transformers or multi-modal generative models consider both audio and text tokens in one network (e.g., generate speech from text by having a unified model). The boundaries between modalities start to blur when everything is tokens.
Graph Transformers: Tokens on Nodes
Graph data (such as social networks, molecular graphs, knowledge graphs) presents a different challenge: it isn’t naturally a sequence or grid. Graphs are collections of nodes connected by edges, and they can have complex topology. Traditional approaches for graph machine learning (Graph Neural Networks) pass messages along edges, which is inherently tied to the graph structure. How can we apply Transformers here? The answer explored by many recent works is to linearize the graph by treating nodes (or other graph elements) as tokens.
The most straightforward method is: list all the nodes of the graph as a sequence of tokens. Each node’s initial embedding could be based on its features or even an index. Then let the Transformer’s self-attention operate over this list of node tokens. The attention mechanism, being global, will connect nodes by learning to attend to related nodes. But to help it out, we often inject some encoding of the original graph structure. One simple trick is to add an adjacency bias: if two nodes were directly connected in the graph, add a learned bias term to their attention score to encourage the model to treat connected nodes differently than unconnected ones. More sophisticated is encoding the shortest path distance or some structural identifiers into the model input. The Graphormer model, for example, includes additional embeddings that represent the distance between any pair of nodes and whether there’s an edge between them, which the model uses in attention computation .
However, a naive Transformer on all nodes scales poorly if graphs are large (because attention is O(N^2) in number of nodes). Researchers observed “existing graph Transformers treat nodes as independent tokens and construct a single long sequence composed of all node tokens”, which makes it hard to scale to large graphs due to quadratic cost . To address this, methods like NAGphormer (Neighborhood Aggregation Graph Transformer) have been proposed . NAGphormer doesn’t abandon tokenization; rather, it refines it: instead of one token per node, it creates a small sequence of sub-tokens for each node by aggregating its local neighborhood features at different hop distances (1-hop, 2-hop neighbors, etc.) . Each node then has a sequence of tokens representing its local context, and the Transformer processes each node’s sequence, which is much smaller than the whole graph, thus scaling to large graphs. This is an example of adapting tokenization strategy to suit the data scale while still reusing the Transformer core.
Graph Transformers have shown strong performance in tasks like molecule property prediction, where each molecule is a graph of atoms; in node classification tasks on citation networks or social networks; and even in combinatorial optimization on graphs. A Transformer can capture complex interactions in a graph (like long-range dependencies not easily captured by 2-3 hop message passing in GNNs) because attention can connect any two nodes if needed, regardless of graph distance. With the right structural encodings, Transformers on graphs have even outperformed specialized GNNs in some benchmarks , indicating that the universal attention mechanism can match or exceed tailored graph convolutions when given enough data and tuning.
In practice, graph tokenization might also include edge tokens or special tokens for global graph properties, depending on the application. For instance, one could insert tokens that represent an entire subgraph or a specific relation type, to allow the model to attend to those as well. This flexibility is another advantage: tokenization is a design freedom – we can choose what the tokens represent (patches, pixels, nodes, edges, time steps, etc.) in whatever way seems most useful for the problem, and the Transformer will accommodate.
Case Studies Across Domains
To make this discussion concrete, let’s look at a few case studies where the Transformer-as-universal-compute paradigm has yielded impressive results:
AlphaFold (Protein Folding) – Tokenizing Genomics: AlphaFold 2 by DeepMind is famous for solving the 50-year-old grand challenge of predicting a protein’s 3D structure from its amino acid sequence. At its core, AlphaFold uses a Transformer-based architecture operating on multiple sequence alignments and pairwise residue representations. Think of an amino acid sequence as just like a sentence, except with 20 possible “letters” (amino acids) instead of 26. Indeed, AlphaFold’s network has a part where “every input token, e.g. a residue in a protein, can attend to every other input token” just like words in a sentence . The self-attention mechanism captures long-range dependencies in the protein chain – for example, amino acids that are far apart in the sequence might end up close in the 3D folded structure, and attention can learn these relationships. AlphaFold also introduced specialized forms of attention (like invariant point attention for 3D relations), but fundamentally it treats sequence and pairwise data with attention models. The success of AlphaFold showed that Transformers aren’t just for natural language – they can capture the “language of biology” when proteins are tokenized appropriately. This has huge implications for drug discovery and bioinformatics, as attention-based models can be used to understand and design biological sequences. (AlphaFold’s advance was so significant it was highlighted in Nature and elsewhere; one perspective noted its use of “attention mechanisms and Transformers to capture long-range dependencies” as a key ingredient ).
CLIP (Contrastive Language-Image Pretraining) – Aligning Image and Text Tokens: OpenAI’s CLIP model is a multimodal Transformer that bridges vision and language. During training, CLIP takes an image and a text caption and processes them with two Transformers – one for the image (either a ViT or CNN to get image tokens) and one for the text. It then learns to align the embedding of the image with the embedding of the correct caption (and to repel embeddings of mismatched image-caption pairs). The result is a model that produces a shared embedding space for images and texts . What’s notable is that CLIP’s image encoder is effectively creating tokens (image patches) and its text encoder uses word tokens, and although the Transformers are separate during training, their outputs become directly comparable. Thanks to this, CLIP can do things like zero-shot image classification: you give it an image and a set of text labels (e.g. “a photo of a cat”, “a photo of a dog”, etc.), it embeds both image and text, and finds which text is closest to the image in the shared space – essentially performing classification without any task-specific training. As one paper describes, “CLIP aligns image and text features into a shared space using contrastive learning on large-scale image-text pairs” , leveraging natural language as a powerful supervision signal. CLIP demonstrated that a unified tokenization paradigm enables powerful cross-modal applications: we can literally ask the model (in text) what an image is, and it responds via this shared embedding reasoning. This idea has since been extended (e.g. Google’s ALIGN, and OpenAI’s CLIP-based models) and is foundational for multimodal AI – all based on the idea that image patches and text tokens can be processed in parallel and brought together. In practice, CLIP uses separate modules, but more recent models like Flamingo or BEiT-3 attempt to unify modalities within one Transformer model. The success of CLIP in industry has been immense: it’s used for powering image search, for improving generative models (like guiding diffusion models with text), and showcases the benefit of unified token embeddings for cross-modal understanding.
Decision Transformer (Reinforcement Learning) – Sequence Modeling for Actions: Perhaps one of the most intriguing cross-domain usages of Transformers is in Reinforcement Learning (RL), which traditionally has been tackled with very different algorithms (like Q-learning or policy gradients). The Decision Transformer (Chen et al. 2021) flips this on its head by treating a sequence of past states, actions, and desired outcomes as a sequence of tokens, and then predicts the next action token using a Transformer. Essentially, it casts the problem of choosing actions as a conditional generative modeling task. The Decision Transformer “casts the problem of RL as conditional sequence modeling.” Concretely, they form trajectories like (desired return, state\1, action\1, state\2, action\2, …, state\_N) as a sequence of tokens and train a GPT-like Transformer to output the actions autoregressively. At inference, you input a desired reward and the current state (and perhaps recent states) as tokens, and the Transformer generates the next action token. Remarkably, this simple sequence modeling approach matched or exceeded the performance of more complex RL algorithms on certain benchmarks. It means that a single Transformer model learned to play Atari games, control robotic tasks, etc., by modeling the trajectories rather than explicitly computing reward sums or policy gradients. This is a profound example of treating “everything as a sequence” – even decisions. It opens up possibilities to leverage all the advances in Transformer training (scaling, data, hardware) for decision-making problems. Some have called this the start of “transformers in control/robotics,” and indeed follow-up work has applied similar ideas to robotics, where sequences of sensor readings and motor commands can be tokenized. Google’s Trajectory Transformer and other variants also explore planning by sequence modeling. The Decision Transformer’s success suggests that the boundary between modeling language and modeling action sequences might be just an artifact of how we formulated problems, and that Transformers can unify them.
These case studies underscore a theme: once you properly tokenize and embed the data, Transformers can excel in many domains – from understanding protein sequences to linking images with text, to making decisions in a simulated environment. Each required some innovation in how to represent the input (and sometimes slight tweaks to the attention mechanism), but none required fundamentally new learning algorithms – the Transformer was adaptable enough.
Industry Implications & Practical Benefits
The rise of Transformers as a universal compute paradigm has significant implications for industry practitioners and organizations building AI systems. By thinking of problems in terms of tokenizable sequences and leveraging Transformers, we can achieve:
Unified Architectures and Reusable Models: Instead of maintaining completely separate model architectures for text, vision, speech, etc., companies can invest in a single core architecture (Transformer-based) and apply it broadly. This not only simplifies engineering (one codebase for the model backbone) but also means advances in one modality (say a new efficient attention method) can be ported to others easily. It paves the way for multimodal AI systems that ingest multiple data streams naturally. For example, imagine a digital assistant that processes text commands, voice input, and camera input all with one Transformer model that has been exposed to all these modalities. This is what OpenAI is likely going to be doing with ChatGPT 5 when it launches in a few months, and it’s an approach they talked about last year. But this isn’t new! We saw early signs of this a couple of years ago with models like DeepMind’s Perceiver and Gato. The Perceiver is explicitly designed to handle “arbitrary configurations of different modalities using a single Transformer-based architecture” – it introduced a way to input assorted data (images, audio, point clouds) and processed them with one network by using a clever latent attention bottleneck. DeepMind’s Gato takes it even further: it’s a single Transformer decoder that has been trained on 600+ tasks spanning vision, language, and robotics. During Gato’s training, “data from different tasks and modalities are serialized into a flat sequence of tokens, batched, and processed by a transformer neural network similar to a large language model.” This means a single model with one set of weights can play Atari games from pixels, caption images, chat with a human, and control a robotic arm. While Gato may not excel at each task as much as specialized models, it showcases the potential of unification: one model to rule them all, by representing everything as a sequence of tokens. For businesses, this hints at more integrated AI systems – for instance, a robot in a factory that uses one neural network to analyze camera feeds, listen to voice instructions, and check sensor readings altogether, making decisions in a coherent way. Unified tokenization makes integration much more seamless than juggling a patchwork of domain-specific models.
Scalability and Parallelism: Transformers are highly amenable to modern acceleration (GPUs/TPUs) because they parallelize sequence processing. Unlike RNNs that had to process one time-step after another, a Transformer processes all tokens at once in each layer (self-attention lets all tokens attend concurrently). This was highlighted as a major advantage in the original paper . In practice, this means training can be scaled up efficiently, and we can leverage extremely large datasets. The past few years have proven that scaling Transformers (in data and model size) leads to improved performance (the “scaling laws”). For industry, this means if you have massive data (logs, images, audio recordings, etc.), a Transformer can make use of it with enough compute, whereas some older architectures might struggle. Also, the fact that one architecture scales from small to large – you can start with a manageable model and scale up – is attractive for long-term planning. We’ve seen how the same basic Transformer design scaled from the 2017 models with 65 million parameters to today’s large language models with hundreds of billions of parameters (or more). That scalability also applies across modalities – e.g., Vision Transformers scaled up (with more data and parameters) became the backbone of Google’s image models and even some video models. This suggests a economy of scale in research and development: focusing optimization efforts on Transformers yields returns across many applications.
Cross-Modal Fusion and Transfer Learning: Having a unified token representation allows easy fusion of information from different sources. For example, a medical diagnosis system might take a patient’s clinical notes (text tokens) and radiology images (image patch tokens) and feed both into a single Transformer to make a diagnosis. The attention mechanism can naturally bridge between text and image tokens – perhaps the textual symptom token “cough” attends to an X-ray patch token that shows lung inflammation, allowing a better joint inference. This kind of cross-modal attention is a straightforward extension once data is tokenized. It’s a big deal for industries like healthcare or autonomous vehicles where multiple sensors and data types must come together. We could simplify pipelines by avoiding modality-specific models that later have to be fused; instead, feed raw tokenized data into one network and let it learn the correlations. Moreover, transfer learning becomes more feasible across modalities. A Transformer pre-trained on language might help as a starting point for a protein or DNA sequence model (indeed, some biotech firms use language-model pretraining techniques on genomic sequences). A vision transformer pre-trained on ImageNet could be adapted to a different domain like medical images, or even to a non-vision task by reinterpreting what tokens mean. We already treat LLMs as general foundation models that can be fine-tuned to many NLP tasks; in late 2025, we will likely treat a multi-modal transformer as a foundation model that can be adapted to any new modality or combination. This could reduce the data needed for niche applications because the model has seen so much variety already.
Applications in Diverse Fields: Practically every industry dealing with data can potentially benefit. In healthcare, Transformers are being explored to unify modalities like electronic health records (text), biomedical images (MRI, CT scans), genetic sequences, and even wearable sensor time-series. A unified model might predict patient outcomes by combining these. In finance, one could combine news text, numerical time series, and graphs of market relationships as tokens to forecast trends. In robotics, as mentioned, transformers can combine vision, language commands, and joint sensor readings to control robots – companies like Tesla have hinted at using transformer-like architectures for their self-driving (which involves multi-camera images, radar, etc. as inputs). Autonomous vehicles indeed have to fuse camera images, LIDAR point clouds (which can be discretized into voxels or point tokens), maps (graph of roads), and more – a tokenized fusion via Transformers is a compelling approach under active research. Content recommendation systems and advertising can use transformers to merge user interaction sequences (which are like event tokens) with content metadata (text or image tokens) to make predictions. The consistency of the approach means that hiring and training talent around Transformers yields wide benefits – engineers become experts in one framework that applies to many problems.
In essence, the Transformer paradigm and tokenization bring standardization to AI systems: a common format (tokens) and common processing method (attention-based sequence modeling). This can streamline product development and open up new capabilities (like fluidly understanding multi-modal user inputs). Companies like Google, Facebook, OpenAI, Microsoft are already moving toward multi-modal foundation models. For instance, Microsoft’s Kosmos-1 is a model that takes images and text jointly; Meta’s ImageBind learns a joint embedding for image, text, audio, depth, and more; these point to a future where any data type can plug into a Transformer model.
Challenges & What’s Next
Despite all the promise, treating Transformers as a universal compute engine is not without challenges. Scaling up and extending to new domains bring several hurdles that researchers and engineers are actively working to overcome. Here are some key challenges and future directions:
Computational Complexity and Efficiency: The flexibility of self-attention comes at a cost: quadratic complexity in sequence length. If you double the number of tokens, the attention operation takes four times as much computation and memory in a naive implementation. This is manageable for short text or moderate-sized images, but it becomes a bottleneck for very long sequences (like entire books or high-resolution images or long audio streams). For example, a 10-minute audio clip turned into 16ms tokens would be tens of thousands of tokens; a 4K image in patch tokens similarly huge. Running full attention on these is expensive. To address this, there’s a lot of work on efficient Transformers. Techniques like sparse attention limit each token to attending only to some of the others (not all), thereby reducing complexity. In fact, “sparse attention mechanisms in transformers reduce computational complexity and memory usage, enabling efficient processing of long input sequences.” And this isn’t new! Even though we now deal at massive scale in LLMs in 2025, we’ve been dealing with comput complexity for a long time. Examples include OpenAI’s 2019 Sparse Transformer, which attends only to a subset of tokens (like fixed stride or blocks) reducing cost to $O(n \sqrt{n})$ in some cases; Facebook’s Longformer and BigBird which use windowed local attention plus global tokens; Reformer which uses locality-sensitive hashing to approximate nearest neighbors in attention; and Performer which uses random feature kernels to get linear time attention. These approaches laid crucial groundwork for extending Transformers to very long sequences (like entire videos, long documents) and to large graphs—the very breakthroughs that are changing 2025. We are also seeing advances in hierarchical models (like chunking a sequence into segments, processing each, then a second-level transformer combines segment representations). Another efficiency angle is model compression – large transformers are memory-hungry and slow at inference. Techniques like knowledge distillation, quantization, and pruning are being applied to make deployable models that still benefit from the universal training but can run in real-time settings (like on a robot or mobile device). There’s also exploration of analog and optical computing for Transformers, showing just how central they’ve become that hardware research is targeting them. Headed toward 2026, we’re exploring self-adaptive transformers that change model weights on the fly and what it looks like to make inference time compute more efficient (see more in a Perplexity here).
Data Requirements and Domain Adaptation: Transformers typically crave a lot of data to reach their potential. Training from scratch on a small dataset is likely to overfit given the model size and flexibility. In language, we solved this by pretraining on huge corpora and fine-tuning. For other modalities, foundation models are still emerging. If you want to use a Transformer for a niche modality (say, sensor readings on an oil rig), you might not have billions of tokens to train on. One future direction is better transfer learning and adaptation techniques. How can we adapt a large pre-trained model (say a multilingual text transformer) to a new domain (like coding, or math formulas, or clinical notes) efficiently? Approaches like prompt tuning and adapter layers allow updating a small number of parameters to shift a model to a new domain. We’ll likely need analogous techniques for multimodal models – e.g., adding a small module or prompt to adapt a general model to specific sensor data. Another approach is few-shot learning: large transformers have shown the ability to do tasks with just a few examples (in-context learning). Extending this to new modalities is a challenge – e.g., can a vision transformer do a new task by being prompted with a few image examples? Again, we’ve been laying the groundwork for years. Research like Meta’s data2vec tries to learn modality-agnostic representations that might help transfer knowledge between modalities. OpenAI built on this with the release of simplified fine-tuning during their 12 Days of OpenAI in 2024. And of course, synthetic data generation is scaling quickly, helping fill data gaps (for example, generating more labeled graph data via simulation to train a graph transformer) and critically enabling DeepSeek to leapfrog by pushing reasoning tokens onto the internet throughout 2024.
Interpretability and Trust: As we apply Transformers in critical domains (medicine, law, autonomous driving), understanding why the model made a decision becomes important. Transformers are somewhat more interpretable than some models because we can inspect attention weights to see what tokens attended to what. In NLP, attention maps are sometimes used to explain model behavior (though caution: attention ≠ explanation entirely). In images, we can visualize which patches influenced classification (some use attention rollout to highlight important image regions, analogous to saliency maps). But as models become larger and multimodal, interpreting them is harder. If a medical multimodal transformer says “high risk of cancer,” we’d like to know if it’s due to a particular shadow in an MRI token and a certain phrase in the doctor’s note. Developing tools for multimodal interpretability – for example, linking attention in text to attention in image – is an open area. There’s also the question of bias and ethics. Large models can reflect biases present in training data. When those models are unified across modalities, the risk can propagate across domains. Ensuring these universal models are fair and don’t propagate undesirable biases is a challenge that requires careful curation, evaluation, and possibly fine-tuning on human feedback. Researchers are also looking at modular or compositional transformers that might be more transparent, or rule-constrained transformers for fields like law, where certain rules must be followed explicitly.
New Modalities and Multimodal Fusion: The future will likely bring even more exotic uses of tokenization. Already we see Transformers used for code (programming languages), treating code as text tokens and learning to generate code (Claude 3.7 is the latest here). We see them in mathematics, encoding mathematical expressions or even doing symbolic reasoning by tokenizing math notation. 3D data like meshes or point clouds can be tokenized (e.g., each point or patch of a 3D shape as a token) for 3D understanding tasks. As new sensors or data types emerge, the community will find ways to tokenize them. Perhaps in the future, even things like network traffic or DNA sequences in a cell or material designs will be handled by Transformers.
Moreover, combining modalities is a big frontier. We have models for image-text, audio-text, video-text, etc., but what about image+audio+text+time-series all together? That’s likely where ChatGPT 5 is going to go, and other models will probably soon follow. There will be challenges in training such models (datasets that have all modalities together are rare), but the upside is a truly general AI system. For example, a home assistant robot might parse your speech (audio tokens), understand your gesture (video tokens), refer to a calendar event (text tokens), and navigate the room (lidar point cloud tokens) all in one go. Sitting in February 2025, this looks like an achievable vision for December 2025. Which is wild.
Wrapping it up
The Transformer and tokenization paradigm represents a fundamental shift in how we approach AI models, and the goal of this long read has been to show some of how they are changing computing as we know it. We will think about computers differently because of Transformers. We no longer have to design one network for text, another for images, another for audio; instead, we design one powerful sequence model and fit the data to the model by tokenizing the data appropriately. This inversion – focusing on a general-purpose learner and converting everything into its language (tokens) – is a profound idea. It’s analogous to how in computers, everything (images, sound, text) is ultimately just bits that a CPU can process. In the new age of AI, everything becomes tokens that a Transformer can process.
Treating diverse data streams as token sequences ready for Transformer-based computation unlocks synergies across fields. Breakthroughs in one domain (like better transformers for language) can translate to others (like better protein models or image models). It encourages a modular view of intelligence: you gather data, turn it into the universal token format, and feed it to a universal reasoning engine. We’ve seen how this approach has already led to state-of-the-art results and even new capabilities (like zero-shot multimodal reasoning) that weren’t possible with siloed models.
For us reading along, the takeaway is to start thinking in tokens. When faced with a new problem, ask: how can I represent this as a sequence of inputs? Could I use a Transformer on it? Is this a tokenizable data stream? Often the answer is yes, and even if a Transformer is heavyweight today, the benefits of scale, transfer learning, and a rich ecosystem may outweigh the initial cost. Moreover, the continued research into efficient and specialized Transformers means the barriers are lowering.
In your own field – be it finance, healthcare, engineering, arts – consider what data you have that could be turned into a sequence. Genomic sequences? (They already are sequences!) Customer event logs? (Sequence of events.) Sensor readings? (Time series tokens.) Images or video? (Patches or frame tokens.) Graphs of relationships? (Node tokens with connection encodings.) By adopting the token mindset, you might find novel ways to apply powerful pre-trained models or to train unified models that simplify your system architecture.
The Transformer as a universal compute paradigm is still a work in progress, but its trajectory is clear. It has brought us very close to a general-purpose learner – a single system that can ingest raw information in any form and make sense of it. Arguably, we will look back on Transformers as the first of two key breakthroughs on the way to general intelligence—with the second being test time compute (aka inference or reasoning). General purpose learning has been a long-standing dream in AI, and tokenization is the key that’s unlocking it. As we continue to refine this paradigm, we can expect AI systems to become more integrated, context-aware, and capable of understanding the world’s data in all its forms.
The next time you encounter a complex AI problem, remember: if you can break it into tokens, you can probably transform it. The age of tokenized AI is upon us – and it’s an exciting time to innovate across the boundaries of data modalities. By understanding computing deeply, we can embrace this mindset shift and see what new frontiers we can reach by viewing the world through the lens of tokens and Transformers.
For more on AI, subscribe and share!

\Transformers are cool\