BurnyCoder commited on
Commit
09f9d5c
·
verified ·
1 Parent(s): 8f2eb91

frozen-role-signal · b6fbcf6f2f25

Browse files
README.md CHANGED
@@ -11,7 +11,7 @@ For example, a solver can give the right final answer to (4 + 3) × 2 while reco
11
  <!-- RESULTS:START -->
12
  ## Why did the two-judge and three-judge solvers diverge?
13
 
14
- **With seed 17, training the solver with two frozen judges gave 25/32 correct solutions (78.1%). Training it with three gave 3/32 (9.4%).** The gap was 22 complete solutions (-68.75 percentage points, three minus two). Both solvers started from the same model and saw the same problems in the same order. An integer program graded every intermediate step. On the paired problems, only the two-judge solver was correct on 23, only the three-judge solver on 1, both on 2, and neither on 6. These are development results on the calibrated arithmetic benchmark.
15
 
16
  The same evaluation gave 20/32 for the starting solver, 21/32 for one judge, 24/32 for three independent votes, 32/32 for the exact checker, 31/32 for the third judge gated by the exact checker, 5/32 for shuffled three-judge rewards.
17
 
@@ -37,7 +37,14 @@ On `(39 + 12) - 5`, the two-judge-trained solver wrote `51,46`. The three-judge-
37
 
38
  On the same 1,024 training answers sampled by the three-judge solver, Judge 3 fixed 58 of Judge 2’s verdicts and spoiled 44. Substituting Judge 2’s reward would have changed the relative credits in **81/256 optimizer updates**. Each GRPO update compares four answers to one question. When gradings change early on, the solvers can learn different answers and receive different training data at subsequent updates. [GRPO advantage calculation](https://huggingface.co/docs/trl/grpo_trainer#computing-the-advantage)
39
 
40
- Judge 3 rewarded **569/880 incorrect answers (64.7%)** and **88/144 correct answers (61.1%)**.
 
 
 
 
 
 
 
41
 
42
  | Within the same training question | Correct answer ranks higher | Tied | Wrong answer ranks higher |
43
  | --- | --- | --- | --- |
 
11
  <!-- RESULTS:START -->
12
  ## Why did the two-judge and three-judge solvers diverge?
13
 
14
+ **With seed 17, training the solver with two frozen judges gave 25/32 correct solutions (78.1%). Training it with three gave 3/32 (9.4%).** The gap was 22 complete solutions (-68.75 percentage points, three minus two). Only the solver adapter learned. All judging used the frozen, original Qwen instruction model. Both solvers started from the same model and saw the same problems in the same order. An integer program graded every intermediate step. On the paired problems, only the two-judge solver was correct on 23, only the three-judge solver on 1, both on 2, and neither on 6. These are development results on the calibrated arithmetic benchmark.
15
 
16
  The same evaluation gave 20/32 for the starting solver, 21/32 for one judge, 24/32 for three independent votes, 32/32 for the exact checker, 31/32 for the third judge gated by the exact checker, 5/32 for shuffled three-judge rewards.
17
 
 
37
 
38
  On the same 1,024 training answers sampled by the three-judge solver, Judge 3 fixed 58 of Judge 2’s verdicts and spoiled 44. Substituting Judge 2’s reward would have changed the relative credits in **81/256 optimizer updates**. Each GRPO update compares four answers to one question. When gradings change early on, the solvers can learn different answers and receive different training data at subsequent updates. [GRPO advantage calculation](https://huggingface.co/docs/trl/grpo_trainer#computing-the-advantage)
39
 
40
+ Reading each frozen verdict on exactly the same sampled answers measures the change in reward for correct and incorrect arithmetic. A positive rate difference means correct answers receive reward more often.
41
+
42
+ | Frozen reward source | Correct answers rewarded | Wrong answers rewarded | Correct minus wrong rate (pp) |
43
+ | --- | --- | --- | --- |
44
+ | Judge 2 | 104/144 (72.2%) | 599/880 (68.1%) | +4.2 |
45
+ | Judge 3 | 88/144 (61.1%) | 569/880 (64.7%) | -3.5 |
46
+
47
+ During its own training run, the two-judge solver generated 648/1,024 exact answers and received 751 positive rewards. The three-judge solver generated 144/1,024 exact answers and received 657 positive rewards. Each run sampled from its own evolving solver.
48
 
49
  | Within the same training question | Correct answer ranks higher | Tied | Wrong answer ranks higher |
50
  | --- | --- | --- | --- |
docs/assets/study.json CHANGED
@@ -195116,6 +195116,16 @@
195116
  "fixes": 58,
195117
  "harms": 44,
195118
  "changed_groups": 81,
 
 
 
 
 
 
 
 
 
 
195119
  "j2_pairs": [
195120
  28,
195121
  81,
 
195116
  "fixes": 58,
195117
  "harms": 44,
195118
  "changed_groups": 81,
195119
+ "same_answers_paid": [
195120
+ {
195121
+ "correct": 104,
195122
+ "wrong": 599
195123
+ },
195124
+ {
195125
+ "correct": 88,
195126
+ "wrong": 569
195127
+ }
195128
+ ],
195129
  "j2_pairs": [
195130
  28,
195131
  81,
reports/reviews/depth-diagnosis.md CHANGED
@@ -14,7 +14,14 @@ On 32 matched development problems the two-judge solver alone was correct on 23,
14
  | second wrong | 0 | 18 | 3 |
15
  | format | 1 | 93 | 49 |
16
 
17
- On the same 1024 training answers, Judge 3 fixed 58 effective Judge 2 verdicts and spoiled 44. Its decision changed the within-group advantages in 81/256 optimizer updates. Each row below compares correct and incorrect completions of the same question. Pairs within and across rows share observations.
 
 
 
 
 
 
 
18
 
19
  | Reward applied to these answers | Correct ranks higher | Tied | Incorrect ranks higher |
20
  | --- | --- | --- | --- |
 
14
  | second wrong | 0 | 18 | 3 |
15
  | format | 1 | 93 | 49 |
16
 
17
+ On the same 1024 training answers, Judge 3 fixed 58 effective Judge 2 verdicts and spoiled 44. Its decision changed the within-group advantages in 81/256 optimizer updates. Reward rates compare all answers of each class on this fixed trajectory.
18
+
19
+ | Frozen reward source | Correct answers rewarded | Wrong answers rewarded | Correct minus wrong rate (pp) |
20
+ | --- | --- | --- | --- |
21
+ | Judge 2 | 104/144 (72.2%) | 599/880 (68.1%) | +4.2 |
22
+ | Judge 3 | 88/144 (61.1%) | 569/880 (64.7%) | -3.5 |
23
+
24
+ Within-question pairs compare correct and incorrect completions of the same problem. Pairs within and across rows share observations.
25
 
26
  | Reward applied to these answers | Correct ranks higher | Tied | Incorrect ranks higher |
27
  | --- | --- | --- | --- |
src/study/depth_review.py CHANGED
@@ -50,11 +50,15 @@ def group_evidence(deep):
50
  """Replay both reward rules on identical samples, preserving the four-way GRPO groups."""
51
  fixes = harms = changed = 0
52
  preferences = [Counter(), Counter()]
 
53
  for group in batched(deep, 4):
54
  if len(group) != 4:
55
  raise ValueError("A comparison requires four samples per group")
56
  labels = [r["label"] for r in group]
57
  second, third = [[effective_bit(r["reports"][index]) for r in group] for index in (1, 2)]
 
 
 
58
  fixes += sum(a != y and b == y for a, b, y in zip(second, third, labels, strict=True))
59
  harms += sum(a == y and b != y for a, b, y in zip(second, third, labels, strict=True))
60
  # Centered binary returns induce the same normalized advantages if both vectors are constant.
@@ -65,7 +69,7 @@ def group_evidence(deep):
65
  good, bad = (i, j) if labels[i] else (j, i)
66
  for counts, votes in zip(preferences, (second, third), strict=True):
67
  counts[votes[good] - votes[bad]] += 1
68
- return dict(fixes=fixes, harms=harms, changed_groups=changed,
69
  j2_pairs=[preferences[0][i] for i in (1, 0, -1)], j3_pairs=[preferences[1][i] for i in (1, 0, -1)])
70
 
71
 
@@ -138,6 +142,19 @@ def audited_seed(directory, seed):
138
  transcript_audit=read_json(directory/"diagnostics"/f"depth-transcripts-{seed}.json"), **group_evidence(deep))
139
 
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  def readme_depth(data):
142
  """Keep the original seed's worked examples visible as later replications arrive."""
143
  reviews = data["depth_review"]
@@ -155,6 +172,7 @@ def readme_depth(data):
155
  f"**With seed {seed}, training the solver with two frozen judges gave {two_correct}/{n} correct "
156
  f"solutions ({100*two_correct/n:.1f}%). Training it with three gave {correct}/{n} ({100*correct/n:.1f}%).** "
157
  f"The gap was {abs(correct-two_correct)} complete solutions ({100*(correct-two_correct)/n:+.2f} percentage points, three minus two). "
 
158
  f"Both solvers started from the same model and saw the same problems in the same order. An integer program "
159
  f"graded every intermediate step. On the paired problems, only the two-judge solver was correct on "
160
  f"{paired['two only']}, only the three-judge solver on {paired['three only']}, both on {paired['both']}, "
@@ -189,10 +207,6 @@ def readme_depth(data):
189
  e = r["shared_error"]
190
  sections.append(f"On `{e['expression']}`, the two-judge-trained solver wrote `{e['right']}`. The three-judge-trained "
191
  f"solver wrote `{e['wrong']}`, and all three judges approved it in the replay.")
192
- valid = deep["training"]["correct"]
193
- wrong = r["n"]-valid
194
- valid_paid = deep["rewarded"]["correct"]
195
- wrong_paid = sum(deep["rewarded"].values())-valid_paid
196
  sections += ["### What changed during training?",
197
  f"On the same {r['n']:,} training answers sampled by the three-judge solver, Judge 3 fixed {r['fixes']} "
198
  f"of Judge 2’s verdicts and spoiled {r['harms']}. Substituting Judge 2’s reward would have changed the "
@@ -200,9 +214,13 @@ def readme_depth(data):
200
  "Each GRPO update compares four answers to one question. When gradings change early on, the solvers can "
201
  "learn different answers and receive different training data at subsequent updates. "
202
  "[GRPO advantage calculation](https://huggingface.co/docs/trl/grpo_trainer#computing-the-advantage)",
203
- f"Judge 3 rewarded **{wrong_paid}/{wrong} incorrect answers ({100*wrong_paid/wrong:.1f}%)** and "
204
- f"**{valid_paid}/{valid} correct answers ({100*valid_paid/valid:.1f}%)**." if valid and wrong else
205
- f"Judge 3 rewarded {wrong_paid}/{wrong} incorrect and {valid_paid}/{valid} correct answers.",
 
 
 
 
206
  markdown(["Within the same training question", "Correct answer ranks higher", "Tied", "Wrong answer ranks higher"],
207
  [["Judge 2 on those answers",*r["j2_pairs"]],["Judge 3 on those answers",*r["j3_pairs"]]]),
208
  f"In its first quarter of training, the three-judge solver produced {deep['first_quarter'][0]} correct "
@@ -306,7 +324,9 @@ def review_text(reviews):
306
  ("correct","first wrong, second consistent","first wrong, second inconsistent","second wrong","format")]),
307
  f"On the same {r['n']} training answers, Judge 3 fixed {r['fixes']} effective Judge 2 verdicts and "
308
  f"spoiled {r['harms']}. Its decision changed the within-group advantages in {r['changed_groups']}/{r['groups']} "
309
- "optimizer updates. Each row below compares correct and incorrect completions of the same question. "
 
 
310
  "Pairs within and across rows share observations.",
311
  markdown(["Reward applied to these answers", "Correct ranks higher", "Tied", "Incorrect ranks higher"],
312
  [["Judge 2",*r["j2_pairs"]],["Judge 3",*r["j3_pairs"]]]),
 
50
  """Replay both reward rules on identical samples, preserving the four-way GRPO groups."""
51
  fixes = harms = changed = 0
52
  preferences = [Counter(), Counter()]
53
+ paid = [dict(correct=0,wrong=0) for _ in range(2)]
54
  for group in batched(deep, 4):
55
  if len(group) != 4:
56
  raise ValueError("A comparison requires four samples per group")
57
  labels = [r["label"] for r in group]
58
  second, third = [[effective_bit(r["reports"][index]) for r in group] for index in (1, 2)]
59
+ for counts, votes in zip(paid,(second,third),strict=True):
60
+ for label,bit in zip(labels,votes,strict=True):
61
+ counts["correct" if label else "wrong"] += bit
62
  fixes += sum(a != y and b == y for a, b, y in zip(second, third, labels, strict=True))
63
  harms += sum(a == y and b != y for a, b, y in zip(second, third, labels, strict=True))
64
  # Centered binary returns induce the same normalized advantages if both vectors are constant.
 
69
  good, bad = (i, j) if labels[i] else (j, i)
70
  for counts, votes in zip(preferences, (second, third), strict=True):
71
  counts[votes[good] - votes[bad]] += 1
72
+ return dict(fixes=fixes, harms=harms, changed_groups=changed, same_answers_paid=paid,
73
  j2_pairs=[preferences[0][i] for i in (1, 0, -1)], j3_pairs=[preferences[1][i] for i in (1, 0, -1)])
74
 
75
 
 
142
  transcript_audit=read_json(directory/"diagnostics"/f"depth-transcripts-{seed}.json"), **group_evidence(deep))
143
 
144
 
145
+ def reward_rates(r):
146
+ """Compare final-bit reward rates on the identical examples at each depth."""
147
+ valid = r["three"]["training"]["correct"]
148
+ wrong = r["n"]-valid
149
+ records = []
150
+ for level,paid in enumerate(r["same_answers_paid"],2):
151
+ counts = [(paid["correct"],valid),(paid["wrong"],wrong)]
152
+ cells = [f"{n}/{total} ({100*n/total:.1f}%)" if total else "0/0" for n,total in counts]
153
+ gap = f"{100*(paid['correct']/valid - paid['wrong']/wrong):+.1f}" if valid and wrong else "—"
154
+ records.append([f"Judge {level}",*cells,gap])
155
+ return markdown(["Frozen reward source","Correct answers rewarded","Wrong answers rewarded","Correct minus wrong rate (pp)"],records)
156
+
157
+
158
  def readme_depth(data):
159
  """Keep the original seed's worked examples visible as later replications arrive."""
160
  reviews = data["depth_review"]
 
172
  f"**With seed {seed}, training the solver with two frozen judges gave {two_correct}/{n} correct "
173
  f"solutions ({100*two_correct/n:.1f}%). Training it with three gave {correct}/{n} ({100*correct/n:.1f}%).** "
174
  f"The gap was {abs(correct-two_correct)} complete solutions ({100*(correct-two_correct)/n:+.2f} percentage points, three minus two). "
175
+ f"Only the solver adapter learned. All judging used the frozen, original Qwen instruction model. "
176
  f"Both solvers started from the same model and saw the same problems in the same order. An integer program "
177
  f"graded every intermediate step. On the paired problems, only the two-judge solver was correct on "
178
  f"{paired['two only']}, only the three-judge solver on {paired['three only']}, both on {paired['both']}, "
 
207
  e = r["shared_error"]
208
  sections.append(f"On `{e['expression']}`, the two-judge-trained solver wrote `{e['right']}`. The three-judge-trained "
209
  f"solver wrote `{e['wrong']}`, and all three judges approved it in the replay.")
 
 
 
 
210
  sections += ["### What changed during training?",
211
  f"On the same {r['n']:,} training answers sampled by the three-judge solver, Judge 3 fixed {r['fixes']} "
212
  f"of Judge 2’s verdicts and spoiled {r['harms']}. Substituting Judge 2’s reward would have changed the "
 
214
  "Each GRPO update compares four answers to one question. When gradings change early on, the solvers can "
215
  "learn different answers and receive different training data at subsequent updates. "
216
  "[GRPO advantage calculation](https://huggingface.co/docs/trl/grpo_trainer#computing-the-advantage)",
217
+ "Reading each frozen verdict on exactly the same sampled answers measures the change in reward for correct "
218
+ "and incorrect arithmetic. A positive rate difference means correct answers receive reward more often.",
219
+ reward_rates(r),
220
+ f"During its own training run, the two-judge solver generated {r['two']['training']['correct']}/{r['n']:,} "
221
+ f"exact answers and received {sum(r['two']['rewarded'].values())} positive rewards. The three-judge solver "
222
+ f"generated {deep['training']['correct']}/{r['n']:,} exact answers and received {sum(deep['rewarded'].values())} positive rewards. "
223
+ "Each run sampled from its own evolving solver.",
224
  markdown(["Within the same training question", "Correct answer ranks higher", "Tied", "Wrong answer ranks higher"],
225
  [["Judge 2 on those answers",*r["j2_pairs"]],["Judge 3 on those answers",*r["j3_pairs"]]]),
226
  f"In its first quarter of training, the three-judge solver produced {deep['first_quarter'][0]} correct "
 
324
  ("correct","first wrong, second consistent","first wrong, second inconsistent","second wrong","format")]),
325
  f"On the same {r['n']} training answers, Judge 3 fixed {r['fixes']} effective Judge 2 verdicts and "
326
  f"spoiled {r['harms']}. Its decision changed the within-group advantages in {r['changed_groups']}/{r['groups']} "
327
+ "optimizer updates. Reward rates compare all answers of each class on this fixed trajectory.",
328
+ reward_rates(r),
329
+ "Within-question pairs compare correct and incorrect completions of the same problem. "
330
  "Pairs within and across rows share observations.",
331
  markdown(["Reward applied to these answers", "Correct ranks higher", "Tied", "Incorrect ranks higher"],
332
  [["Judge 2",*r["j2_pairs"]],["Judge 3",*r["j3_pairs"]]]),
tests/test_depth_review.py CHANGED
@@ -36,6 +36,7 @@ def test_earlier_judge_can_grade_same_group_better_while_aggregate_agreement_tie
36
  assert result["changed_groups"] == 1
37
  assert result["j2_pairs"] == [1,2,0]
38
  assert result["j3_pairs"] == [0,2,1]
 
39
 
40
 
41
  def test_group_evidence_rejects_an_incomplete_training_group():
 
36
  assert result["changed_groups"] == 1
37
  assert result["j2_pairs"] == [1,2,0]
38
  assert result["j3_pairs"] == [0,2,1]
39
+ assert result["same_answers_paid"] == [{"correct":1,"wrong":2},{"correct":0,"wrong":1}]
40
 
41
 
42
  def test_group_evidence_rejects_an_incomplete_training_group():