SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.14884 · NeurIPS · 2025

Polar Sparsity: High Throughput Batched LLM Inferencing with Scalable Contextual Sparsity

Nikoli Dryden, Susav Shrestha, Brad Settlemyer, Narasimha Reddy

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 3 functions out of this paper's own repositories and ran 3 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
susavlsh10/polar-sparsity canonical 3 of 3
FunctionStatusWhere it lives
initialize_data_structures Ran susavlsh10/polar-sparsity/HybridTensor/routers/datacollection/data_collection.py
code served (permissive licence) · get_code("af8781316172eaf2")
load_layer_data Ran susavlsh10/polar-sparsity/HybridTensor/routers/datacollection/data_collection.py
code served (permissive licence) · get_code("738f12bdf709b633")
process_batch Ran susavlsh10/polar-sparsity/HybridTensor/routers/datacollection/data_collection.py
code served (permissive licence) · get_code("314abce3a7becf22")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Accelerating large language model (LLM) inference is critical for real-world deployments requiring high throughput and low latency. Contextual sparsity, where each token dynamically activates only a small subset of the model parameters, shows promise but does not scale to large batch sizes due to union of active neurons quickly approaching dense computation. We introduce Polar Sparsity, highlighting a key shift in sparsity importance from MLP to Attention layers as we scale batch size and sequence length. While MLP layers become more compute-efficient under batching, their sparsity vanishes. In contrast, attention becomes increasingly more expensive at scale, while their head sparsity remains stable and batch-invariant. We develop Selective Head Attention with hardware-efficient, sparsity-aware GPU kernels, delivering up to 2.2× end-to-end speedups for models like OPT, LLaMA-2 & 3, Qwen, Mistral across various batch sizes and sequence lengths without compromising accuracy. To our knowledge, this is the first work to demonstrate that contextual sparsity can scale effectively to large batch sizes, delivering substantial inference acceleration with minimal changes, making Polar Sparsity practical for large-scale, high-throughput LLM deployment systems. Our code is available at: https://github.com/susavlsh10/Polar-Sparsity.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2505.14884")
get_code_for_paper("2505.14884")
have("2505.14884")

Connect an agent — have() is free.