Optimal Reward Labeling: Bridging Offline Preference and Reward-Based Reinforcement Learning