Strict output format
1.0 when the whole output matches a regex you supply. Labels, IDs, dates, one-word classifications.
How it gets gamed
A loose pattern rewards garbage that happens to fit. The function uses fullmatch, so the entire stripped output must match — no preamble. See reward hacking.
Use it
Compile a Verifiable-outcome loop, then replace its verify_environment with this one. Put "pattern" in each JSONL row’s metadata.
Compile a loop for it: Specialized Tool Agents · Nemotron-3.5-Lightning
format_regex.pyverify_environment
def verify_environment(completion: str, metadata: dict | None = None) -> float: """metadata["pattern"]: a Python regex the entire stripped completion must fullmatch.""" import re pattern = (metadata or {}).get("pattern") if not pattern: return 0.0 try: return 1.0 if re.fullmatch(pattern, completion.strip()) else 0.0 except re.error: return 0.0
Test cases (run on every build)
"2026-11-20" with {"pattern":"\\d{4}-\\d{2}-\\d{2}"} → 1
"The date is 2026-11-20" with {"pattern":"\\d{4}-\\d{2}-\\d{2}"} → 0
" positive " with {"pattern":"(positive|negative|neutral)"} → 1