nikgeo commited on
Commit
9c0900a
·
verified ·
1 Parent(s): 2761ff1

Compare importance-ranked and random pruning quality curves

Browse files

Overlay the measured random 10% and 25% controls on the pruning-quality figure and update the model-card insight to foreground the advantage of HEAPr-style importance ranking.

README.md CHANGED
@@ -148,16 +148,16 @@ pruned child-group work.
148
 
149
  ## Insights
150
 
151
- ### Quality degradation is nonlinear
152
 
153
  <p align="center">
154
- <img alt="Line chart showing a nonlinear increase in perplexity as more structured MoE parameters are pruned" src="assets/pruning_quality_curve.png" width="88%">
155
  </p>
156
 
157
- Pruning more groups consistently increases full-cache perplexity, but the tradeoff is not linear.
158
- The first 10% adds only `1.66%` perplexity, while moving from 20% to 40% raises the delta from
159
- `7.18%` to `39.99%`. The downstream GSM8K curve also worsens sharply beyond 10%, so we recommend
160
- 10% as the initial operating point.
161
 
162
  ### Later layers have lower-importance atomic experts
163
 
 
148
 
149
  ## Insights
150
 
151
+ ### Importance ranking improves the pruning tradeoff
152
 
153
  <p align="center">
154
+ <img alt="Line chart showing lower perplexity degradation for importance-ranked structured MoE pruning than random pruning" src="assets/pruning_quality_curve.png" width="88%">
155
  </p>
156
 
157
+ Importance-ranked pruning consistently beats the measured random controls. At the recommended 10%
158
+ point, perplexity rises by only `1.66%`, compared with `14.28%` for random pruning. The ranked curve
159
+ is also nonlinear: moving from 20% to 40% raises its perplexity delta from `7.18%` to `39.99%`.
160
+ Together with the GSM8K curve, this supports 10% as the initial operating point.
161
 
162
  ### Later layers have lower-importance atomic experts
163
 
assets/pruning_quality_curve.png CHANGED

Git LFS Details

  • SHA256: edf068a83a3ce05034aeefb3ef44fef117751a512ec5ba2f53a4b9d420a864a7
  • Pointer size: 131 Bytes
  • Size of remote file: 136 kB

Git LFS Details

  • SHA256: f73f9f92decdb37b3d84b85435df3a2462475bc57dc0b2859fb32e801c6bdcaf
  • Pointer size: 131 Bytes
  • Size of remote file: 177 kB
scripts/plot_pruning_insights.py CHANGED
@@ -51,27 +51,54 @@ def plot_pruning_curve(summary: dict, output_dir: Path) -> None:
51
  baseline = summary["native_group_loss_sweep_baseline"]["perplexity"]
52
  x = np.array([row["groups_pruned_ratio"] * 100 for row in rows])
53
  y = np.array([(row["perplexity"] / baseline - 1) * 100 for row in rows])
 
 
 
 
 
 
54
 
55
  fig, ax = plt.subplots(figsize=(10, 5.6))
56
- sns.lineplot(x=x, y=y, marker="o", linewidth=3, markersize=10, color="#78dce8", ax=ax)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  selected = int(np.flatnonzero(x == 10)[0])
58
  ax.scatter([x[selected]], [y[selected]], s=180, color="#b7d36b", zorder=4)
59
  ax.annotate(
60
  "Recommended operating point\n10% pruning, +1.66% perplexity",
61
  xy=(x[selected], y[selected]),
62
- xytext=(28, 24),
63
  textcoords="offset points",
64
  color="#e6fbff",
65
  fontsize=12,
66
  arrowprops={"arrowstyle": "->", "color": "#b7d36b"},
67
  )
68
  ax.set(
69
- title="Pruning Quality Degrades Nonlinearly",
70
  xlabel="Structured MoE parameters identified for removal (%)",
71
  ylabel="Perplexity increase vs. BF16 baseline (%)",
72
  )
73
  ax.set_xlim(-1, 42)
74
  ax.set_ylim(-1, 44)
 
75
  sns.despine(ax=ax)
76
  fig.tight_layout()
77
  fig.savefig(output_dir / "pruning_quality_curve.png", dpi=180)
 
51
  baseline = summary["native_group_loss_sweep_baseline"]["perplexity"]
52
  x = np.array([row["groups_pruned_ratio"] * 100 for row in rows])
53
  y = np.array([(row["perplexity"] / baseline - 1) * 100 for row in rows])
54
+ random_controls = [
55
+ summary["random_native_group_10pct_control"],
56
+ summary["random_native_group_25pct_control"],
57
+ ]
58
+ random_x = np.array([0, *[row["groups_pruned_ratio"] * 100 for row in random_controls]])
59
+ random_y = np.array([0, *[(row["perplexity"] / baseline - 1) * 100 for row in random_controls]])
60
 
61
  fig, ax = plt.subplots(figsize=(10, 5.6))
62
+ sns.lineplot(
63
+ x=x,
64
+ y=y,
65
+ marker="o",
66
+ linewidth=3,
67
+ markersize=10,
68
+ color="#78dce8",
69
+ label="HEAPr-style importance ranking",
70
+ ax=ax,
71
+ )
72
+ sns.lineplot(
73
+ x=random_x,
74
+ y=random_y,
75
+ marker="o",
76
+ linewidth=2.5,
77
+ markersize=9,
78
+ linestyle="--",
79
+ color="#f5a65b",
80
+ label="Random control",
81
+ ax=ax,
82
+ )
83
  selected = int(np.flatnonzero(x == 10)[0])
84
  ax.scatter([x[selected]], [y[selected]], s=180, color="#b7d36b", zorder=4)
85
  ax.annotate(
86
  "Recommended operating point\n10% pruning, +1.66% perplexity",
87
  xy=(x[selected], y[selected]),
88
+ xytext=(48, 34),
89
  textcoords="offset points",
90
  color="#e6fbff",
91
  fontsize=12,
92
  arrowprops={"arrowstyle": "->", "color": "#b7d36b"},
93
  )
94
  ax.set(
95
+ title="Importance Ranking Outperforms Random Pruning",
96
  xlabel="Structured MoE parameters identified for removal (%)",
97
  ylabel="Perplexity increase vs. BF16 baseline (%)",
98
  )
99
  ax.set_xlim(-1, 42)
100
  ax.set_ylim(-1, 44)
101
+ ax.legend(frameon=False)
102
  sns.despine(ax=ax)
103
  fig.tight_layout()
104
  fig.savefig(output_dir / "pruning_quality_curve.png", dpi=180)