Basic reward function
Basic Reward Function
This example demonstrates how to create a simple reward function using RewardKit.
Overview
A basic reward function evaluates model responses and returns a numerical score. This example shows the fundamental concepts and patterns.
Simple Accuracy Reward
Usage
Key Concepts
- Decoration: Use
@reward_function
to create a reward function - Type Hints: Include type hints for better IDE support
- Normalization: Consider normalizing inputs (e.g., lowercasing, stripping whitespace)
- Return Values: Return numerical scores (typically 0.0 to 1.0)