Dense model
A dense model is a neural network that uses all of its parameters to process every input, in contrast to sparse mixture-of-experts models that switch on only part of the network for each token.
In a dense model every input passes through every part of the network. Every weight takes part in every calculation, so the number of parameters used per token equals the total number of parameters. The Switch Transformer paper from Google, published in January 2021, put the contrast simply: dense models apply the same parameters to every input, while mixture-of-experts models select different parameters for each one.
Dense models have been the standard design for most of the history of large language models. GPT-3, introduced in May 2020, was a dense model with 175 billion parameters, which its authors said was ten times more than any previous non-sparse language model. Meta's Llama 3 paper of July 2024 described its largest model as a dense transformer with 405 billion parameters.
The trade-off is cost. In a dense model, computation per token grows directly with size: double the parameters and each token needs roughly double the work. Sparse mixture-of-experts models break that link, adding parameters while keeping the compute per token roughly constant. The Switch Transformer authors reported pre-training up to seven times faster than a comparable dense model for the same compute. But they also listed the drawbacks that had held such models back: complexity, communication costs and training instability. Dense models are simpler to train and to serve, and a sparse model still needs memory for all its parameters even if only a few are used per token.
The word dense also appears elsewhere in machine learning with different meanings. A dense layer is a fully connected layer, in which every unit connects to every unit in the next layer, and dense vectors or embeddings are lists of numbers that are mostly non-zero. In news about new models, a dense model nearly always means the first sense: one with no expert routing.
A dense model uses all its parameters for every token. A mixture-of-experts model divides parts of the network into experts and routes each token through only a few of them, so it uses a fraction of its parameters per token. That lets it grow larger without a matching rise in computation per token. Neither is better in general. Dense models are simpler to train and serve and avoid routing problems. Mixture-of-experts models can offer more capacity for the same compute per token but bring extra complexity and need memory for every expert. Which suits a task depends on budget, hardware and how the model will be used. Yes. GPT-3's authors described it as having 175 billion parameters, ten times more than any previous non-sparse language model, and all of those parameters are used for every token. Many later models, including Meta's largest Llama 3 model, were also dense. A dense layer, also called a fully connected layer, is one in which every unit receives input from every unit in the previous layer. It is a different use of the word from a dense model, which refers to the whole network using all of its parameters for every input.Common questions
What is the difference between a dense model and a mixture-of-experts model?
Are dense models better than mixture-of-experts models?
Is GPT-3 a dense model?
What does dense mean in a dense layer?
Search for "dense vs mixture of experts", "sparse vs dense transformer" or a model name with "technical report" to find out how a particular model is built. Developers' technical reports and papers on arXiv are the authoritative sources for architecture and parameter counts. Treat comparisons of dense and sparse models with care unless they state both total and active parameter counts.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.