What is a reward function?
A reward function is the rule that scores an AI system's actions during training, defining what counts as success. In reinforcement learning, the reward is the system's only feedback, and the system learns to maximize the total it expects to collect. Hugging Face's agent glossary separates rewards checked by code, such as whether a test passed, from rewards judged by people or another model.
Why it matters to a revenue leader
A reward function is a comp plan for software. Whatever it pays for, the system will pursue, including shortcuts its designers did not intend. A sales plan that pays on bookings alone can draw heavy discounting and poor-fit deals, and a reward that counts one thing creates the same pull. When a vendor trains or tunes AI on your outcomes, the measure of success it chose shapes the behavior your team will see.
Example
Fictitious numbersA vendor tunes an AI agent that books maintenance visits for a commercial HVAC company. The first version is rewarded for each booked visit, and bookings rise 20% while no-shows double. The second version is rewarded for completed visits and penalized for no-shows, and the agent starts confirming appointments the day before. Both versions start from the same model, and only the reward changed.
"If our AI tools were paid like sellers, what would their comp plan reward?"
Sources
- The Reinforcement Learning Framework | Hugging Face Deep RL Course checked 9 Oct 2026
- Harness, Scaffold, and the AI Agent Terms Worth Getting Right | Hugging Face checked 9 Oct 2026