TensorRT-LLM PR #10672
DOI: 10.5281/zenodo.18282008

Cut MoE Inference
Costs by 30-50%

Entropy-guided dynamic expert selection for Mixture-of-Experts models. Same accuracy, dramatically lower compute. Validated on Nemotron 3 Nano, Mixtral, Qwen-MoE, and OLMoE.

31.0%
Mixtral savings
32.4%
Qwen-MoE savings
24.7%
OLMoE savings
adaptive_k_routing.py
def select_experts(router_logits):
    # Compute routing entropy
    probs = softmax(router_logits)
    H = -sum(p * log(p))

    # Low entropy = confident routing
    # Use fewer experts!
    if H < 0.6:
        K = 1  # 87.5% compute saved
    elif H < 1.2:
        K = 2  # 75% compute saved
    else:
        K = 4  # Full routing

    return top_k(probs, K)

Validated Results

Real compute savings on production MoE models. Accuracy measured relative to full Top-K routing baseline.

Nemotron 3 Nano

MoE
33.3%
Compute Reduction
99.9% accuracy retained

NVIDIA Nemotron 3 Nano: 128 experts, validated Jan 2026

Mixtral 8x7B

MoE
31.0%
Compute Reduction
99.8% accuracy retained

K=1 used 78% of the time with minimal quality loss

Qwen-MoE

MoE
32.4%
Compute Reduction
99.9% accuracy retained

Effective across all entropy thresholds

OLMoE-1B-7B

MoE
24.7%
Compute Reduction
99.7% accuracy retained

Consistent savings on smaller MoE architecture

🔬 Multiplicative Savings: Technique Combinations

Adaptive-K stacks with other optimizations. Savings multiply, not just add.

Adaptive-K + Early Exit

COMBO
68.0%
Compute Reduction
Only 32.0% compute used

Adaptive-K + ToMe

COMBO
51.9%
Compute Reduction
Only 48.1% compute used
🏆 BEST

Triple Combo

MAX
90.7%
Compute Reduction
Only 9.3% compute used

💡 Key Insight: Adaptive-K reduces experts per token, Early Exit skips layers, Token Pruning (ToMe) reduces sequence length. Combined: 0.69 × 0.687 × 0.65 = 0.093 (90.7% savings). See Whitepaper Proposition 7.1.

Results validated via WikiText-2 perplexity benchmarks

How It Works

Adaptive-K uses information theory to make intelligent routing decisions. The key insight: routing entropy predicts when fewer experts are sufficient.

01

Compute Router Entropy

For each token, calculate the entropy H of the router softmax distribution. Low entropy = confident routing.

H = -sum(p * log(p))
02

Dynamic K Selection

Based on entropy thresholds, select fewer experts for confident tokens, more for uncertain ones.

K = 1 if H < 0.6 else (2 if H < 1.2 else 4)
03

Sparse Expert Execution

Only execute the selected K experts. Skip unnecessary computation entirely.

output = sum(expert[i](x) * w[i] for i in top_k)
💡

The Key Insight

When the router is confident (low entropy), it has already identified the "right" expert. Running additional experts adds compute cost but minimal value. By dynamically adjusting K based on entropy, we skip unnecessary work while maintaining output quality.

NEW IN v0.1.4

Production Observability

Monitor, debug, and optimize your Adaptive-K deployment with built-in observability tools.

📊

Prometheus Metrics

Production-ready metrics: latency, throughput, K distribution, compute savings

metrics.start_http_server(9090)
# adaptive_k_latency_seconds
# adaptive_k_avg_k
# adaptive_k_compute_saved_ratio
📝

Structured Logging

JSON-formatted logs for ELK, Datadog, or any log aggregator

logger = get_logger("inference")
logger.log_inference(trace)
# {"ts":"...", "avg_k":1.5, "latency_ms":45}
🔍

Tracing & Debug

Per-layer entropy analysis and K selection visualization

debugger.trace_k_selection(entropies)
# Layer 0 | H=0.42 ████░░░░ | K=1
# Layer 1 | H=1.23 ████████ | K=4

A/B Testing

Built-in framework to compare Adaptive-K vs Full-K in production

ab_test.assign_variant(request_id)
ab_test.compute_results()
# Latency: -32%, Quality: -0.1%

Install with observability support:

pip install adaptive-k-routing[observability]

What We Do

Bring Adaptive-K savings to your production MoE deployments. All services include documentation and knowledge transfer.

Feasibility Assessment

Analyze your MoE deployment to estimate potential savings and create an implementation roadmap.

  • Router entropy analysis
  • Savings projection report
  • Implementation roadmap
  • Risk assessment

Full Implementation

Complete Adaptive-K integration into your inference pipeline with production-ready code.

  • Custom threshold calibration
  • Production-ready code
  • Performance benchmarks
  • Integration support
  • 30-day warranty

Expert Consulting

On-demand expertise for AI optimization, architecture review, and team training.

  • Architecture review
  • Performance tuning
  • Team training
  • Code review

Services & Pricing

Expert consulting and integration services. The SDK is free and open source - you pay for our expertise and time.

Discovery Call

45-minute expert consultation

  • Analyze your MoE stack
  • ROI estimation
  • Implementation roadmap
  • Q&A session
  • Recording provided
Most Popular

Integration Package

Complete Adaptive-K implementation

  • Full implementation
  • Custom threshold calibration
  • Production-ready code
  • Performance benchmarks
  • 30-day support included
  • Documentation & training

Enterprise Support

Ongoing support & priority access

  • SLA guarantees
  • Dedicated Slack channel
  • Priority bug fixes
  • Monthly review calls
  • Custom feature requests
  • Invoice billing
All services tailored to your needs.Get in touch
Secure payments
Invoice available
Satisfaction guaranteed

Get In Touch

Ready to reduce your MoE inference costs? Let's discuss how Adaptive-K can help.

Or email us directly at: amministrazione@vertexdata.it