The Densing Law of Large Language Models (LLMs): Redefining AI Efficiency

Anna Alexandra Grigoryan
6 min readDec 15, 2024

--

LLMs work by learning from vast amounts of text data to understand language patterns. They’re trained on billions or even trillions of parameters — internal components that help the model store and retrieve knowledge. The larger the parameter count, the more powerful the model — at least, that’s been the assumption for years …

Photo by Lysander Yuen on Unsplash

The Core Problem

But there’s a problem: More isn’t always better.

1. High Computational Costs: Training massive models is expensive, costing millions of dollars in electricity and specialized hardware.

2. Expensive Inference: Running these models in real-world applications requires significant cloud resources, increasing operational costs.

3. Environmental Impact: Training and deploying LLMs consume enormous energy, contributing to carbon emissions.

Given these challenges, scaling LLMs indefinitely is unsustainable. This is where the Densing Law introduced by Xia et al. (2024) comes in, proposing a new way to evaluate LLMs based on efficiency per parameter, not just model size. I found this an interesting read and wanted to summarize my learnings.

The Big Idea: What Is the Densing Law?

The Densing Law suggests that LLMs aren’t just getting larger — they’re becoming denser, meaning they are getting more efficient per parameter. In other words, models are learning to perform better using fewer parameters.

The authors of the paper introduce Capability Density (ρ) as a new metric for evaluating this efficiency.

What Is Capability Density?

Capability Density (ρ) measures how effectively a model uses its parameters. It’s defined as:

Where:

  • Effective Parameter Size: The number of parameters a smaller, hypothetical model would need to match the performance of a larger model.
  • Actual Parameter Size: The real number of parameters the evaluated model has.

Why Does This Matter?

A higher Capability Density means a model can match or exceed the performance of much larger models while using fewer parameters. This efficiency translates into lower computational costs, faster inference times, and more sustainable AI models.

The Problem It Solves: Why the Densing Law Is Useful

The Densing Law directly addresses three critical AI challenges:

1. Model Size Explosion: As LLMs grow, their size becomes difficult to manage.

2. Inference Costs: Deploying LLMs in real-time applications (e.g., chatbots) is expensive due to high processing demands.

3. Hardware Bottlenecks: Even with advances in chip design, hardware improvement follows Moore’s Law, doubling only every 2.1 years, while AI research requires faster progress.

The Densing Law’s focus on efficiency rather than size could break these barriers, enabling smaller, denser models that outperform larger ones without needing more hardware.

How Capability Density Is Measured: A Technical Breakdown

To calculate Capability Density, the authors propose a two-step evaluation process:

1. Model Loss Estimation (How well does the model perform?)

2. Performance Estimation (How much work do the model’s parameters contribute?)

What Is Model Loss?

Loss measures how far a model’s predictions are from the correct answer. Lower loss means better performance.

For LLMs, Conditional Language Model Loss is defined as:

Where:

  • P(answer | instruction): The likelihood that the model produces the correct answer given a specific input prompt.

Loss Estimation Formula

The authors estimate the model’s loss using a mathematical equation based on two factors:

  • Model Size (N): Number of trainable parameters in the model.
  • Training Data Size (D): Number of tokens (words or symbols) the model was trained on.

The empirical loss function is:

Where:

  • a, b: Constants that adjust the equation based on real-world data.
  • N: Model size (number of parameters).
  • D: Training data size.
  • α, β: Constants determining how much scaling improves the model.

While Loss (L) reflects how well a model can predict the correct answer, it doesn’t directly explain how useful the model is when applied to real-world tasks, such as summarizing text, answering questions, or translating languages.

To bridge this gap, the paper introduces a Performance Function (S), which maps loss to task performance scores.

Performance Estimation

Once the model’s loss is known (as calculated above), the next step is estimating its performance on tasks like question answering or summarization.

The performance function is:

Where:

  • S: Model performance score on specific tasks.
  • L: Estimated model loss.
  • c, γ, l, d: Constants fitted using experimental data.

How This Equation Works: When the loss is particularly large, the model’s performance should approximate that of random guessing, and when the loss is particularly small, the model’s performance should approach the upper bound, c+d.

Why This Sigmoid-Like Equation Works

  • Smooth Transition: The sigmoid-like function allows for a smooth transition from poor performance (high loss) to near-perfect performance (low loss).
  • Diminishing Returns: Improvements become incrementally smaller as loss decreases, which reflects real-world behavior where larger models with very low loss provide only marginal performance gains on tasks.

Where It Is Used in the Densing Law Framework

After estimating the model’s task performance using the sigmoid equation, the authors calculate the Effective Parameter Size, which tells us how many parameters a smaller, more efficient model would need to achieve the same performance S.

The paper inverts the performance estimation equation to determine what parameter size would produce the given loss and performance score:

This estimated loss is plugged back into the earlier Loss-Parameter Equation:

Calculating Capability Density

Finally, the Capability Density (ρ) is computed by dividing the Effective Parameter Size by the Actual Parameter Size:

Real-World Validation: Does It Actually Work?

The authors tested 29 state-of-the-art models, including:

  • LLaMA-2
  • Falcon
  • MiniCPM
  • Mistral

Key Findings

1. Exponential Efficiency Growth: The maximum Capability Density (ρ) has been doubling every 3.3 months since early 2023, indicating an exponential improvement.

2. Post-ChatGPT Acceleration: Following ChatGPT’s release, efficiency growth accelerated by 50%, showing a major industry shift toward optimizing models for efficiency.

3. Inference Cost Reduction: Inference costs fell by 266x due to denser models.

Why the Densing Law Changes the Game

The Densing Law isn’t just theoretical — it has real-world implications that could reshape the future of AI development.

Key Impacts of the Densing Law

1. Reduced Training Costs: Models can achieve high performance with fewer parameters, lowering training expenses.

2. More Efficient Inference: Denser models are computationally cheaper to run, reducing inference costs in production.

3. Greener AI: AI’s carbon footprint could be dramatically reduced if the industry shifts toward density-optimized training.

4. Accelerating AI Development: Models could evolve faster, even outpacing Moore’s Law, because efficiency improvements are occurring every 3.3 months.

What’s Next?

The Densing Law of LLMs offers a compelling alternative to the traditional scaling paradigm in AI. By focusing on efficiency per parameter, it provides a sustainable and cost-effective path forward for LLM development.

What Do You Think? Could the Densing Law reshape the way AI models are built and deployed?

--

--

Anna Alexandra Grigoryan
Anna Alexandra Grigoryan

Written by Anna Alexandra Grigoryan

red schrödinger’s cat thinking of doing something brilliant

No responses yet