These are
pruning-only
variants—we simply remove layers without any knowledge distillation or fine-tuning. Fully trained or distilled models with the same architecture may outperform these pruned versions.
Overview
These models are created by
layer pruning
from
mmBERT-small
(22 layers, 384 hidden dimensions). We select specific layers to retain while preserving the ModernBERT global/local attention cadence.
Layer Selection and Evaluation
We fine-tuned the pruned models for information retrieval on the MS MARCO dataset and evaluated them on nanoBEIR (NDCG@10).
The numbers in model names (e.g.,
0_1_2_18
) indicate
which layers are retained
from the original 22-layer model:
L4H384 (0_1_2_18)
: Keeps layers 0, 1, 2, and 18 → 4 layers total
L7H384 (0_1_2_3_4_5_18)
: Keeps layers 0–5 and 18 → 7 layers total
L13H384 (0_1_2_3_4_5_6_7_8_9_10_11_18)
: Keeps layers 0–11 and 18 → 13 layers total
Why These Configurations?
We chose these "official" configurations based on two criteria:
Simplicity
: Consecutive layer indices (0, 1, 2, 3, ...) are easier to understand and reproduce than scattered indices like
0_1_2_3_6_8_18
.
Competitive performance
: While not always the absolute best score, these configurations perform competitively within their layer count category.
For example,
L7H384-0_1_2_3_6_8_18
(mean: 0.4722) slightly outperforms our official pick
L7H384-0_1_2_3_4_5_18
(mean: 0.4693), but the consecutive layer pattern is more interpretable and the performance difference is marginal.
Why Layer 18?
ModernBERT uses an alternating attention pattern:
Global attention (g)
: Full self-attention across all tokens
Local attention (l)
: Attention within a sliding window
The pattern follows a
g-l-l-g-l-l-...
rhythm. In the original 22-layer mmBERT-small, both layer 18 and layer 21 are global attention layers, with layer 21 being the final layer.
However, our experiments showed that
ending with layer 18 consistently outperforms ending with layer 21
. For example:
L4H384-0_1_2_18
(mean: 0.4530) vs
L4H384-0_1_2_21
(mean: 0.4558)
L7H384-0_1_2_3_4_5_18
(mean: 0.4693) vs
L7H384-0_1_2_3_4_5_21
(mean: 0.4629)
This suggests that the representations at layer 18 are more effective for retrieval tasks when combined with early layers, possibly because layer 18 provides a better balance between abstraction and retention of fine-grained information.
Experimental Variations
We explored different pruning strategies by shifting the start positions and coverage:
Front-heavy
(e.g.,
0_1_2_3_4_5_18
): Retains early layers, skips middle layers
Back-heavy
(e.g.,
0_16_17_18_19_20_21
): Retains later layers
Distributed
(e.g.,
0_1_2_3_4_5_6_7_8_10_12_15_18
): Spreads retained layers across depth
This probes the trade-off between
depth
(how many layers) and
coverage
(which parts of the network contribute).
Bold
rows indicate the official picks for each layer count.
Key Findings
Front-heavy pruning works best
: Retaining early layers (0–N) plus a global attention layer consistently outperforms other strategies.
Layer 18 > Layer 21
: Ending with layer 18 (global attention) outperforms ending with layer 21 (final global attention layer), suggesting that intermediate global attention layers provide better representations for retrieval when combined with early layers.
Early layers are critical
: Models that skip early layers (e.g.,
9_10_11_...
or
15_16_17_...
) show significant performance degradation.
Diminishing returns with depth
: L13 (0.496) vs L7 (0.469) shows only ~3% improvement for nearly double the layers.
License
MIT
Runs of hotchpotch mmBERT-L7H384-pruned on huggingface.co
10
Total runs
0
24-hour runs
1
3-day runs
2
7-day runs
5
30-day runs
More Information About mmBERT-L7H384-pruned huggingface.co Model
mmBERT-L7H384-pruned huggingface.co is an AI model on huggingface.co that provides mmBERT-L7H384-pruned's model effect (), which can be used instantly with this hotchpotch mmBERT-L7H384-pruned model. huggingface.co supports a free trial of the mmBERT-L7H384-pruned model, and also provides paid use of the mmBERT-L7H384-pruned. Support call mmBERT-L7H384-pruned model through api, including Node.js, Python, http.
mmBERT-L7H384-pruned huggingface.co is an online trial and call api platform, which integrates mmBERT-L7H384-pruned's modeling effects, including api services, and provides a free online trial of mmBERT-L7H384-pruned, you can try mmBERT-L7H384-pruned online for free by clicking the link below.
hotchpotch mmBERT-L7H384-pruned online free url in huggingface.co:
mmBERT-L7H384-pruned is an open source model from GitHub that offers a free installation service, and any user can find mmBERT-L7H384-pruned on GitHub to install. At the same time, huggingface.co provides the effect of mmBERT-L7H384-pruned install, users can directly use mmBERT-L7H384-pruned installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
mmBERT-L7H384-pruned install url in huggingface.co: