Migrated from the rl-toolkit snapshot deployed for the 2026-09-15 production run (toolkit e191cf1 plus uncommitted changes). PRIME-RL is now a submodule on dphn/prime-rl@trinity; the v0 envs, parity tests, OPD experiment, and old configs are not carried over.
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
"""nemotron-guard-v1: the shared nemotron anti-hacking guardrail as v1 helpers.
|
|
|
|
The reusable component behind the four `nemotron-*` category envs. Given a `vf.Trace` it
|
|
computes the v0 `anti_hacking_multiplier` (hard-zero gates plus judge/meta soft penalties)
|
|
and folds it into a task reward as `final = anti_hacking_multiplier * task_reward`.
|
|
|
|
It also carries `mixing`, the per-subtask blend control the four category tasksets share.
|
|
"""
|
|
|
|
from nemotron_guard_v1.guard import (
|
|
AntiHackingConfig,
|
|
GuardedTask,
|
|
anti_hacking_multiplier,
|
|
apply_guard,
|
|
)
|
|
from nemotron_guard_v1.mixing import SubtaskMix, apply_mix, mix_summary
|
|
from nemotron_guard_v1.judges import (
|
|
CoherencyJudge,
|
|
GuardJudgeConfig,
|
|
MetaCommentaryJudge,
|
|
ReasoningCoherencyJudge,
|
|
ReasoningEthicsJudge,
|
|
ScoreTagJudge,
|
|
)
|
|
|
|
__all__ = [
|
|
"AntiHackingConfig",
|
|
"GuardedTask",
|
|
"GuardJudgeConfig",
|
|
"anti_hacking_multiplier",
|
|
"apply_guard",
|
|
"CoherencyJudge",
|
|
"ReasoningEthicsJudge",
|
|
"ReasoningCoherencyJudge",
|
|
"MetaCommentaryJudge",
|
|
"ScoreTagJudge",
|
|
"SubtaskMix",
|
|
"apply_mix",
|
|
"mix_summary",
|
|
]
|