fidelity factorial arms (randk / noises0 / hidden-capacity) + pre-registration item 15

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Nils
2026-07-15 02:47:14 +02:00
co-authored by Claude Fable 5
parent d39e02f4b9
commit 0e6d6adcb9
4 changed files with 60 additions and 9 deletions
+8 -2
View File
@@ -93,6 +93,8 @@ def main():
help="PerDepthAdapter (Bae-style per-iteration merges)")
ap.add_argument("--tiedalpha", action="store_true",
help="TiedAlphaAdapter (learned per-dim alpha, tied B)")
ap.add_argument("--noises0", action="store_true")
ap.add_argument("--hidden", type=int, default=512)
ap.add_argument("--halt", action="store_true",
help="record per-item convergence depth (free-ACT probe)")
args = ap.parse_args()
@@ -101,13 +103,17 @@ def main():
model, tok = load_model(dtype=torch.bfloat16)
tok.padding_side = "left"
looper = BandLooper(model)
from loop_common import PerDepthAdapter, TiedAlphaAdapter
cls = (TiedAlphaAdapter if args.tiedalpha
from loop_common import (NoisyMergeAdapter, PerDepthAdapter,
TiedAlphaAdapter)
cls = (NoisyMergeAdapter if args.noises0
else TiedAlphaAdapter if args.tiedalpha
else PerDepthAdapter if args.perdepth
else ParcaeAdapter if args.parcae
else RecurrentAdapter if args.rec
else AdaptiveMergeAdapter if args.adaptive else MergeAdapter)
kw = ({"alpha0": args.alpha} if args.adaptive else {"alpha": args.alpha})
if not args.adaptive:
kw["hidden"] = args.hidden
adapter = cls(d=model.config.get_text_config().hidden_size, **kw).cuda()
if args.adapter:
adapter.load_state_dict(torch.load(args.adapter, map_location="cuda"))