NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Compute Where it Counts: Self Optimizing Language Models

Yash Akhauri, Mohamed S. Abdelfattah

Introduction

Efficient Large Language Model (LLM) inference has traditionally focused on reducing the cost of each decoding step through static compression techniques like quantization, pruning, or sparse attention. However, these methods apply a uniform computation budget to every generated token. In practice, token difficulty varies widely: predicting the next word in a common phrase is computationally "easy," while resolving a complex logical deduction is "hard."

Self-Optimizing Language Models (SOL) introduce a dynamic budget allocation framework. By learning exactly how much computation to spend per token from within a single model, SOL achieves significantly better accuracy-to-efficiency trade-offs than standard static compression methods, improving MMLU accuracy by up to 7.3% at matched compute budgets.

The Problem: Static Compression and KV-Pollution

When optimizing LLMs, efficiency is usually treated as a static game. If you want a faster model, you might quantize it to 4 bits or prune 50% of its neurons. Because these methods apply the same level of compression to every token, they inevitably over-compute on easy tokens and under-compute on hard ones, leading to unnecessary quality loss.

Furthermore, efficiency decisions in autoregressive decoding are sequential. If a model aggressively compresses a token early in the sequence, it risks "polluting" the Key-Value (KV) cache. This KV-pollution makes it harder for the model to accurately attend to that information many steps later. SOL treats compute allocation as a sequential decision problem specifically to navigate this challenge and optimize long-term generation quality.

The SOL Architecture and Methods

To dynamically allocate compute, the researchers introduce a two-part system:

  1. The Base Model: A frozen, pre-trained LLM (such as Llama-3).
  2. The Policy Network: A lightweight, autoregressive transformer (e.g., only ~8.5M parameters for an 8B model) that operates alongside the LLM.

At each decoding step, the policy network analyzes the LLM's hidden state and selects an efficiency action across three distinct axes:

  • Token-level Attention Sparsity: Deciding how many previous tokens to attend to (utilizing the Quest algorithm).
  • Structured Activation Pruning: Deciding which MLP channels to skip (using TEAL-style pruning).
  • Activation Quantization: Deciding the bit-width (ranging from 5 to 16 bits) for the MLP output.

Training with GRPO

The policy network is trained using Group-Relative Policy Optimization (GRPO). During training, the token sequence is fixed (teacher forcing), but the system samples multiple "counterfactual" compute schedules—trajectories of efficiency actions for the same token path. The reward function evaluates how these different schedules affect the model's likelihood of predicting the correct next token, balancing high language-model quality against a soft penalty for exceeding a requested target compute budget.

Key Insights and Results

The SOL framework was trained on a sample of the AllenAI Dolma dataset and evaluated across perplexity benchmarks (WikiText), downstream tasks (ARC-Easy, PIQA, WinoGrande), and reasoning challenges (MMLU, GSM8K).

Key findings include:

  • A Superior Pareto Frontier: Across Llama-3.2-1B, 3B, and Llama-3.1-8B-Instruct, SOL consistently maintained a better quality-vs-compute curve than static baselines. On MMLU, SOL improved accuracy by up to 7.3% over uniform budget allocation strategies at the same average compute cost.
  • Runtime Controllability: Because the policy is conditioned on a target budget scalar, users can dial the efficiency up or down at runtime. A single policy adapts its strategy based on the requested target, eliminating the need to train separate models for 50% vs. 80% efficiency.
  • Smarter than Heuristics: The learned policy outperforms hand-crafted heuristics (like using entropy or hidden state drift) and beats strong random schedule searches. In stress tests against 500 randomly sampled compute schedules, the SOL policy matched or exceeded the best-of-500 random schedule, proving it intelligently targets specific tokens.
  • Quantifying KV-Pollution: The paper reveals that "cheap" decisions early in generation cause perplexity spikes later. Notably, token sparsity (skipping attention to certain tokens) causes the most long-term damage to the KV cache compared to pruning or quantization.
  • Low Overhead and Complementary Gains: The policy network adds negligible latency due to its tiny size. Furthermore, SOL is orthogonal to weight-based compression; it can be applied to an already weight-quantized model to dynamically manage its activation and attention compute.

Limitations and Future Directions

While SOL presents a compelling step forward for dynamic inference, the current research relies on "Net Keep-Rate" as a proxy for compute rather than wall-clock time. Actual latency gains will depend heavily on specific GPU kernel implementations for the underlying sparsity and quantization algorithms.

Additionally, the current policy selects a single action per step that applies to all layers. Future work could explore per-layer or per-head control to unlock even greater efficiency, though this would significantly increase the complexity of the action space. Finally, combining SOL with "early-exit" strategies (skipping layers entirely) remains a promising, unexplored frontier for self-optimizing models.

Summary updated

BibTeX
@inproceedings{akhauri2026compute,
  author = {Yash Akhauri and Mohamed S. Abdelfattah},
  title = {{Compute Where it Counts: Self Optimizing Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=1OPGcMM2Xt},
}
Figure