hbin0701's picture
OPSD LoRA checkpoints + variant configs + manifest (public)
b6d5136 verified
Raw
History Blame Contribute Delete
1.08 kB
import re
from agents.variants.base import TeacherVariant
_BOX = re.compile(r"\\boxed\{(.+?)\}", re.S)
class P4(TeacherVariant):
"""Answer-only extreme (lower bracket): the reference slot is a single answer line
built from the reference's boxed answer. Maker-free (no endpoint), no thinking,
no accept gate. P4 vs P2 prices whether branch-(b) localization pays."""
name = "p4_answer_only"
description = "reference slot = one answer line; maker-free, no thinking"
thinking = False
uses_maker = False
def _answer(self, solution):
found = _BOX.findall(solution or "")
return found[-1].strip() if found else (solution or "").strip()
def resolve_prefix(self, problem, solution, rollout, maker_client):
tmpl = self.prompts.get("answer_only_template",
"The correct final answer is \\boxed{<ANSWER>}.")
return tmpl.replace("<ANSWER>", self._answer(solution))
def accepts(self, prefix, reference):
return True # a maker-free line; nothing to gate
VARIANT = P4