SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.11257 · ICML · 2024

ExCP: Extreme LLM Checkpoint Compression via Weight-Momentum Joint Shrinking

Wenshuo Li, Xinghao Chen, Yunhe Wang, Yehui Tang, Han Shu, Xing- Hao Chen

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 0 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/2406.11257.json · badge: /api/ran/2406.11257.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
gaffey/excp canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
Gaffey/ExCP canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gaffey/excp/LMtrainer/pretrain.py
code served (permissive licence) · get_code("8a38d7c525fad8f1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from sklearn.metrics import accuracy_score

torch.manual_seed(0)

# Create small sample predictions and references
# These should be class labels (integers or strings)
predictions = np.array([0, 1, 1, 0, 1, 2])
references = np.array([0, 1, 0, 0, 1, 2])

# Create sample weights (optional parameter)
sample_weight = np.array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0])

ARGS = {
    'predictions': predictions,
    'references': references,
    'normalize': True,
    'sample_weight': sample_weight
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
divide Ran
ran, honoured the contract we drafted
gaffey/excp/LMtrainer/mpu/utils.py
code served (permissive licence) · get_code("33de97c702d46371")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function divide() takes two parameters: numerator and denominator
# It performs modulo and integer division operations on them
# Both should be integers

ARGS = {
    "numerator": 12,
    "denominator": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
fault_tolerance_data_collator Ran
ran; our contract draft was wrong, not the code
gaffey/excp/LMtrainer/pretrain.py
code served (permissive licence) · get_code("c12b8cc9acc7e10f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create sample features as list of dictionaries
# The function expects a list of feature dictionaries
features = [
    {
        'input_ids': torch.tensor([1, 2, 3, 4]),
        'attention_mask': torch.tensor([1, 1, 1, 0]),
        'label': 0
    },
    {
        'input_ids': torch.tensor([5, 6, 7, 8]),
        'attention_mask': torch.tensor([1, 1, 0, 0]),
        'label': 1
    }
]

ARGS = {
    'features': features
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_pythia_config Ran
ran; our contract draft was wrong, not the code
gaffey/excp/LMtrainer/pretrain.py
code served (permissive licence) · get_code("c2727b034c1d4655")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned GPTNeoXConfig. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
import os
from transformers.models.gpt_neox.configuration_gpt_neox import GPTNeoXConfig

# Create a temporary JSON config file
config_dict = {
    "hidden_size": 768,
    "num_hidden_layers": 12,
    "num_attention_heads": 12,
    "intermediate_size": 3072,
    "hidden_act": "gelu",
    "hidden_dropout_prob": 0.1,
    "attention_probs_dropout_prob": 0.1,
    "max_position_embeddings": 512,
    "type_vocab_size": 2,
    "initializer_range": 0.02,
    "layer_norm_eps": 1e-12,
    "vocab_size": 50257,
}

# Create a temporary file with the config
temp_dir = tempfile.mkdtemp()
config_path = os.path.join(temp_dir, "config.json")
with open(config_path, 'w') as f:
    json.dump(config_dict, f)

ARGS = {
    "config_path": config_path,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GPTNeoXConfig — a GPTNeoXConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GPTNeoXConfig output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
prune Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Gaffey/ExCP/compress_pythia.py
code served (permissive licence) · get_code("9d020e96607ddadd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor for pruning
tensor = torch.randn(2, 4)

# Define the ARGS dictionary with all parameters
ARGS = {
    "tensor": tensor,
    "mag_thres": 0.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
prune_optimizer Ran
ran; our contract draft was wrong, not the code
Gaffey/ExCP/compress_pythia.py
code served (permissive licence) · get_code("8358aaebb9f596b7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small tensors for the function parameters
# exp_tensor: used for abs() and mean() operations
exp_tensor = torch.randn(2, 4)

# exp_sq_tensor: used in where() conditional, same shape as exp_tensor
exp_sq_tensor = torch.randn(2, 4)

# tensor: used in where() conditional to check for zeros, same shape as exp_tensor
tensor = torch.randn(2, 4)
tensor[0, 1] = 0  # Add a zero to test the zero-checking logic

# j: threshold multiplier, default is 1
j = 1

ARGS = {
    "exp_tensor": exp_tensor,
    "exp_sq_tensor": exp_sq_tensor,
    "tensor": tensor,
    "j": j,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
quant Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gaffey/excp/compress_pythia.py
code served (permissive licence) · get_code("5e61758e06c2d266")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
import copy

torch.manual_seed(0)

# The function takes a tensor and bit_num parameter
# We need to create a tensor that:
# 1. Has some non-zero elements (for kmeans training)
# 2. Has shape divisible by (8 // bit_num)
# 3. Is small enough to be practical

# For bit_num=4, 8 // bit_num = 2
# So we need a tensor with shape divisible by 2 in the flattened dimension

# Create a small tensor: shape (4, 4) = 16 elements when flattened
# This is divisible by 2 (for bit_num=4)
tensor = torch.randn(4, 4)

# Ensure we have enough non-zero elements (more than 2^4 - 1 = 15)
# to trigger the kmeans path
tensor[tensor.abs() < 0.1] = torch.randn_like(tensor[tensor.abs() < 0.1])

# Make sure we have plenty of non-zero values
tensor = tensor + 0.5

bit_num = 4

ARGS = {
    "tensor": tensor,
    "bit_num": bit_num
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
faiss, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_tensor_along_last_dim Ran
ran; our contract draft was wrong, not the code
gaffey/excp/LMtrainer/mpu/utils.py
code served (permissive licence) · get_code("ff0731adadbb3e8f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor with shape (2, 4, 8)
# Last dimension is 8, which should be divisible by num_partitions
tensor = torch.randn(2, 4, 8)

# Number of partitions to split the last dimension
num_partitions = 4

# Whether to make split chunks contiguous in memory
contiguous_split_chunks = False

ARGS = {
    "tensor": tensor,
    "num_partitions": num_partitions,
    "contiguous_split_chunks": contiguous_split_chunks
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
traverse_cache_root Ran
ran; our contract draft was wrong, not the code
gaffey/excp/LMtrainer/data_utils/traverse_utils.py
code served (permissive licence) · get_code("ada1a7cf46c42f0c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pathlib
import os
import tempfile

# Create a temporary directory structure with cached datasets
temp_dir = tempfile.mkdtemp()

# Create nested directory structure with dataset_dict.json files
cache_dir_1 = os.path.join(temp_dir, "cache", "dataset_1")
cache_dir_2 = os.path.join(temp_dir, "cache", "subdir", "dataset_2")
cache_dir_3 = os.path.join(temp_dir, "other", "dataset_3")

os.makedirs(cache_dir_1, exist_ok=True)
os.makedirs(cache_dir_2, exist_ok=True)
os.makedirs(cache_dir_3, exist_ok=True)

# Create dataset_dict.json files in each cache directory
with open(os.path.join(cache_dir_1, "dataset_dict.json"), "w") as f:
    f.write("{}")

with open(os.path.join(cache_dir_2, "dataset_dict.json"), "w") as f:
    f.write("{}")

with open(os.path.join(cache_dir_3, "dataset_dict.json"), "w") as f:
    f.write("{}")

# Define ARGS dictionary with the root directory
ARGS = {
    "root_dir": temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
travese_json_root Ran
ran; our contract draft was wrong, not the code
gaffey/excp/LMtrainer/data_utils/traverse_utils.py
code served (permissive licence) · get_code("1b1aa00e64679073")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pathlib
import tempfile
import os

# Create a temporary directory with some JSON files for testing
temp_dir = tempfile.mkdtemp()

# Create some test JSON files in nested directories
os.makedirs(os.path.join(temp_dir, "subdir1"), exist_ok=True)
os.makedirs(os.path.join(temp_dir, "subdir2", "nested"), exist_ok=True)

# Create dummy JSON files
with open(os.path.join(temp_dir, "file1.json"), "w") as f:
    f.write("{}")

with open(os.path.join(temp_dir, "subdir1", "file2.json"), "w") as f:
    f.write("{}")

with open(os.path.join(temp_dir, "subdir2", "nested", "file3.json"), "w") as f:
    f.write("{}")

# Also create a non-JSON file to ensure it's not included
with open(os.path.join(temp_dir, "file.txt"), "w") as f:
    f.write("not json")

ARGS = {
    "text_dir": temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 7 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
accuracy 5 other papers
5 dated earlier
2304.08177 (2023-04)
Efficient and Effective Text Encoding for Chinese LLaMA and Alpaca
2310.09089 (2023-10)
Qilin-Med: Multi-stage Knowledge Injection Advanced Medical Large Language Model
2402.16445 (2024-02)
ProLLaMA: A Protein Large Language Model for Multi-Task Protein Language Processing
and 2 more not named here
divide 4 other papers
3 dated earlier, 1 later
1909.08053 (2019-09)
Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism
2209.02970 (2022-09)
Fengshenbang 1.0: Being the Foundation of Chinese Cognitive Intelligence
2404.03608 (2024-04)
Sailor: Open Language Models for South-East Asia
and 1 more not named here
split_tensor_along_last_dim 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 (LLM) have recently attracted significant attention in the field of artificial intelligence. However, the training process of these models poses significant challenges in terms of computational and storage capacities, thus compressing checkpoints has become an urgent problem. In this paper, we propose a novel Extreme Checkpoint Compression (ExCP) framework, which significantly reduces the required storage of training checkpoints while achieving nearly lossless performance. We first calculate the residuals of adjacent checkpoints to obtain the essential but sparse information for higher compression ratio. To further excavate the redundancy parameters in checkpoints, we then propose a weight-momentum joint shrinking method to utilize another important information during the model optimization, i.e., momentum. In particular, we exploit the information of both model and optimizer to discard as many parameters as possible while preserving critical information to ensure optimal performance. Furthermore, we utilize non-uniform quantization to further compress the storage of checkpoints. We extensively evaluate our proposed ExCP framework on several models ranging from 410M to 7B parameters and demonstrate significant storage reduction while maintaining strong performance. For instance, we achieve approximately 70× compression for the Pythia-410M model, with the final performance being as accurate as the original model on various downstream tasks. Codes will be available at https://github.com/Gaffey/ExCP.

For agents

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

get_harvested_code_for_paper("2406.11257")
get_code_for_paper("2406.11257")
have("2406.11257")

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

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

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

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

Connect an agent — have() is free.