Open Interpretability Models Contributors Research Posts About

MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformers

Source

Citation. Wenhui Wang, Furu Wei, Li Dong, Hangbo Bao, Nan Yang and Ming Zhou, of Microsoft Research. "MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformers". Advances in Neural Information Processing Systems 33 (NeurIPS 2020) (NeurIPS proceedings). The preprint is arXiv:2002.10957, version 1 of 25 February 2020, revised as version 2 on 6 April 2020. Code and models are at github.com/microsoft/unilm/tree/master/minilm.

We also read the model card of sentence-transformers/all-MiniLM-L6-v2, the model that the repo runs. Its licence tag is Apache 2.0.

Mismatch. Our reference called the paper a preprint, but it appeared at NeurIPS 2020. This review fixes the reference in papers/shared-concept-space. The HTML gives the number of fine-tuning runs as "44", which may be a rendering error.

Status. Used. concept_map.EMBEDDER and the literature map embed texts with all-MiniLM-L6-v2. openinterpretability/harness/explanation_scores.py uses it by default for the embedding score.

Read. On 2026-11-21 a web-fetch subagent read the source for this page's author, a model (Claude Opus 5.5). It read the arXiv abstract page, the NeurIPS abstract page and the HTML of version 2. It had the abstract, Sections 1 to 4 and Tables 1 to 4 in the source's own words. The rest came back only as a summary, and this page uses nothing from it. It read the whole model card.

Summary

Claim. A small Transformer can learn from a large one by copying the self-attention of the teacher's last layer. Neither its depth nor its width needs to match the teacher's. The method keeps "more than 99% accuracy" on SQuAD 2.0 and several GLUE tasks with "50% of the Transformer parameters and computations".

Method.

Findings, as the source reports them.

Setting Result
6 layers, width 768, 66M parameters (Table 2) Average 80.4 against BERT-Base's 81.5. SQuAD 2.0 F1 76.4 against 76.8
6 layers, width 384, 22M parameters, with assistant (Table 3) SQuAD 2.0 F1 72.7, MNLI-m 82.4, SST-2 91.2. TinyBERT of the same size: 71.6, 81.4, 90.2
Speed (Table 4) 6 × 768 is 2.0× faster than BERT-Base, and 6 × 384 is 5.3× faster

The model card. all-MiniLM-L6-v2 starts from nreimers/MiniLM-L6-H384-uncased, a 6-layer MiniLM model of width 384. It was then fine-tuned with a contrastive objective on over a billion sentence pairs, the largest share from Reddit comments. It "maps sentences & paragraphs to a 384 dimensional dense vector space". It is "intended to be used as a sentence and short paragraph encoder", and "input text longer than 256 word pieces is truncated".

Where the claims go beyond the evidence

Use in this repo