SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.17481 · NeurIPS · 2024

MaskLLM: Learnable Semi-Structured Sparsity for Large Language Models

Jan Kautz, Xinchao Wang, Hongxu Yin, Greg Heinrich, Pavlo Molchanov, Gongfan Fang, Saurav Muralidharan, Jeff Pool

arXiv · PDF · Open in the Atlas

Code that ran

5 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 11 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2409.17481.json · badge: /api/ran/2409.17481.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
NVlabs/MaskLLM canonical (classifier label)
classifier basis: census
2 ran · 4 no recorded run
nvlabs/maskllm community
Papers with Code archive
3 ran · 7 no recorded run
FunctionStatusWhere it lives
CudaRNGStatesTracker Ran
ran on a synthesized input · constructed an object; no result was computed
nvlabs/maskllm/learnable_sparsity/differentiable_mask.py
pointer only (licence: NOASSERTION) · get_code("3a4d0d8bbbbf7679")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/maskllm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_cuda_rng_tracker Ran
ran on a synthesized input
nvlabs/maskllm/learnable_sparsity/differentiable_mask.py
pointer only (licence: NOASSERTION) · get_code("7073cc1e555d6836")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/maskllm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_expert_parallel_rng_tracker_name Ran
ran on a synthesized input
nvlabs/maskllm/learnable_sparsity/differentiable_mask.py
pointer only (licence: NOASSERTION) · get_code("8d9516b99abbc7b5")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/maskllm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_llm Ran
ran; our contract draft was wrong, not the code
NVlabs/MaskLLM/tool_compute_mask_hf.py
pointer only (licence: NOASSERTION) · get_code("1b16cd00fbac2ce5")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, NVlabs/MaskLLM (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_wikitext2 Ran
ran on a synthesized input
NVlabs/MaskLLM/eval_llama_ppl.py
pointer only (licence: NONE); the stored copy get_code serves, from zyxxmu/dsnot, is pointer only (licence: NONE) · get_code("dee8be97b2cf4692")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NVlabs/MaskLLM when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

DifferentiableMask Not yet run
unverified (harvested, no recorded run)
nvlabs/maskllm/learnable_sparsity/differentiable_mask.py
pointer only (licence: NOASSERTION) · get_code("3feb197bb2f80c7c")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/maskllm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

_ensure_var_is_initialized Not yet run
unverified (harvested, no recorded run)
nvlabs/maskllm/learnable_sparsity/differentiable_mask.py
pointer only (licence: NOASSERTION) · get_code("20d99399acdd4df8")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/maskllm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

_initialize_affine_weight_gpu Not yet run
unverified (harvested, no recorded run)
nvlabs/maskllm/learnable_sparsity/differentiable_mask.py
pointer only (licence: NOASSERTION) · get_code("6cd59afbca9bb213")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/maskllm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

_set_cuda_rng_state Not yet run
unverified (harvested, no recorded run)
nvlabs/maskllm/learnable_sparsity/differentiable_mask.py
pointer only (licence: NOASSERTION) · get_code("bbfbfd2fc26ae9c4")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/maskllm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_args Not yet run
unverified (harvested, no recorded run)
nvlabs/maskllm/learnable_sparsity/differentiable_mask.py
pointer only (licence: NOASSERTION) · get_code("d25230985eb2b130")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/maskllm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_c4 Not yet run
unverified (harvested, no recorded run)
NVlabs/MaskLLM/eval_llama_ppl.py
pointer only (licence: NONE); the stored copy get_code serves, from zyxxmu/dsnot, is pointer only (licence: NONE) · get_code("7630a157a3b32ab9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NVlabs/MaskLLM when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_loaders Not yet run
unverified (harvested, no recorded run)
NVlabs/MaskLLM/eval_llama_ppl.py
pointer only (licence: NOASSERTION) · get_code("a6cf7a5e8f29a402")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, NVlabs/MaskLLM (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

load_checkpoint_to_model Not yet run
unverified (harvested, no recorded run)
NVlabs/MaskLLM/tool_export_to_hf.py
pointer only (licence: NOASSERTION) · get_code("91e00b8286e04fd0")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, NVlabs/MaskLLM (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
NVlabs/MaskLLM/megatron/arguments.py
pointer only (licence: NOASSERTION) · get_code("f2ce3a79ab6a26c5")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, NVlabs/MaskLLM (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

print_rank_0 Not yet run
unverified (harvested, no recorded run)
nvlabs/maskllm/learnable_sparsity/differentiable_mask.py
pointer only (licence: NOASSERTION) · get_code("44ee8f559edfd194")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/maskllm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

set_tensor_model_parallel_attributes Not yet run
unverified (harvested, no recorded run)
nvlabs/maskllm/learnable_sparsity/differentiable_mask.py
pointer only (licence: NOASSERTION) · get_code("5c24809f67be0e0a")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/maskllm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 2 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_wikitext2 15 other papers
9 dated earlier, 4 later, 2 same year, order not determinable · 1 only as an assembly brick
2306.11695 (2023-06)
A Simple and Effective Pruning Approach for Large Language Models
2310.01382 (2023-10)
Compressing LLMs: The Truth is Rarely Pure and Never Simple
2310.05175 (2023-10)
Outlier Weighed Layerwise Sparsity (OWL ): A Missing Secret Sauce for Pruning LLMs to High Sparsity
and 12 more not named here
get_c4 10 other papers
5 dated earlier, 3 later, 2 same year, order not determinable · 1 only as an assembly brick
2306.11695 (2023-06)
A Simple and Effective Pruning Approach for Large Language Models
2310.05175 (2023-10)
Outlier Weighed Layerwise Sparsity (OWL ): A Missing Secret Sauce for Pruning LLMs to High Sparsity
2310.08915 (2023-10)
Dynamic Sparse No Training: Training-Free Fine-tuning for Sparse LLMs
and 7 more not named here
print_rank_0
brick of this paper's assembly: helper
2 other papers
2 dated earlier
2204.07496 (2022-04)
Improving Passage Retrieval with Zero-Shot Question Generation
2210.02414 (2022-10)
GLM-130B: An Open Bilingual Pre-trained Model
CudaRNGStatesTracker
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1909.08053 (2019-09)
Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism
_set_cuda_rng_state
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1909.08053 (2019-09)
Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism
get_cuda_rng_tracker
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1909.08053 (2019-09)
Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

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

Abstract

Large Language Models (LLMs) are distinguished by their massive parameter counts, which typically result in significant redundancy. This work introduces MaskLLM, a learnable pruning method that establishes Semi-structured (or "N:M") Sparsity in LLMs, aimed at reducing computational overhead during inference. Instead of developing a new importance criterion, MaskLLM explicitly models N:M patterns as a learnable distribution through Gumbel Softmax sampling. This approach facilitates end-to-end training on large-scale datasets and offers two notable advantages: 1) High-quality Masks -our method effectively scales to large datasets and learns accurate masks; 2) Transferability -the probabilistic modeling of mask distribution enables the transfer learning of sparsity across domains or tasks. We assessed MaskLLM using 2:4 sparsity on various LLMs, including LLaMA-2, Nemotron-4, and GPT-3, with sizes ranging from 843M to 15B parameters, and our empirical results show substantial improvements over state-of-the-art methods. For instance, leading approaches achieve a perplexity (PPL) of 10 or greater on Wikitext compared to the dense model's 5.12 PPL, but MaskLLM achieves a significantly lower 6.72 PPL solely by learning the masks with frozen weights. Furthermore, MaskLLM's learnable nature allows customized masks for lossless application of 2:4 sparsity to downstream tasks or domains. Code is available at https://github.com/NVlabs/MaskLLM.

For agents

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

get_harvested_code_for_paper("2409.17481")
get_code_for_paper("2409.17481")
have("2409.17481")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2409.17481.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2409.17481.svg)](https://syntology.ai/paper/2409.17481)

Connect an agent — have() is free.