Skip to content

Commit 980bb41

Browse files
committed
Tighten the McPAL docstring
Same content, fewer words: the two no-op PAL parameters collapse from a bullet list into one sentence, since the reason is identical for both (self-proxy).
1 parent 64294a6 commit 980bb41

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

tropt/recipe_hub/McPAL.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,15 @@ def mcpal(
2828
) -> OptimizerResult:
2929
"""McPAL: PAL's search configuration with MAC's gradient momentum.
3030
31-
PAL (Sitawarin et al., 2024) contributes the candidate budget — 128
32-
candidates drawn from a top-256 gradient ranking, single-token replacement,
33-
1.1x oversampling. MAC (Zhang & Wei, 2024) contributes momentum on the
34-
gradient used to rank candidates: `m <- mu*m + (1-mu)*grad`, mu=0.6.
31+
PAL (Sitawarin et al., 2024) contributes the search budget — 128 candidates
32+
from a top-256 gradient ranking, single-token replacement, 1.1x
33+
oversampling. MAC (Zhang & Wei, 2024) contributes momentum on the ranking
34+
gradient: `m <- mu*m + (1-mu)*grad`, mu=0.6.
3535
36-
Runs on `GCGPlusOptimizer` because `PALOptimizer` has no momentum. Two PAL
37-
parameters have no `GCGPlusOptimizer` counterpart, neither of which changes
38-
behaviour in this self-proxy setting:
39-
40-
- `n_candidates_after_proxy_filter` — `PALOptimizer` disables proxy
41-
filtering whenever `proxy_model is model`, which is exactly this setup.
42-
- retokenization — `PALOptimizer` always retokenizes; `use_retokenize=True`
43-
is the equivalent.
36+
Uses `GCGPlusOptimizer` since `PALOptimizer` has no momentum. PAL's two
37+
remaining parameters are no-ops here, under a self-proxy: proxy filtering is
38+
disabled whenever `proxy_model is model`, and its unconditional
39+
retokenization is `use_retokenize=True`.
4440
4541
Args:
4642
model_name: HuggingFace model identifier (used only if model_obj is None).

0 commit comments

Comments
 (0)