How a deletion mask works inside the model

Deletion mask Cost: low Does not change model files VERIFIED

Last time I said a deletion mask turns a small set of weights off. This post is about which weights, and what "off" means in the running model.

The method is Deletion Tuning, from Lu et al., arXiv 2611.10866, NeurIPS 2026. I am describing their design, then showing where our 9B and 27B masks sit in it.

A transformer block, very briefly

A modern decoder model is a stack of blocks. Each block has two main parts:

  1. Attention, which lets tokens look at earlier tokens.
  2. An MLP, a small neural net applied at each position, which does a lot of the model's memory-like work.

In Qwen-style models the MLP is a SwiGLU: three matrices called up_proj, gate_proj, and down_proj. For an input x,

MLP(x) = down( SiLU(gate(x)) ⊙ up(x) )

The gate is a volume knob on each hidden channel. If a gate weight is set to zero, that path contributes less, or nothing, to the channels it feeds.

Deletion Tuning puts the learnable mask on gate_proj only. Attention, up_proj, down_proj, embeddings, and the output head stay as they were.

Diagram of one transformer block, with the MLP gate_proj highlighted as the only place the mask is applied.
Qwen3.5-9B has 32 layers. Each gate_proj is 12,288 by 4,096. Across the model that is 1,610,612,736 weights the mask can touch.
flowchart LR
  x[Input x] --> gate["gate_proj  (masked)"]
  x --> up[up_proj]
  gate --> silu[SiLU]
  silu --> hadamard["elementwise x"]
  up --> hadamard
  hadamard --> down[down_proj]
  down --> y[Block output]

Soft during training, hard when you use it

Each of those gate weights gets a logit g, a trainable score. During training the mask is soft, so gradients can flow:

m = σ(g · s)

where σ is the sigmoid and s is a sharpness that rises over training. In our runs, and in the paper's SFT recipe, s goes from 100 to 1,000. Early on, m is a smooth number between 0 and 1. By the end it is nearly 0 or nearly 1.

When you evaluate or serve the model, the mask becomes binary:

m = 1 if g > 0, 0 otherwise.

The weight you actually use is m ⊙ W. A deleted weight is exactly zero, not "almost zero."

The original W is not overwritten. The mask is a switch in front of it.

Off means bit-exact

This is the property I care about most for a local setup. If you turn the mask off, the forward pass sees the original weights again. No rounding, no "close enough" merge. The base model is still on disk, unchanged.

Two panels: mask on sets some weights to zero; mask off restores the original values exactly.
The numbers in the boxes are made up so you can see the pattern. The property is real: off is the original weight, exactly.
flowchart LR
  Base[Base weights on disk] --> On[Mask ON: some gate weights are zero]
  On --> Off[Mask OFF: original weights]
  Off --> Base

That is why I treat these masks as live toggles, not as a new model file. In this lab, model files on disk stay put. A cartridge is something you apply, and can take off again.

How much actually gets deleted?

On Qwen3.5-9B, our three ToolAlpaca seeds deleted:

Seed Deleted weights Fraction of gate_proj Saved mask
1 (seed=0) 10,702,823 0.6645% 20.16 MB
2 (seed=2) 10,950,222 0.6799% 20.52 MB
3 (seed=3) 10,818,819 0.6718% 20.33 MB

Those fractions are 10,702,823 / 1,610,612,736, and so on. The 27B preferred run deleted 28,730,353 of 5,704,253,440 gate_proj weights, which is 0.5037%, in a 57.24 MB file.

So the skill is a small binary map over one kind of matrix, not a second 9B or 27B checkpoint.

Sparsity and mask file size for the three 9B seeds and the 27B preferred run.

The paper's own headline is even sparser in some of their setups (they report matching full fine-tuning while zeroing under 0.05% of weights, as a fraction of the whole model). I am quoting that as theirs. Our numbers above are the fraction of gate_proj in our SFT ToolAlpaca runs, which is a different denominator and a different training recipe than every table in the paper.

Previous: What a mask is. Next: How to train a mask.

Project: Skill cartridges · Tags: Deletion masks Model tuning

All ship logs