← All questions
AgentsMedium· RL· Latency· Search Agents· Reward Engineering

Your RL-trained search agent hits the accuracy target a...

The agent is behaving correctly according to its reward function, which lacks a penalty for search calls. To fix this, introduce a penalty term λn to the reward function. The coefficient λ should be set based on the cost per call versus the value of accuracy. While a hard inference cap can recover the budget immediately, it may truncate the multi-hop questions the agent was designed for. Therefore, the recommended approach is to ship the cap, retrain the agent with the new reward, and compare performance at matched call counts.

Code playground (Python)