Skip to content

Commit 49ee83b

Browse files
fluffy314cursoragent
authored andcommitted
fix(agents): replace Critic scoring with claim audit
Make Gemma reconstruct and adversarially challenge the complete response claim by claim instead of producing supportive numeric scores and blanket approval. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d465829 commit 49ee83b

5 files changed

Lines changed: 44 additions & 15 deletions

File tree

docs/ops/distributed-prefill-kv-network.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,11 @@ and semantic fallback are forbidden. A global Critic score is valid only when
349349
`critic_omitted_tokens=0`. Long Prefill operations emit a heartbeat every 30
350350
seconds; on the 16GB allens worker, full-context Critic Prefill may take 15–25
351351
minutes.
352+
The Critic uses `adversarial_claim_audit_v1`: numeric scores and blanket
353+
approval are forbidden. It must reconstruct the thesis, quote and challenge
354+
each material claim, present the strongest objection, provide a corrected
355+
response, and state residual uncertainty. Epistemic honesty is evaluated
356+
separately from literal task completion.
352357
The worker reserves estimated final-snapshot capacity before model compute,
353358
prevents adaptive shrink from consuming active reservations, then atomically
354359
publishes and leases the final snapshot before adding optional intermediate

scripts/agent_gan_inference_demo.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def build_critic_context(tokenizer, text: str) -> tuple[str, dict]:
4747
"critic_context_tokens": len(full_ids),
4848
"critic_omitted_tokens": 0,
4949
"review_scope": "full",
50+
"critic_protocol": "adversarial_claim_audit_v1",
5051
}
5152

5253

@@ -178,14 +179,19 @@ def main() -> int:
178179
critic_history = [{
179180
"role": "system",
180181
"content": (
181-
"You are the Critic/Discriminator agent. Attack the proposal, "
182-
"identify false assumptions and bottlenecks, score it from 0 to "
183-
"10, and demand specific corrections. Do not call a response "
184-
"incomplete merely because it refuses to fabricate a solution to "
185-
"an open problem. Claim truncation only when completion_status is "
186-
"not EOS or the text is syntactically cut off."
187-
" Review the complete Generator response as one semantic argument. "
188-
"Do not sample, summarize, or infer claims from partial text."
182+
"You are an adversarial peer reviewer, not a supportive grader. "
183+
"Review the complete Generator response as one semantic argument. "
184+
"Reconstruct its thesis and audit every material factual, logical, "
185+
"and task-completion claim against the strongest counterargument. "
186+
"Quote claims before challenging them. Distinguish an honest "
187+
"boundary from literal task completion; unknown does not mean "
188+
"impossible. Check numbers, quantifiers, awards, assumptions, and "
189+
"claimed consequences. Never output a numeric score or blanket "
190+
"approval without an explicit claim-by-claim audit. Return Thesis "
191+
"Reconstruction, Claim-by-Claim Audit, Strongest Objection, "
192+
"Corrected Response, and Residual Uncertainty. Claim truncation "
193+
"only when completion_status is not EOS or syntax is cut off. "
194+
"Do not sample, summarize, simplify, or use fallback review."
189195
),
190196
}]
191197

scripts/agent_gan_repl.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def build_generator_messages(prompt: str) -> list[dict[str, str]]:
5252
"role": "system",
5353
"content": (
5454
"Answer rigorously. For open problems, state the accepted "
55-
"boundary and never fabricate a proof."
55+
"boundary and never fabricate a proof. Distinguish unknown "
56+
"from impossible; qualify awards, quantities, and claimed "
57+
"downstream consequences precisely."
5658
),
5759
},
5860
{"role": "user", "content": prompt},
@@ -70,10 +72,20 @@ def build_critic_messages(
7072
{
7173
"role": "system",
7274
"content": (
73-
"Score the answer 0-10, identify false claims, and give "
74-
"specific corrections. Do not penalize an honest statement "
75-
"that an open problem is unsolved. Review the complete response "
76-
"as one semantic argument; do not sample or summarize it."
75+
"Act as an adversarial peer reviewer, not a supportive grader. "
76+
"Read the complete response as one semantic argument. Rebuild "
77+
"its thesis and audit every material factual, logical, and "
78+
"task-completion claim against the strongest counterargument. "
79+
"Quote the exact claim before challenging it. Distinguish "
80+
"epistemic honesty from literal task completion: unknown or "
81+
"unsolved does not mean impossible, and an honest refusal does "
82+
"not complete a requested proof. Check numbers, awards, "
83+
"quantifiers, and claimed consequences. Never output a numeric "
84+
"score. Never issue blanket approval unless every material "
85+
"claim has been explicitly audited. Use exactly these sections: "
86+
"Thesis Reconstruction; Claim-by-Claim Audit; Strongest "
87+
"Objection; Corrected Response; Residual Uncertainty. Do not "
88+
"sample, summarize, simplify, or use a fallback review."
7789
),
7890
},
7991
{

tests/inference_engine/bridge/test_agent_gan_demo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,4 @@ def test_critic_context_preserves_complete_generator_response():
120120
assert metrics["critic_context_tokens"] == 10
121121
assert metrics["critic_omitted_tokens"] == 0
122122
assert metrics["review_scope"] == "full"
123+
assert metrics["critic_protocol"] == "adversarial_claim_audit_v1"

tests/inference_engine/bridge/test_agent_gan_repl.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,13 @@ def test_stage_includes_full_context_metrics():
140140
"critic_context_tokens": 100,
141141
"critic_omitted_tokens": 0,
142142
"review_scope": "full",
143+
"critic_protocol": "adversarial_claim_audit_v1",
143144
},
144145
)
145146
assert stage["critic_context_tokens"] == 100
146147
assert stage["critic_omitted_tokens"] == 0
147148
assert stage["review_scope"] == "full"
149+
assert stage["critic_protocol"] == "adversarial_claim_audit_v1"
148150

149151

150152
def test_telemetry_timeout_warns_without_stopping_inference(
@@ -193,5 +195,8 @@ def test_interactive_prompts_are_deterministic_for_kv_reuse():
193195
combined = repr(generator_a + critic_a)
194196
assert "Internal run" not in combined
195197
assert "open problem" in combined
196-
assert "Review the complete response" in combined
197-
assert "do not sample or summarize" in combined
198+
assert "adversarial peer reviewer" in combined
199+
assert "Never output a numeric score" in combined
200+
assert "Claim-by-Claim Audit" in combined
201+
assert "unknown or unsolved does not mean impossible" in combined
202+
assert "sample, summarize, simplify" in combined

0 commit comments

Comments
 (0)