Model Architecture
How models are built under the hood.
Model architecture is the internal design of an AI model — how it is structured to process information, from the transformer and its attention mechanism to alternatives like mixture-of-experts and state-space models that change the cost and capability trade-offs.
The transformer was introduced in 2017, when Ashish Vaswani and colleagues described a model built entirely on attention, with no recurrence or convolutions, that trained faster and translated better than the recurrent models of the time (Vaswani et al., Attention Is All You Need). Its cost is that attention compares every token with every other token, so compute and memory climb quickly with context length. Much of the architecture work since is about that cost: FlashAttention makes exact attention cheaper on GPUs, and mixture of experts adds parameters without running all of them for every token.
Other designs drop attention entirely. Mamba, from Albert Gu and Tri Dao, is a selective state-space model whose cost grows linearly with sequence length; the authors report five times the inference throughput of transformers and a 3B-parameter model that matches transformers twice its size on language modeling (Gu and Dao, Mamba). The episode with Liquid AI's Maxime Labonne covers architectures beyond the transformer aimed at running models on edge devices.
For builders, architecture shows up as cost and constraints more than as a choice: context length, memory, and inference speed follow from it. Why is it hard to move off NVIDIA? covers the hardware side, and are small language models better for production? covers the size tradeoff.
1 episode
Explainers on this topic
- What Is a Reranker in RAG?
- What Is Model Distillation in AI?
- How Large Language Models Actually Work
- Physical AI: When a Language Model Drives the Robot
- Why Most Websites Won't Get APIs for AI Agents
- Small Language Model vs. Frontier Model
- Reasoning Model vs. Standard LLM: When to Use Which
- What Is Multimodal AI
Terms on this topic
- Activation function
- Artificial neuron
- Autoencoder
- Autoregressive model
- Batch normalization
- BERT and masked language models
- Black-Box Model
- Chain-of-Thought Prompting
- Convolutional neural network
- Deep Learning
- Diffusion Model
- Encoder-decoder and sequence-to-sequence models
- FlashAttention
- Foundation Model
- Generative Adversarial Network
- Generative AI
- Generative Pre-trained Transformer
- Generative vs. discriminative models
- Hidden layer
- KV Cache
- Language model
- Large Language Model
- Latent Space
- Logits and log probabilities
- Long Context
- Long short-term memory
- Mechanistic Interpretability
- Mixture of Experts (MoE)
- Model Parameters
- Multilayer perceptron
- Neural architecture search
- Neural Network
- Next-Token Prediction
- Perceptron
- Positional encoding
- Reasoning Models
- Reasoning Tokens
- Recurrent neural network
- Reinforcement Learning with Verifiable Rewards
- Residual connection
- Self-Consistency
- Small Language Model
- Softmax
- Sparse autoencoder
- Speculative Decoding
- State-Space Models (Mamba)
- Tensor
- Test-Time Compute
- Token
- Tokenization
- Transformer
- Tree of Thoughts
- Variational autoencoder
- Vision Transformer
- Word embedding