Stacking cartridges, and running them at 4-bit on a Mac
Two questions sit on top of the seed result.
- If I have a tool-use mask and a science mask, can I turn both on at once without wrecking either skill?
- If I want this on a Mac, in 4-bit, does the gain survive the rounding?
Both now have measured answers. Union stacking keeps most of each skill, on the published 7B pair and on two 9B cartridges I trained. All three 9B ToolAlpaca seeds keep the gain at 4-bit. I will not dress either result up past the numbers.
The composition operator is union
A deletion mask is a set of weights to zero. If cartridge A deletes set A and cartridge B deletes set B, the stacked cartridge deletes
A ∪ B
A weight is turned off if either mask says so. Weights in the intersection are still just zero. Weights in neither mask stay at their base value. Taking the mask off still restores the base exactly.
This operator is not my idea. Lu et al., in the limitations section of The Surprising Effectiveness of Deleting Weights in LLM Post-Training (arXiv 2611.10866, NeurIPS 2026), write that masks for different tasks "might also be combined, for example by taking their union." What I add is the measurement: I ran that operator on their two published 7B masks, and on a ToolAlpaca cartridge and a Science cartridge I trained for Qwen3.5-9B.
flowchart LR
A[ToolAlpaca mask] --> U[Union: delete if either says so]
B[Science mask] --> U
U --> M[One stacked cartridge]
Earlier work sits next to this. SHiRA (Bhardwaj et al., Sparse High Rank Adapters, NeurIPS 2024, arXiv 2406.13175) trains a sparse subset of base weights and is built with fast switching and multi-adapter use in mind. TALL-masks (Wang, Dimitriadis, Ortiz-Jiménez, Fleuret, and Frossard, Localizing Task Information for Improved Model Merging and Compression, ICML 2024) find a binary mask for each task inside a merged model. I will come back to both in the philosophy post. The operator under test here is the one Lu et al. proposed: union of two deletion sets.
7B overlap, then 7B scores
Lu et al. released two SDFT masks for Qwen2.5-7B-Instruct, which we analyzed (we did not train these two):
- ToolAlpaca: 14,892,491 of 1,901,068,288
gate_projweights deleted (0.783%). - Science: 33,607,213 deleted (1.768%).
The Jaccard overlap of the two deleted sets is
J(A,B) = |A ∩ B| / |A ∪ B| = 0.0241
If the two masks were independent at those sparsities, the chance Jaccard would be about 0.0055. The measured value is 0.0241 / 0.0055 ≈ 4.4 times chance: more overlap than a coin flip, but still small. The union deletes 2.49% of gate_proj, which is 97.6% of the plain sum 0.783% + 1.768%. Almost no cancellation from shared deletions.
The test, on both this 7B pair and the 9B pair below, is base, mask A alone, mask B alone, the union, and the intersection, on both tasks. ToolAlpaca is the same 97 exact-match items. Science is the paper's 507-item eval, XML <answer> exact match. The bar I set beforehand: the union should keep at least 80% of each solo gain.
On the published 7B masks, scored with MLX in bf16:
- ToolAlpaca: base 41, tool mask 68, science mask 49, union 64, intersection 44. The union keeps (64-41)/(68-41) = 23/27 = 85% of the tool gain.
- Science: base 155, science mask 344, tool mask 160, union 340, intersection 166. The union keeps (340-155)/(344-155) = 185/189 = 97.9% of the science gain.
Both clear the 80% bar. The intersection (1,140,547 shared deletions) alone moves ToolAlpaca by only 3 items and Science by 11, so the shared weights do not carry either skill by themselves. Each mask applied alone barely helps or hurts the other task (tool mask on Science: +5; science mask on ToolAlpaca: +8). Our MLX numbers differ slightly from those Lu et al. report for the same masks (ToolAlpaca 68 versus 67 of 97; Science 344 versus about 358 of 507), which I attribute to the different inference stack.
9B stacking
I repeated the same test with our seed-1 ToolAlpaca cartridge (10,702,823 deleted, 0.6645%) and a Science cartridge trained for 330 of the planned 400 steps (8,696,798 deleted, 0.5400%). These scores are MLX bf16 on Qwen/Qwen3.5-9B. Under that harness the ToolAlpaca base is 45 of 97, three above the PyTorch figure of 42 used in the earlier posts. I use the MLX base for the stacking arithmetic, so the comparison is paired on the same stack.
These two 9B masks overlap more than the 7B pair. Their union deletes 16,530,526 weights (1.026%) and their intersection 2,869,095. Jaccard is 0.1736, against a chance Jaccard of 0.00299, or about 58 times chance. The union is 85.2% of the plain sum, not 97.6%.
- ToolAlpaca: base 45, tool mask 69 (24 gained, 0 lost), science mask 49 (9 gained, 5 lost), union 66 (22 gained, 1 lost), intersection 53. The union keeps (66-45)/(69-45) = 21/24 = 87.5% of the tool gain.
- Science: base 120, science mask 316 (211 gained, 15 lost, exact McNemar p = 1.94 × 10⁻⁴⁵), tool mask 204 (113 gained, 29 lost), union 298 (199 gained, 21 lost, p = 1.5 × 10⁻³⁷), intersection 257. The union keeps (298-120)/(316-120) = 178/196 = 90.8% of the science gain. Against the science mask alone the union is 18 items lower (46 gained, 64 lost), which is not significant (p = 0.105).
Both 9B skills also clear the 80% bar. Two things look different from the 7B pair, and I will not over-explain them. The 9B tool mask alone already lifts Science a lot (120 to 204). The intersection also moves Science more than it does on the 7B (120 to 257, still well below the union and the solo mask). Both are consistent with the higher overlap. The Science cartridge itself is a strong skill: 316 of 507 from a base of 120, even though training stopped early at 330 steps.
4-bit on a Mac
The 9B bf16 seed results are 42 to 69, 71 and 68 of 97. The question is what remains when those same masks are applied to mlx-community/Qwen3.5-9B-MLX-4bit, without writing a new model file.
I measured both forms:
- Nearest-zero code. Start from the already-quantized model and set each masked weight to the nearest-zero quant code. This is the form a server can toggle live. Ejecting the cartridge restores the 4-bit base.
- Requantize. Dequantize, zero the masked weights, quantize again. Useful as a measurement, not as a live server path.
The 4-bit base is 38 of 97, four below bf16, and it is identical item by item across the three seed evaluations.
| Seed | Nearest-zero | Gained / lost | Requantize | Gained / lost |
|---|---|---|---|---|
| 1 | 66 | 28 / 0 | 66 | 28 / 0 |
| 2 | 66 | 28 / 0 | 65 | 27 / 0 |
| 3 | 61 | 24 / 1 | 62 | 25 / 1 |
All three seeds keep a large gain under both forms. Seed 3 lags the other two by a few items in both forms, which I am not going to smooth over. For seed 1 the 4-bit gain (28 items) is slightly larger than the bf16 gain for the same mask (27). Nearest-zero matches requantize to within one item, and it is the form that can be toggled without touching kept weights.
Swap timings on the 4-bit 9B, nearest-zero form, all 32 gate projections, 10 repetitions: cold apply median 309 ms, warm apply 0.04 ms, eject 0.10 ms. After eject, a host-side byte comparison of every touched weight, scale and bias array matched the originals, and the logits equalled the base model's in 20 of 20 checks.
This is not the same thing as quantization-aware tuning, which trains against fake quantization. Here the mask is already trained; the question was whether it still works after the model is 4-bit. It does.
Previous: How we test a mask. Next: Skills as removable cartridges.
Project: Skill cartridges · Tags: Deletion masks Quantization Tool use MLX