Event Rewards
Event rewards are step-level rewards attached to specific events within a session. They enable fine-grained credit assignment, allowing you to attribute rewards to individual LLM decisions, environment interactions, or runtime actions.Overview
Unlike outcome rewards (which score the entire episode), event rewards provide per-step feedback:- Attach rewards to specific LLM decisions
- Track achievement progress across steps
- Enable shaped reward signals
- Support multiple reward sources (environment, evaluator, human)
Schema
Fields
event_id (required)
- Foreign key to
events.id - Links this reward to a specific event (LLM call, env step, runtime action)
reward_value (required)
- Numeric reward value
- Can be positive (reward) or negative (penalty)
- No fixed scale; interpretation depends on
reward_type
reward_type (optional)
"shaped": Dense reward signal for intermediate progress"sparse": Reward only at key milestones"achievement": Binary indicator for unlocking an achievement"achievement_delta": Count of achievements unlocked"unique_achievement_delta": Count of new achievements this episode"penalty": Negative reward for undesirable behavior"evaluator": Reward from automated judge/rubric"human": Human-annotated reward
key (optional)
- String identifier for specific reward criteria
- Examples:
"collected_wood","solved_task","tool_use_success"
source (optional)
"environment": Emitted by task environment"runner": Computed by rollout executor"evaluator": From automated judge/LLM evaluator"human": Human annotation
annotation (optional)
- Free-form JSON for additional context
- Examples:
{"delta": 3, "prev_count": 2, "curr_count": 5}
turn_number (optional)
- 1-based turn index for conversational contexts
- Useful for aligning rewards with dialogue turns
Recording Event Rewards
From Task Apps
Task apps can record event rewards during rollout execution:Automatic Recording from Environment Events
EnvironmentEvent instances with non-zero reward automatically create a sparse event reward:
Reward Types in Detail
Achievement Delta
Count of achievements that became true during this step.Unique Achievement Delta
Count of new achievements this episode (first time unlocked).Per-Achievement Rewards
One reward per achievement unlocked:Shaped Rewards
Dense rewards for incremental progress:Evaluator Rewards
Rewards from automated judges/rubrics:Querying Event Rewards
Get All Event Rewards for a Session
Get Event Rewards by Type
Sum Event Rewards for RL Training
Use Cases
1. RL with Achievement-Based Rewards
2. Filtering High-Quality Steps for SFT
3. Combining Event and Outcome Rewards
Best Practices
1. Be Consistent with Reward Types
2. Provide Context in Annotations
3. Use Keys for Specific Achievements
4. Specify Source
See Also
- V3 Traces - Complete trace format specification
- Outcome Rewards - Episode-level rewards
- Judges - Automated evaluation with rubrics
- Filter CLI - Filter sessions by rewards