Reward Function Library

Each function is a drop-in verify_environment(completion, metadata) for any compiled Verifiable-outcome loop. Every one is executed against its test cases on every build. Each entry also says how a policy will try to game it.

Exact-match final answer1.0 when the last line reads ANSWER: <value> and the value matches the key. Math, lookups, short QA.metadata: "answer"
Legal tool call1.0 when the output is a single tool call to an allowed tool with every required argument.metadata: "tools"
Grounded citationsFraction of cited [doc:id] markers that exist in the retrieved set. 0 if nothing is cited.metadata: "allowed_docs"
Brier-scored probabilityContinuous reward 1 − (p − outcome)². A proper scoring rule: honest probabilities maximize expected reward.metadata: "label"
Unit tests pass1.0 when the generated code plus your hidden tests pass pytest inside a timeout.metadata: "tests" · requires pytest
Strict output format1.0 when the whole output matches a regex you supply. Labels, IDs, dates, one-word classifications.metadata: "pattern"

Missing a reward you need? Write it up on the Reinforcement HackerNoon page.

Reward Function Library — Reinforcement.tech