mirror of
https://github.com/wassname/evil_MoE.git
synced 2026-08-11 11:18:24 +08:00
log: per-mode hk_<mode> cols = current-batch count, not cumulative n/d
The cumulative n/d (e.g. 14/52) grew unboundedly and read as noise. Now each hk_<mode> shows just this step's student hacks of that mode as a plain int. The running mode_hacks/mode_rollouts tallies still feed the end-of-run substrate learning table. Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
@@ -677,8 +677,8 @@ class StepLogger:
|
||||
# (the substrate); single-mode runs would just duplicate hack_s.
|
||||
self._modes = modes if len(modes) > 1 else []
|
||||
for m in self._modes:
|
||||
cols.append(_Col(f"hk_{MODE_CODE[m]}", 6, f"hk_{MODE_CODE[m]}", "frac",
|
||||
f"cumulative student hacks of {m}"))
|
||||
cols.append(_Col(f"hk_{MODE_CODE[m]}", 5, f"hk_{MODE_CODE[m]}", "d",
|
||||
f"student hacks of {m} THIS step (current batch, not cumulative)"))
|
||||
cols += [
|
||||
_Col("lp_s", 6, "lp_s↓", "+.2f", "mean student gen_logp (diagnostic)"),
|
||||
_Col("lp_t", 6, "lp_t↑", "+.2f", "mean teacher gen_logp; off-policy gap = lp_s-lp_t"),
|
||||
@@ -1156,6 +1156,7 @@ def main(cfg: Config) -> int:
|
||||
step_rollouts: list[dict] = [] # student completions this step -> rollout_log_path
|
||||
agg_is_student: list[bool] = []
|
||||
agg_is_ablated: list[bool] = [] # deploy-mode (quarantine-ablated) student rows -> free per-step deploy proxy
|
||||
step_mode_hacks: dict[str, int] = {} # THIS step's student hacks per mode (the hk_<mode> columns; reset each step so they don't grow)
|
||||
agg_logp: list[float] = [] # per-rollout mean per-token gen_logp (student's logp on rollout tokens)
|
||||
agg_comp_lens, agg_finished, n_skipped = [], [], 0
|
||||
agg_loss = 0.0
|
||||
@@ -1377,6 +1378,7 @@ def main(cfg: Config) -> int:
|
||||
mode_rollouts[pm] = mode_rollouts.get(pm, 0) + 1
|
||||
if r.exploited:
|
||||
mode_hacks[pm] = mode_hacks.get(pm, 0) + 1
|
||||
step_mode_hacks[pm] = step_mode_hacks.get(pm, 0) + 1
|
||||
if pm not in mode_first_step:
|
||||
mode_first_step[pm] = step
|
||||
# First full example of each hack mechanism -> verbose log (with
|
||||
@@ -1882,11 +1884,11 @@ def main(cfg: Config) -> int:
|
||||
"gt_t": (gt_t_n, n_t) if n_t else (0, 0),
|
||||
"hack_s": (hack_s_n, n_s) if n_s else (0, 0),
|
||||
"hack_t": (hack_t_n, n_t) if n_t else (0, 0),
|
||||
# Per-mode CUMULATIVE student exploit rate (which loophole classes are
|
||||
# learnt, how strongly). From the running tallies, so it rises over the
|
||||
# run; StepLogger only renders these on multi-mode (substrate) runs.
|
||||
**{f"hk_{MODE_CODE[m]}": (mode_hacks.get(m, 0), mode_rollouts.get(m, 0))
|
||||
for m in run_modes},
|
||||
# Per-mode student hacks THIS step (current batch count, not cumulative --
|
||||
# cumulative grew unboundedly and read as noise). The running mode_hacks/
|
||||
# mode_rollouts tallies still feed the end-of-run substrate learning table.
|
||||
# StepLogger only renders these on multi-mode (substrate) runs.
|
||||
**{f"hk_{MODE_CODE[m]}": step_mode_hacks.get(m, 0) for m in run_modes},
|
||||
# Per-mechanism on student rollouts only. Used by final-tail BLUF for
|
||||
# cross-mechanism HACK_A / HACK_B; hidden from the per-step table to
|
||||
# avoid column bloat (rendered only in the markdown dump below).
|
||||
|
||||
Reference in New Issue
Block a user