SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.17215 · ICLR · 2025

MiniPLM: Knowledge Distillation for Pre-Training Language Models

Minlie Huang, Hao Zhou, Jie Zhou, Fandong Meng, Yuxian Gu

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 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; 8 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2410.17215.json · badge: /api/ran/2410.17215.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
thu-coai/MiniPLM canonical (classifier label)
classifier basis: census
9 ran · 3 no recorded run
FunctionStatusWhere it lives
add_model_args Ran
ran; our contract draft was wrong, not the code
thu-coai/MiniPLM/arguments.py
code served (permissive licence) · get_code("0bc5687474aef13d")
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 ArgumentParser. 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 argparse

def add_model_args(parser: argparse.ArgumentParser):
    """Model arguments"""
    group = parser.add_argument_group('model', 'model configuration')
    group.add_argument('--model-path', type=str, help='model path')
    group.add_argument('--ckpt-name', type=str)
    group.add_argument('--model-type', type=str, default=None)
    group.add_argument('--teacher-model-type', type=str, default=None)
    group.add_argument('--n-gpu', type=int, default=1)
    group.add_argument('--n-nodes', type=int, default=1)
    group.add_argument('--teacher-model-path', type=str)
    group.add_argument('--teacher-ckpt-name', type=str)
    group.add_argument('--teacher-model-fp16', action='store_true')
    group.add_argument('--base-model-path', type=str)
    group.add_argument('--base-ckpt-name', type=str)
    group.add_argument('--model-parallel', action='store_true')
    group.add_argument('--model-parallel-size', type=int, default=None)
    group.add_argument('--fp32', action='store_true')
    group.add_argument('--attn-impl', type=str, default=None)
    group.add_argument('--xops-attn', action='store_true')
    group.add_argument('--torch-compile', type=str, default=None)
    group.add_argument('--ckpt-start', type=int, default=0)
    group.add_argument('--ckpt-end', type=int, default=None)
    return parser

parser = argparse.ArgumentParser()

ARGS = {
    'parser': parser
}
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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
add_runtime_args Ran
ran; our contract draft was wrong, not the code
thu-coai/MiniPLM/arguments.py
code served (permissive licence) · get_code("12b30d3c2c4c55cf")
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 ArgumentParser. 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 argparse

parser = argparse.ArgumentParser()

ARGS = {
    'parser': parser
}
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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
best_fitting_dtype Ran
ran; our contract draft was wrong, not the code
thu-coai/MiniPLM/data_utils/indexed_dataset.py
code served (permissive licence) · get_code("b3338fae912274b3")
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 type. 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 numpy as np

# Test case 1: vocab_size < 65500, should return np.uint16
ARGS = {
    "vocab_size": 1000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
code Ran
ran, honoured the contract we drafted
thu-coai/MiniPLM/data_utils/distributed_indexed.py
code served (permissive licence) · get_code("18d94355ea8f1c39")
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 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 numpy as np

dtypes = {1: np.uint8, 2: np.int8, 3: np.int16, 4: np.int32, 5: np.int64, 6: np.float32, 7: np.double, 8: np.uint16}

def code(dtype):
    for k in dtypes.keys():
        if dtypes[k] == dtype:
            return k
    raise ValueError(dtype)

# Test with np.float32
ARGS = {
    "dtype": np.float32
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
data_file_path Ran
ran; our contract draft was wrong, not the code
thu-coai/MiniPLM/data_utils/distributed_indexed.py
code served (permissive licence) · get_code("bdf28f9492a770dc")
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 str. 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)

ARGS = {
    "prefix_path": "/tmp/data_file"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_distribution Ran
ran; our contract draft was wrong, not the code
thu-coai/MiniPLM/utils.py
code served (permissive licence) · get_code("ae64ae2a98def56a")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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

torch.manual_seed(0)

# Create a small logits tensor (batch_size=2, vocab_size=4)
logits = torch.randn(2, 4)

# Create a temperature value (scalar)
temperature = 0.8

ARGS = {
    "logits": logits,
    "temperature": temperature,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
index_file_path Ran
ran; our contract draft was wrong, not the code
thu-coai/MiniPLM/data_utils/distributed_indexed.py
code served (permissive licence) · get_code("8b1a74a6db32c163")
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 str. 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)

ARGS = {
    "prefix_path": "/tmp/test_index"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
infer_dataset_impl Ran
ran; our contract draft was wrong, not the code
thu-coai/MiniPLM/data_utils/indexed_dataset.py
code served (permissive licence) · get_code("8c2ad3ddcd7a09d7")
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 str. 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 tempfile
import struct
import os

# Create temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a minimal indexed dataset with .idx and .bin files
idx_path = os.path.join(temp_dir, 'test_dataset.idx')
bin_path = os.path.join(temp_dir, 'test_dataset.bin')

# Write index file
with open(idx_path, 'wb') as f:
    # Magic header
    f.write(b'TNTIDX\x00\x00')
    # Version
    f.write(struct.pack('<Q', 1))
    # Code (5 = int64) and element_size
    f.write(struct.pack('<QQ', 5, 8))
    # _len (number of items) and s (number of sizes)
    _len = 3
    s = 3
    f.write(struct.pack('<QQ', _len, s))
    # doc_count
    f.write(struct.pack('<Q', 1))
    
    # dim_offsets: _len + 1 = 4 values
    dim_offsets = np.array([0, 1, 2, 3], dtype=np.int64)
    f.write(dim_offsets.tobytes())
    
    # data_offsets: _len + 1 = 4 values
    data_offsets = np.array([0, 2, 5, 9], dtype=np.int64)
    f.write(data_offsets.tobytes())
    
    # sizes: s values
    sizes = np.array([2, 3, 4], dtype=np.int64)
    f.write(sizes.tobytes())
    
    # doc_idx: 1 value
    doc_idx = np.array([0], dtype=np.int64)
    f.write(doc_idx.tobytes())

# Write binary data file (int64 values)
with open(bin_path, 'wb') as f:
    # Total 9 int64 values (2 + 3 + 4)
    data = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.int64)
    f.write(data.tobytes())

# Create the path without extension (the class will add .idx and .bin)
dataset_path = os.path.join(temp_dir, 'test_dataset')

ARGS = {
    'path': dataset_path
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
sample Ran
ran; our contract draft was wrong, not the code
thu-coai/MiniPLM/utils.py
code served (permissive licence) · get_code("7fa1678cee06fa0a")
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 Tensor, ndim 2, dtype family int, shape (2, 1) 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

torch.manual_seed(0)

# Create small logits tensor (batch_size=2, vocab_size=4)
logits = torch.randn(2, 4)

# Create a small temperature value
temperature = 0.7

# Define ARGS dict mapping all parameters of sample() function
ARGS = {
    "logits": logits,
    "temperature": temperature,
}
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 Tensor, ndim 2, dtype family int, shape (2, 1) — shape (2, 1) 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
add_data_args Not yet run
unverified (harvested, no recorded run)
thu-coai/MiniPLM/arguments.py
code served (permissive licence) · get_code("30b0df65999d2740")
How it ran

no invocation recorded.

make_builder Not yet run
unverified (harvested, no recorded run)
thu-coai/MiniPLM/data_utils/indexed_dataset.py
code served (permissive licence) · get_code("fa072231e5230b82")
How it ran

no invocation recorded.

sample_from_draft_model Not yet run
unverified (harvested, no recorded run)
thu-coai/MiniPLM/utils.py
code served (permissive licence) · get_code("22469ee6c0ed3e2a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 2 later) and 8 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
data_file_path 8 other papers
6 dated earlier, 2 later
2022.emnlp-demos.40 (2022 (year only))
BMCook: A Task-agnostic Compression Toolkit for Big Models
2302.13939 (2023-02)
SpikeGPT: Generative Pre-trained Language Model with Spiking Neural Networks
2305.09137 (2023-05)
Pre-Training to Learn in Context
and 5 more not named here
index_file_path 8 other papers
6 dated earlier, 2 later
2022.emnlp-demos.40 (2022 (year only))
BMCook: A Task-agnostic Compression Toolkit for Big Models
2302.13939 (2023-02)
SpikeGPT: Generative Pre-trained Language Model with Spiking Neural Networks
2305.09137 (2023-05)
Pre-Training to Learn in Context
and 5 more not named here
code 7 other papers
6 dated earlier, 1 same year, order not determinable
2022.emnlp-demos.40 (2022 (year only))
BMCook: A Task-agnostic Compression Toolkit for Big Models
2305.09137 (2023-05)
Pre-Training to Learn in Context
2307.15504 (2023-07)
Exploring Format Consistency for Instruction Tuning
and 4 more not named here
infer_dataset_impl 1 other paper
1 dated earlier
2307.05695 (2023-07)
ReLoRA: High-Rank Training Through Low-Rank Updates

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-23.

Repositories linked to this paper

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

Abstract

Knowledge distillation (KD) is widely used to train small, high-performing student language models (LMs) using large teacher LMs. While effective in fine-tuning, KD during pre-training faces efficiency, flexibility, and effectiveness issues. Existing methods either incur high computational costs due to online teacher inference, require tokenization matching between teacher and student LMs, or risk losing the difficulty and diversity of the teacher-generated training data. In this work, we propose MINIPLM, a KD framework for pre-training LMs by refining the training data distribution with the teacher LM's knowledge. For efficiency, MINIPLM performs offline teacher inference, allowing KD for multiple student LMs without adding training costs. For flexibility, MINIPLM operates solely on the training corpus, enabling KD across model families. For effectiveness, MINIPLM leverages the differences between large and small LMs to enhance the training data difficulty and diversity, helping student LMs acquire versatile and sophisticated knowledge. Extensive experiments demonstrate that MINIPLM boosts the student LMs' performance on 9 common downstream tasks, improves language modeling capabilities, and reduces pre-training computation. The benefit of MINIPLM extends to larger training scales, evidenced by the scaling curve extrapolation. Further analysis reveals that MINIPLM supports KD across model families and enhances the pre-training data utilization. Our code, data, and models can be found at https://github.com/thu-coai/MiniPLM. (a) Computation Scaling (1.8B → 500M) 200M 500M 1.2B Student Model Size 40 42 44 46 Average Accuracy (%) Vanilla KD MiniPLM (Ours) (b) Model Size Scaling Figure 1: Computation (a) and model size (b) scaling curves of student LMs pre-trained from scratch with Vanilla KD 1 and MINIPLM. The teacher LM has 1.8B parameters. "1.8B→500M" means we use a 500M student LM. Training-time computation is kept constant for LMs of the same size in model scaling. The y-axis represents the LMs' zero-shot performance on 9 downstream NLP tasks.

For agents

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

get_harvested_code_for_paper("2410.17215")
get_code_for_paper("2410.17215")
have("2410.17215")

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

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

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

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

Connect an agent — have() is free.