<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Contrastive Preference Learning: Learning from Human Feedback without RL</title></titleStmt>
			<publicationStmt>
				<publisher>International Conference on Learning Representations (ICLR)</publisher>
				<date>05/01/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10538658</idno>
					<idno type="doi"></idno>
					
					<author>Joey Hejna</author><author>Rafael Rafailov</author><author>Harshit Sikchi</author><author>Chelsea Finn</author><author>Scott Niekum</author><author>W Bradley Knox</author><author>Dorsa Sadigh</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Reinforcement Learning from Human Feedback (RLHF) has emerged as a popular paradigm for aligning models with human intent. Typically RLHF algorithms operate in two phases: first, use human preferences to learn a reward function and second, align the model by optimizing the learned reward via reinforcement learning (RL). This paradigm assumes that human preferences are distributed according to reward, but recent work suggests that they instead follow the regret under the user's optimal policy. Thus, learning a reward function from feedback is not only based on a flawed assumption of human preference, but also leads to unwieldy optimization challenges that stem from policy gradients or bootstrapping in the RL phase. Because of these optimization challenges, contemporary RLHF methods restrict themselves to contextual bandit settings (e.g., as in large language models) or limit observation dimensionality (e.g., state-based robotics). We overcome these limitations by introducing a new family of algorithms for optimizing behavior from human feedback using the regret-based model of human preferences. Using the principle of maximum entropy, we derive Contrastive Preference Learning (CPL), an algorithm for learning optimal policies from preferences without learning reward functions, circumventing the need for RL. CPL is fully off-policy, uses only a simple contrastive objective, and can be applied to arbitrary MDPs. This enables CPL to elegantly scale to high-dimensional and sequential RLHF problems while being simpler than prior methods.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">INTRODUCTION</head><p>As large pretrained models have become increasingly performant, the problem of aligning them with human preferences has risen to the forefront of research. This alignment is especially difficult when larger datasets inevitably include suboptimal behaviors. Reinforcement learning from human feedback (RLHF) has emerged as a popular solution to this problem. Using human preferences, RLHF techniques discriminate between desirable and undesirable behaviors with the goal of refining a learned policy. This paradigm has shown promising results when applied to finetuning large language models (LLMs) <ref type="bibr">(Ouyang et al., 2022)</ref>, improving image generation models <ref type="bibr">(Lee et al., 2023)</ref>, and adapting robot policies <ref type="bibr">(Christiano et al., 2017</ref>) -all from suboptimal data. For most RLHF algorithms, this process includes two phases. First, a reward model is trained from user preference data. And second, that reward model is optimized by an off-the-shelf reinforcement learning (RL) algorithm.</p><p>Unfortunately, this two-phase paradigm is founded on a flawed assumption. Algorithms that learn reward models from preference data require that human preferences are distributed according to the discounted sum of rewards or partial return of each behavior segment. However, recent work <ref type="bibr">(Knox et al., 2022</ref>) calls this into question, positing that humans instead provide preferences based on the regret of each behavior under the optimal policy of the expert's reward function. Intuitively, a human's judgement is likely based on optimality, instead of which states and actions have higher quantity for reward. As a result, the correct quantity to learn from feedback might not be the reward, but instead the optimal advantage function or, in other words, the negated regret.</p><p>In their second phase, two-phase RLHF algorithms optimize the reward function learned from the first phase with RL. In practice, RL algorithms suffer from a suite of optimization challenges stemming from temporal credit assignment, such as the high-variance of policy gradients <ref type="bibr">(Marbach &amp; Tsitsiklis, 2003)</ref> or instability of approximate dynamic programming <ref type="bibr">(Van Hasselt et al., 2018)</ref>. Thus, past works limit their scope to circumvent these issues. For instance, RLHF techniques for LLMs assume a contextual bandit formulation <ref type="bibr">(Ouyang et al., 2022)</ref>, where the policy receives a single reward value in response to a given query to the user. While this reduces the need for long-horizon credit assignment, and consequently the high variance of policy gradients, in reality user interactions with LLMs are multi-step and sequential, violating the single-step bandit assumption. As another example, RLHF has been applied to low-dimensional state-based robotics problems <ref type="bibr">(Christiano et al., 2017;</ref><ref type="bibr">Sikchi et al., 2023a)</ref>, a setting where approximate dynamic programming excels, but not yet scaled to more realistic high-dimensional continuous control domains with image inputs. Broadly, RLHF methods not only incorrectly assume that the reward function alone drives human preferences, but also require mitigating the optimization challenges of RL by making restrictive assumptions about the sequential nature of problems or dimensionality.</p><p>In this work, we introduce a new family of RLHF methods that use a regret-based model of preferences, instead of the commonly accepted partial return model that only considers the sum of rewards. Unlike the partial return model, the regret-based model directly provides information about the optimal policy. A fortunate outcome of this is that it completely eliminates the need for RL, allowing us to solve RLHF problems in the general MDP framework with high-dimensional state and action spaces. Our key insight is to combine the regret-based preference framework with the principle of Maximum Entropy (MaxEnt), resulting in a bijection between advantage functions and policies. By exchanging optimization over advantages for optimization over policies, we are able to derive a purely supervised learning objective whose optimum is the optimal policy under the expert's reward. We refer to our approach as Contrastive Preference Learning due to its resemblance with commonly accepted contrastive learning objectives.</p><p>CPL has three key benefits over prior work. First, CPL can scale as well as supervised learning because it uses only supervised objectives to match the optimal advantage without any policy gradients or dynamic programming. Second, CPL is fully off-policy, enabling effectively using any offline suboptimal data source. Finally, CPL can be applied to arbitrary Markov Decision Processes (MDPs), allowing for learning from preference queries over sequential data. To our knowledge, no prior methods for RLHF simultaneously fulfill all three of these tenets. To demonstrate CPL's adherence to the three aforementioned tenets, we show its effectiveness on sequential decision making problems with sub-optimal and high-dimensional off-policy data. Notably, we show that CPL can effectively use the same RLHF fine tuning procedure as dialog models to learn temporally extended manipulation policies in the MetaWorld Benchmark. Specifically, we pretrain policies using supervised learning from high-dimensional image observations, before fine tuning them with preferences. Without dynamic programming or policy gradients, CPL is able to match the performance of prior RL based methods. At the same time, it is 1.6&#215; faster and four times as parameter efficient. When using denser preference data, CPL is able to surpass the performance of RL baselines on 5 out of 6 tasks.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">PRELIMINARIES</head><p>We consider the general reinforcement learning from human feedback (RLHF) problem within a reward-free MDP M/r = (S, A, p, &#947;) with state space S, action space A, transition dynamics p(s t+1 |s t , a t ), and discount factor &#947;. We assume all states are reachable by some policy. The goal of RLHF is to learn a policy &#960;(a|s) that maximizes an expert user's reward function r E (s, a). However, since the reward function is not given in an MDP /r, it must be inferred from the expert's preferences. Typically, a user preference orders two behavior segments. A length-k segment is denoted &#963; = (s 1 , a 1 , s 2 , a 2 , . . . , s k , a k ). We use &#963; + &#8827; &#963; -to indicate that segment &#963; + was preferred to &#963; - by the user without loss of generality and assume we are given a dataset</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Standard Two-Phase RLHF</head><p>Phase 1 Reward Learning Phase 2 RL &#119903; &#120579; &#120590; - &#120590; + RL Algorithm &#120587; &#120579; (&#119886;|&#119904;) Contrastive Preference Learning Contrastive Learning &#120590; - &#120590; + &#120590; + log &#120587; &#120579; (&#119886; &#119905; + |&#119904; &#119905; + ) &#120590; - log &#120587; &#120579; (&#119886; &#119905; -|&#119904; &#119905; -) Regret-based Preferences &#119871; &#119862;&#119875;&#119871; = -&#120124; log &#119875; log &#120587; &#120579; &#120590; + &#8827; &#120590; - &#119886; + &#119886; - &#120587; &#120579; (&#119886;|&#119904;) &#119875; &#119860; * &#120590; + &#8827; &#120590; -= &#119890; &#963; &#120590; + &#119860; * (&#119904; &#119905; + ,&#119886; &#119905; + )</p><p>&#119890; &#963; &#120590; + &#119860; * (&#119904; &#119905; + ,&#119886; &#119905; + ) + &#119890; &#963; &#120590; -&#119860; * (&#119904; &#119905; -,&#119886; &#119905; -)</p><p>Figure <ref type="figure">1</ref>: While most RLHF algorithms use a two-phase reward learning, then RL approach, CPL directly learns a policy using a contrastive objective. This is enabled by the regret preference model.</p><p>Maximum Entropy Reinforcement Learning. The aim of maximum-entropy reinforcement learning is to learn a policy &#960; that maximizes its causal entropy in addition to the cumulative discounted return, leading to the objective:</p><p>where &#945; is a temperature parameter. Augmenting the reward function with an additional negated log &#181;(a|s) term for reference distribution &#181;(a|s) yields the KL-constrained objective used in offline RL <ref type="bibr">(Levine &amp; Koltun, 2013;</ref><ref type="bibr">Garg et al., 2023)</ref> and prominent RLHF approaches for LLMs <ref type="bibr">(Ziegler et al., 2019;</ref><ref type="bibr">Ouyang et al., 2022)</ref>. Though we adopt the standard maximum entropy framework, our approach easily extends to the constrained setting. Under policy &#960; and reward function r, we denote the state-value function by V &#960; r (s) and state-action value function by</p><p>, measures how much worse taking action a is than acting according to &#960;. We use &#960; * as short-hand for the solution to Eq. ( <ref type="formula">1</ref>) with reward function r E , and write its corresponding corresponding value functions as V * (s) and Q * (s, a) instead of V &#960; * r E and Q &#960; * r E . We measure the optimality of behavior directly by using the advantage function of &#960; * , A * (s, a).</p><p>The Regret (or Advantage) Preference Model. Learning &#960; * requires characterizing how preferences are generated according to a preference model P E [&#963; + &#8827; &#963; -], or the probability the expert prefers &#963; + to &#963; -. Typically, the preference model is chosen to be the Boltzmann rational distribution over each segment's discounted partial return, &#8721;&#65025; k t=1 &#947; t r E (s t , a t ), where r E is the expert's hidden reward function. However, such models have been shown to be inconsistent with real human preferences <ref type="bibr">(Knox et al., 2022)</ref>. For instance, consider a sparse reward r E (s, a) = 1{s = g}. Two segments that do not reach the goal would have the same partial returns even if one moved towards the goal g while the other moved away from it. This inconsistency is resolved by considering preferences to be distributed according to the Boltzmann rational distribution over the negated discounted regret under r E , or -</p><p>In this framework, a user's preference indicates that a segment has lower regret with respect to their intended optimal policy. Leveraging the equivalence of negated regret and the discounted sum of optimal advantages, we equivalently write the regret-based preference model as</p><p>where we use the shorthand "+" and "-" as indexing the states and actions of segments &#963; + and &#963; -. In the next section, we use the regret preference model in combination with the principle of maximum causal entropy to derive CPL.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">CONTRASTIVE PREFERENCE LEARNING</head><p>Though recent work has shown that human preferences are better modeled by the optimal advantage function or regret, most existing RLHF algorithms assume otherwise. By learning a reward function with a mistaken model of preference and then applying RL, traditional RLHF approaches incur a vast, unnecessary computational expense <ref type="bibr">(Knox et al., 2023)</ref>. Our aim is to derive simple and scalable RLHF algorithms that are purpose-built for the more accurate regret model of human preferences.</p><p>Modeling human preferences with regret is not new, but past work suffers from a number of shortcomings. Specifically, existing algorithms using the regret preference model are brittle, as they rely on estimating gradients with respect to a moving reward function, which thus far has only been approximated by computing successor features and assuming a correct linear or tabular representation of the expert reward function r E <ref type="bibr">(Knox et al., 2022;</ref><ref type="bibr">2023)</ref>. Consequently, these algorithms appear unsuitable for complex scenarios beyond the simplistic grid world environments in which they have been tested.</p><p>The key idea of our approach is simple: we recognize that the advantage function, used in regret preference model, can easily be replaced with the log-probability of the policy when using the maximum entropy reinforcement learning framework. The benefit of this simple substitution is however immense. Using the log-probability of the policy circumvents the need to learn the advantage function or grapple with optimization challenges associated with RL-like algorithms. In sum, this enables us to not only embrace a more closely aligned regret preference model, but also to exclusively rely on supervised learning when learning from human feedback.</p><p>In this section, we first derive the CPL objective and show that it converges to the optimal policy for r E with unbounded data. Then, we draw connections between CPL and other supervised-learning approaches. Finally, we provide recipes for using CPL in practice. Our algorithms are the first examples of a new class of methods for sequential decision making problems which directly learn a policy from regret based preferences without RL, making them far more efficient.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">FROM OPTIMAL ADVANTAGE TO OPTIMAL POLICY</head><p>Under the regret preference model, our preference dataset D pref contains information about the optimal advantage function A * (s, a), which can intuitively be seen as a measure of how much worse a given action a is than an action generated by the optimal policy at state s. Therefore, actions that maximize the optimal advantage are by definition an optimal actions and learning the optimal advantage function from preferences should intuitively allow us to extract the optimal policy.</p><p>Na&#239;ve approach. When presented with D pref , one might na&#239;vely follow the standard RLHF reward modeling recipe, but with advantages. This would equate to optimizing a parameterized advantage A &#952; to maximize the log likelihood of D pref given the preference model in Eq. (2), or</p><p>where P A &#952; is the preference model induced by the learned advantage function. Once an advantage function that aligns with the preference data is learned, it could be distilled into a parameterized policy. At first glance, it seems like this simple two-step approach could be used to recover the optimal policy from preference data. However, it turns out that learning a Bellman-consistent advantage function is non-trivial in both standard and MaxEnt RL, making learning a valid intermediate advantage function not only unnecessary, but also harder in practice.</p><p>Eliminating the need to learn advantage. In maximum entropy RL, <ref type="bibr">Ziebart (2010)</ref> has shown that the following relationship between the optimal advantage function and optimal policy holds:</p><p>This means that in order for a learned advantage function to be optimal, it must be normalized, that is &#8747;&#65025; A e A * (s,a)/&#945; da = 1. Enforcing this constraint is intractable, particularly in continuous spaces with large neural networks, making na&#239;vely learning A &#952; via maximum likelihood estimation difficult.</p><p>However, one might instead notice that the above equation establishes a bijection between the advantage function A * r and the policy &#960; * , namely that the optimal advantage function is proportional to the optimal policy's log-likelihood:</p><p>This means that instead of learning the optimal advantage function, we can directly learn the optimal policy. Given preferences are distributed according to the optimal advantage function for the expert reward function r E , we can write the preference model in terms of the optimal policy &#960; * by substituting Eq. (3) into Eq. (2) as follows,</p><p>.</p><p>(4)</p><p>Thus, the maximum entropy framework has led to a model of human preferences that is solely in terms of the optimal policy &#960; * . Using this equivalent form of the advantage-based preference model, we can directly optimize a learned policy &#960; &#952; to match the preference model via maximum likelihood with the following convex objective:</p><p>Assuming sufficient representation power, at convergence &#960; &#952; will perfectly model the user's preferences, and thus exactly recover &#960; * under the advantage-based preference model given an unbounded amount of preference data. Specifically, in Appendix A, we prove the following Theorem: Theorem 1. Assume an unbounded number of preferences generated from a noisy rational regretpreference model with expert advantage function A * . CPL recovers the optimal policy &#960; * corresponding to reward r E .</p><p>This proof relies on the bijection between optimal advantage functions and policies in maximum entropy RL and the fact that the regret preference model is identifiable <ref type="bibr">(Knox et al., 2022)</ref>, meaning the objective can achieve a loss of zero.</p><p>Benefits of directly learning the policy. Directly learning &#960; in this manner has several benefits, both practical and theoretical. Perhaps most obviously, directly learning the policy circumvents the need for learning any other functions, like a reward function or value function. This makes CPL extremely simple in comparison to prior work. When scaling to larger models, only learning the policy reduces both complexity and computational cost. Second, as pointed out by prior works <ref type="bibr">(Christiano et al., 2017;</ref><ref type="bibr">Hejna &amp; Sadigh, 2023)</ref>, reward learning can be harmed by the invariance of Boltzmann rational preference models (Eq. (2)) to shifts; i.e., adding a constant to each exponent does not change</p><p>In CPL the distributional constraint of the policy (&#960; &#952; (a|s) &#8805; 0 for all a and &#8747;&#65025; A &#960; &#952; (a|s)da = 1) remedies this issue automatically, since adding a constant makes &#8747;&#65025; A &#960; &#952; (a|s)da &#824; = 1. Finally, per previous arguments, the policy's distributional constraint guarantees that &#8747;&#65025; A e A &#952; (s,a)/&#945; da = 1. Thus, it can be shown that CPL's learned implicit advantage function is always the optimal advantage function for some reward function. We call this property, defined below, consistency and prove the following Proposition in Appendix A. Definition 1. An advantage function A(s, a) is consistent if there exists some reward function r(s, a) for which A is the optimal advantage, or A(s, a) = A * r (s, a). Proposition 1. CPL learns a consistent advantage function.</p><p>The consequences of this are that no matter the amount of preference data used, CPL will always learn the optimal policy for some reward function, and adding additional preference data only improves the implicit estimate of r E .</p><p>Connections to Contrastive Learning. When deriving CPL, we intentionally chose to denote preferred and unpreferred behavior segments by "+" and "-" to highlight the similarities between CPL and contrastive learning approaches. Though some two-phase RLHF approaches have drawn connections between their reward learning phase and contrastive learning <ref type="bibr">(Kang et al., 2023)</ref>, CPL directly uses a contrastive objective for policy learning. Specifically, Eq. ( <ref type="formula">5</ref>) is an instantiation of the Noise Constrastive Estimation objective <ref type="bibr">(Gutmann &amp; Hyv&#228;rinen, 2010)</ref> where a segment's score is its discounted sum of log-probabilities under the policy, the positive example being &#963; + and the negative &#963; -. In the appendix we show that when applied to ranking data using a Plackett-Luce Model, CPL recovers the InfoNCE objective from <ref type="bibr">Oord et al. (2018)</ref> where the negative examples are all the segments ranked below the positive segment. Effectively, CPL has fully exchanged the reinforcement learning objective for a supervised, representation learning objective while still converging to the optimal policy. As marked success has been achieved applying contrastive learning objectives to large-scale datasets and neural networks <ref type="bibr">(Chen et al., 2020;</ref><ref type="bibr">He et al., 2020;</ref><ref type="bibr">Radford et al., 2021)</ref>, we expect CPL to scale competitively to RLHF methods that use traditional RL algorithms.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">PRACTICAL CONSIDERATIONS</head><p>The Contrastive Preference Learning framework provides a general loss function for learning policies from advantage-based preferences, from which many algorithms can be derived. In this section, we detail practical considerations for one particular instantiation of the CPL framework which we found to work well in practice. In the appendix, we include several instantiations of CPL for different types of data and conservative regularizers.</p><p>CPL with Finite Offline Data. Though CPL converges to the optimal policy with unbounded preference data, in practice we are often interested in learning from finite offline datasets. In this setting, policies that extrapolate too much beyond the support of the dataset perform poorly as they take actions leading to out of distribution states. Like many other preference-based objectives, CPL's objective is not strictly convex (Appendix A.3). Thus, many policies, even those with a high weight on actions not in the dataset, can achieve the same optima of Eq. ( <ref type="formula">5</ref>). We demonstrate this by formulating CPL as a logistic regression problem. Let the policy be represented by a one-dimensional vector &#960; &#8712; R |S&#215;A| . The difference between positive and negative segments,</p><p>) can be re-written as a dot-product between &#960; and a "comparison" vector x, whose values are either &#947; t , -&#947; t , or 0 indicating membership to the comparison &#963; + &#8827; &#963; -. Using the logistic function, logistic(z) = 1 1+e -z , we re-write the CPL objective in the finite case as</p><p>denotes the tth timestep of the preferred segment from the ith comparison in D pref . We can reason about the set of all policies that yield the same CPL loss by assembling all comparison vectors into a matrix X, where the ith row of X is the vector x i for the ith comparison in the dataset. Any changes to log &#960; in the null space of X have no effect on the logits of the logistic function, and consequently no effect on the loss. In practice, |S &#215; A| &gt;&gt; n, making the null space of X often nontrivial such that there are multiple minimizers of the CPL loss, some of which potentially place a high probability on state-action pairs not in the dataset. In Appendix A.3 we provide constructions of X where this is true. Next, we show how this problem can be resolved by incorporating regularization into the CPL objective.</p><p>Regularization. In finite settings, we want to choose the policy that minimizes the CPL loss function while placing higher likelihood on actions in the dataset. To accomplish this, we modify Eq. ( <ref type="formula">5</ref>) with a conservative regularizer that assigns lower loss when the policy has higher likelihood on actions in D pref , keeping it in-distribution. Though there are many possible choices of regularizers, we use an asymmetric "bias" regularizer adapted from <ref type="bibr">An et al. (2023)</ref> as it performed best in our experiments. Within our objective, the bias regularizer down-weights negative segments by &#955; &#8712; (0, 1) as so:</p><p>If the policy places more weight on actions in the dataset, log &#960; &#952; (a|s) will increase. In the standard Boltzmann model, increasing the log-probabilities of both the positive and negative segments by the same amount would have no effect on the loss. The bias, however, weighs the increased logprobabilities of the negative segments less, which ultimately decreases the loss. Thus, while a minimizer of the vanilla CPL loss function could place a high probability on unseen actions, Eq. ( <ref type="formula">6</ref>) is minimized with a higher weight on in-distribution actions. This is formally captured by the following proposition, which shows that, for a fixed policy, L CPL(&#955;) is lower when the policy places a higher likelihood on actions in the dataset versus other comparisons with the same CPL Loss. Proposition 2. Consider a comparison &#963; + &#8827; &#963; -from D pref and an arbitrary comparison</p><p>Essentially, this shows that the bias regularizer breaks ties in the CPL loss function by penalizing lower likelihoods. We prove this, along with a more general version, in Appendix A.4. In Appendix B we also consider CPL variants with other forms of conservative regularization.</p><p>Pretraining. Pre-training the policy &#960; &#952; with behavior cloning (BC) is a common practice in RLHF <ref type="bibr">(Ouyang et al., 2022)</ref>. Thus, before fine-tuning with preferences using the CPL loss, we trained the policy using the standard maximum likelihood BC objective, min &#952; E (s,a)&#8764;D [log &#960; &#952; (a|s)]. Though D could be any dataset, we chose D pref . We found that this helped performance in some cases, but hurt it others (Appendix C). We posit that pre-training helps when a policy closer to the data distribution is desirable, particularly when out-of-distribution actions are detrimental.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">EXPERIMENTS</head><p>In this section, we address the following questions about CPL: First, is CPL effective at fine-tuning policies from regret-based preferences? Second, does CPL scale to high-dimensional control problems and larger networks? Third, what ingredients of CPL are important for attaining high performance? And finally, how does CPL perform with limited real-human preference data? Additional experiments and details are included in the appendix.</p><p>Preference Data. We evaluate CPL's ability to learn policies for general MDPs from sub-optimal offpolicy rollout data and preferences. In particular, we consider the training procedure commonly used for large foundation models: supervised learning followed by fine-tuning with RLHF. To do this, we use six tasks from the MetaWorld robotics benchmark <ref type="bibr">(Yu et al., 2020)</ref>. First, we train baseline policies until they approximately reach a 50% success rate. Then, we rollout 2500 episodes for each suboptimal stochastic policy. We then form synthetic preference datasets D pref of different sizes by sampling segments of length 64 uniformly from the rollout data. We estimate regret-based preference labels using the Q-function and policy of an oracle Soft Actor-Critic (SAC) <ref type="bibr">(Haarnoja et al., 2018)</ref> model trained to 100% success on a combination of the suboptimal rollout and online data. In practice, we consider two main types of preference datasets: dense, where we label comparisons between every sampled segment (effectively ranking all segments), and sparse, where we label only one comparison per segment.</p><p>Baseline Methods. We consider four strong baselines. First, supervised fine-tuning (SFT) trains a policy with BC on all segments, then fine-tunes on only the preferred segments, i.e., all &#963; + in D pref .</p><p>The second baseline is Preference IQL (P-IQL), which learns a reward function from D pref assuming the partial return model, then subsequently learns a policy to maximize it with Implicit Q-Learning <ref type="bibr">(Kostrikov et al., 2022)</ref>, a state-of-the-art offline RL algorithm. Though P-IQL was first used with the partial return model, here it uses an approximation of A * r E as its reward, which as we show in Appendix A's Corollary 1 preserves the optimal policy. In fact, P-IQL should be more performant with regret-based labels, since A * r E is a highly shaped reward function for r E Ng et al. (1999); <ref type="bibr">Knox et al. (2023)</ref>. We use <ref type="bibr">Hejna &amp; Sadigh (2023)</ref>'s implementation of P-IQL as it outperformed several contemporary baselines. This baseline is also equivalent to TREX on pairwise preferences <ref type="bibr">(Brown et al., 2019)</ref>. Third, we consider PPO with a KL-constrained reward as commonly used for RLHF with <ref type="bibr">LLMs (Ziegler et al., 2019)</ref>. This is not a fair comparison, as PPO requires 3.84 million additional online state-action pairs to estimate the policy gradient, totalling 25&#215; the data for CPL 2.5K Dense and 4&#215; the data for CPL 20K Sparse. Unlike the contextual bandit setting used for LLMs, PPO here require full trajectory rollouts. Finally, to demonstrate CPL's ability to extrapolate beyond the best performance in the data, we compare to %BC, where a policy is trained with behavior cloning on the top X% of rollouts according to the ground truth r E .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">HOW DOES CPL PERFORM?</head><p>How does CPL perform with state-based observations? Our main state-based results can be found in rows 1 and 3 of Table <ref type="table">1</ref>. When using sparser comparison data (row 3), CPL outperforms prior methods in 5 of 6 environments, often by a substantial margin of over P-IQL, particularly in the Button Press, Bin Picking, and Sweep Into environments. When applied to datasets with more dense comparisons (row 1), CPL performs even better. Though the dense-comparison datasets have less state-action coverage, they contain substantially more comparisons than the sparse-comparison datasets. We posit that more comparisons per segment is more beneficial to CPL than to P-IQL because of its contrastive objective -more comparison-rich datasets are likely to have more informative positive-negative pairs that help shape the policy. PPO is unable to consistently perform better than CPL despite access to vast amounts of online data from the environment. We found PPO to be very sensitive to the KL-constraint coefficient on reward, which makes it difficult to tune as observed in prior work <ref type="bibr">(Touvron et al., 2023)</ref>. This problem is likely exacerbated by the instability of the KL-divergence in continuous spaces and the high variance of both value estimation and policy gradients with longer horizons in robotics tasks versus the LLM contextual-bandit setting. We find that CPL consistently outperforms %BC, indicating the CPL is indeed exhibiting policy improvement beyond the best behaviors in the dataset.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>How does CPL scale to high-dimensional observations?</head><p>To test how CPL's supervised objectives scale to high-dimensional continuous control problems, we render the MetaWorld datasets discussed above to 64 &#215; 64 images. We use the network architecture from DrQv2 <ref type="bibr">(Yarats et al., 2022)</ref> and Bin Picking Button Press Door Open Drawer Open Plate Slide Sweep Into State 2.5k Dense PPO 83.7 &#177; 3.7 22.7 &#177; 1.9 79.3 &#177; 1.2 66.7 &#177; 8.2 51.5 &#177; 3.9 55.3 &#177; 6.0 SFT 66.9 &#177; 2.1 21.6 &#177; 1.6 63.3 &#177; 1.9 62.6 &#177; 2.4 41.6 &#177; 3.5 51.9 &#177; 2.1 P-IQL 70.6 &#177; 4.1 16.2 &#177; 5.4 69.0 &#177; 6.2 71.1 &#177; 2.3 49.6 &#177; 3.4 60.6 &#177; 3.6 CPL 80.0 &#177; 2.5 24.5 &#177; 2.1 80.0 &#177; 6.8 83.6 &#177; 1.6 61.1 &#177; 3.0 70.4 &#177; 3.0 Image 2.5k Dense SFT 74.7 &#177; 4.8 20.8 &#177; 2.4 62.9 &#177; 2.3 64.5 &#177; 7.6 44.5 &#177; 3.2 52.5 &#177; 2.5 P-IQL 83.7 &#177; 0.4 22.1 &#177; 0.8 68.0 &#177; 4.6 76.0 &#177; 4.6 51.2 &#177; 2.4 67.7 &#177; 4.4 CPL 80.0 &#177; 4.9 27.5 &#177; 4.2 73.6 &#177; 6.9 80.3 &#177; 1.4 57.3 &#177; 5.9 68.3 &#177; 4.8 State 20k Sparse PPO 68.0 &#177; 4.3 24.5 &#177; 0.8 82.8 &#177; 1.6 63.2 &#177; 6.6 60.7 &#177; 4.2 58.2 &#177; 0.6 SFT 67.0 &#177; 4.9 21.4 &#177; 2.7 63.6 &#177; 2.4 63.5 &#177; 0.9 41.9 &#177; 3.1 50.9 &#177; 3.2 P-IQL 75.0 &#177; 3.3 19.5 &#177; 1.8 79.0 &#177; 6.6 76.2 &#177; 2.8 55.5 &#177; 4.2 73.4 &#177; 4.2 CPL 83.2 &#177; 3.5 29.8 &#177; 1.8 77.9 &#177; 9.3 79.1 &#177; 5.0 56.4 &#177; 3.9 81.2 &#177; 1.6 Image 20k Sparse SFT 71.5 &#177; 1.9 22.3 &#177; 2.9 65.2 &#177; 2.2 67.5 &#177; 1.1 41.3 &#177; 2.8 55.8 &#177; 2.9 P-IQL 80.0 &#177; 2.3 27.2 &#177; 4.1 74.8 &#177; 5.8 80.3 &#177; 1.2 54.8 &#177; 5.8 72.5 &#177; 2.0 CPL 78.5 &#177; 3.1 31.3 &#177; 1.6 70.2 &#177; 2.1 79.5 &#177; 1.4 61.0 &#177; 4.2 72.0 &#177; 1.8 State % BC 10% 62.6 &#177; 2.6 18.9 &#177; 1.7 57.5 &#177; 3.0 61.5 &#177; 3.7 39.1 &#177; 2.5 49.3 &#177; 2.1 5% 64.6 &#177; 4.1 18.2 &#177; 0.6 59.8 &#177; 1.6 61.3 &#177; 1.8 38.6 &#177; 2.5</p><p>49.2 &#177; 1.9</p><p>Table 1: Success rates (in percent) of all methods across six tasks on the MetaWorld benchmark on different datasets. The leftmost column contains the observation modality (state or image), the number of segments in the dataset, and the means of labeling comparisons (dense or sparse). Dense refers to labeling every possible pairwise comparison and sparse refers to labeling only one comparison for every two segments, e.g., 10k comparisons for 20k segments. We run four seeds for state and three seeds for images. We report the maximum average performance across seeds over an 8-checkpoint, 200 episode evaluation window (details in Appendix D). Bolded values are within 1% of the top-performing method. The bottom section shows oracle performance of %BC with access to ground-truth reward. State-spaces results include PPO (delinated with a dashed line) which is not a 1-1 comparison as it uses 3.84 million extra online transitions.</p><p>the same hyper-parameters as our state-based experiments. We additionally use random shift augmentations, which drastically improve the performance of RL from images <ref type="bibr">(Laskin et al., 2020)</ref>.</p><p>Our image-based results can be found in rows 2 and 4 of Table <ref type="table">1</ref>. Interestingly, we find that performance moderately increases for SFT but substantially for P-IQL. We posit that this is because data-augmentation, which is inapplicable in state, plays a key role in improving value representation for P-IQL. Despite this, when learning from denser preference data (row 2), CPL still outperforms P-IQL in 4 of 6 environments and ties on Sweep Into. When learning from sparser comparisons (row 4), CPL and P-IQL perform comparably on most tasks, even though CPL is drastically simpler than P-IQL. Again, the gap in performance between CPL and P-IQL is higher with denser comparison data, underscoring the importance of informative negatives.</p><p>Method Params Runtime P-IQL 9.6m 16.5 hrs CPL 2.1m 10.2 hrs Table 2: Computational efficiency of each method when learning from pixels for 200k training steps on a single TitanRTX GPU.</p><p>These results are more impressive considering CPL's significant reduction in complexity. P-IQL must learn a reward function, a Q-function, a value function, and a policy. CPL avoids all of this, and only learns a policy, drastically reducing training time and parameter count. As we can see in Table <ref type="table">2</ref>, CPL runs 1.62&#215; faster than P-IQL on images and has less than a quarter of the the parameters. As networks get larger and larger, the performance gain from using CPL would only increase.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2">WHAT CONTRIBUTES TO CPL'S PERFORMANCE?</head><p>As alluded to in previous sections, we find that the gap in performance between CPL and baselines is higher for datasets with denser comparisons. This is consistent with prior works in contrastive  <ref type="bibr">Kim et al. (2023)</ref>. "PT" denotes the original Preference Transformer baseline which uses the IQL algorithm after learning a transformer-based reward model. learning <ref type="bibr">(Robinson et al., 2021)</ref>. To study this effect, evaluate CPL's performance as we increase the number of comparisons sampled per segment over a fixed dataset of 5000 segments. We show results of this for Drawer Open with state-based observations on the left of Fig. <ref type="figure">2</ref> and include the rest in Appendix C.3 in addition to dense data scaling. Overall, we find that CPL benefits from an increasing number of comparisons per segment in all tasks except Plate Slide. P-IQL is less affected, though sometimes performs worse with more comparisons, which we suspect is due to reward under-fitting. This highlights another drawback of P-IQL -due to its higher number of components, it has more hyperparameters and is consequently more sensitive to changes in the dataset. We tuned hyperparameters for all methods with 10K comparisons, then left them the same for scaling experiments.</p><p>Finally, we ablate both of CPL's hyperparameters -the temperature value &#945; and bias regularizer &#955;for Drawer Open on the right of Fig. <ref type="figure">2</ref>. While CPL generally performs well with all values, we find that higher performance could have been attained with further hyper-parameter tuning, particularly for &#955;. In the Appendix B we ablate more design decisions, like the choice of conservative regularizer.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3">HOW DOES CPL PERFORM ON LIMITED HUMAN PREFERENCES?</head><p>To demonstrate both the applicability of the regret preference model and performance of CPL, we perform additional experiments with real-human preferences. Specifically, we adopt the benchmarks from <ref type="bibr">Kim et al. (2023)</ref> which use either 100 (expert) or 500 (replay) human preferences on datasets from the D4RL benchmark <ref type="bibr">(Fu et al., 2020)</ref>. To faciliate learning from such a limited number of queries, we modified CPL by first learning a logistic regression model to predict the users preference P [&#963; + &#8827; &#963; -] following An et al. <ref type="bibr">(2023)</ref>. Critically, this is not a reward or advantage function as it takes entire segments as inputs, not single state-action pairs. We then use this model to relabel the offline D4RL data with dense preferences for CPL. We borrow the architecture from <ref type="bibr">Kim et al. (2023)</ref> and do not use BC pretraining. Our results can be found in Table <ref type="table">3</ref>. CPL has the best performance by a large margin in Hopper-Medium-Exp, but performs worse in Walker-Medium-Replay. We posit that this is because the preferences for this dataset may not closely follow the regret-based model as per discussions with the authors of <ref type="bibr">Kim et al. (2023)</ref> they were collected by a single user with a pre-planned rules-based approach. Nonetheless, CPL is still able to perform well on these tasks with only 100 or 500 human preferences, and no value or Q-function learning.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">RELATED WORK</head><p>Though RLHF has recently surged in popularity, learning policies from human preferences has been a long-studied problem, referred to as preference-based RL (PbRL).</p><p>PbRL methods typically start by learning a reward function, usually from pairwise comparisons, then use an RL algorithm for policy optimization <ref type="bibr">(F&#252;rnkranz et al., 2012)</ref>. While <ref type="bibr">Akrour et al. (2012;</ref><ref type="bibr">2011)</ref>; <ref type="bibr">Wilson et al. (2012)</ref> were some of the first examples of PbRL, more recently several works have shown that, provided thousands of queries or sufficient pretraining, PbRL can train deep neural-network policies for control using comparisons <ref type="bibr">(Christiano et al., 2017;</ref><ref type="bibr">Lee et al., 2021;</ref><ref type="bibr">Ibarz et al., 2018;</ref><ref type="bibr">Brown et al., 2020;</ref><ref type="bibr">Hejna &amp; Sadigh, 2022;</ref><ref type="bibr">Shin &amp; Brown, 2021)</ref> or rankings <ref type="bibr">(Brown et al., 2019;</ref><ref type="bibr">B&#305;y&#305;k et al., 2019;</ref><ref type="bibr">Sikchi et al., 2023a)</ref>. These approaches, however, are generally demonstrated only on low-dimensional state-based control because of the challenges RL faces when scaling to larger inputs and networks <ref type="bibr">(Ota et al., 2021)</ref>. In the past, removing RL has lead to effective algorithms for goal-conditioned RL from images <ref type="bibr">(Hejna et al., 2023;</ref><ref type="bibr">Eysenbach et al., 2022)</ref>. CPL does the same but for PbRL. Other works address the problem of selecting feedback <ref type="bibr">(Sadigh et al., 2017;</ref><ref type="bibr">Biyik et al., 2020;</ref><ref type="bibr">Daniel et al., 2015)</ref>, which we consider complementary because CPL can benefit from higher quality data elicitation.</p><p>To scale RLHF, recent approaches for refining LLMs have ignored the temporal component of RL, and instead treated text-generation as a contextual bandits problem <ref type="bibr">(Ziegler et al., 2019)</ref>. While this approach has proven effective at tasks like summarization <ref type="bibr">(Stiennon et al., 2020;</ref><ref type="bibr">Wu &amp; Hu, 2018)</ref>, instruction following <ref type="bibr">(Ouyang et al., 2022;</ref><ref type="bibr">Nakano et al., 2021)</ref>, and even image generation <ref type="bibr">(Lee et al., 2023;</ref><ref type="bibr">Black et al., 2023)</ref>, it fundamentally ignores the fact that interaction with users is often sequential, spanning multiple turns. Unlike these methods, CPL works with general MDPs. CPL's unique ability to learn from sequence data with only supervised objectives makes it a prime candidate for scaling to more complex problems. In fact, Direct Preference Optimization (DPO) <ref type="bibr">(Rafailov et al., 2023)</ref> recently demonstrated that a supervised objective similar to CPL can work as well as RL in the contextual bandits setting. We show in Appendix A that DPO can be derived as a special case of CPL in which segments are length 1 and start at the same state. This parallels <ref type="bibr">Knox et al. (2023)</ref>, who show that the common contextual bandit-approach is a special case of the na&#239;ve approach from Section 3.</p><p>To derive CPL's objective, we leverage knowledge from works building on the principle of maximum entropy in control <ref type="bibr">(Ziebart et al., 2008;</ref><ref type="bibr">Ziebart, 2010;</ref><ref type="bibr">Haarnoja et al., 2017)</ref>. The resulting contrastive update directly learns the optimal policy with fully off-policy data. This is unlike many RL-based RLHF algorithms in both langauge <ref type="bibr">(Ziegler et al., 2019)</ref> or control <ref type="bibr">(Christiano et al., 2017)</ref> which require on policy rollouts and additional learned components that have been shown to increase variance <ref type="bibr">(Hejna &amp; Sadigh, 2023)</ref>. Similar contrastive learning objectives have shown to be effective for temporal representation learning <ref type="bibr">(Ma et al., 2023)</ref>, even with preference data <ref type="bibr">(Kang et al., 2023;</ref><ref type="bibr">Xu et al., 2023;</ref><ref type="bibr">An et al., 2023)</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">DISCUSSION</head><p>In this work we introduce CPL, a novel framework for RLHF using the regret preference model. Theoretically, we proved that CPL always learns a consistent advantage function and converges to the optimal policy for the expert's reward function. Practically, we showed that CPL's supervised objective is able to outperform RL baselines when learning complex manipulation policies from dense preference data while being simpler and 1.6&#215; faster.</p><p>Limitations. CPL, like other RLHF approaches, assumes knowledge of the human rater's temporal discounting (i.e., of the discount factor &#947;), which in practice would be difficult to communicate. As CPL's loss function is computed over segments, it requires a substantial amount of GPU memory for large segment sizes. Finally, no model of human behavior is perfect.</p><p>Future Directions. Several exciting research directions remain. First is scaling CPL to larger datasets and architectures where we believe its benefits will be more pronounced. One potentially exciting application is LLMs, where CPL enables fine-tuning on multiple steps of turn-based dialogue. To our knowledge, no multi-step preferences dataset currently exists for LLMs. Second, our work only considers offline data generated by suboptimal policies. An online version of CPL could be developed that works with online human feedback, allowing policies to continually improve. Lastly, to relax the assumption that &#947; is known, one might instead include it in the expressivity of CPL or other RLHF approaches.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A THEORY A.1 PROOF OF CONSISTENCY</head><p>We first prove a lemma about the consistency of CPL as it is used when proving convergence.</p><p>Lemma 1. Any function A(s, a) that satisfies &#8747;&#65025; A e A(s,a)/&#945; da = 1 &#8704;s &#8712; S is a consistent advantage function under some reward function r in the MaxEntRL setting.</p><p>Idea. Given advantage A(s, a), we want to show that there exists a reward function r for which A is the optimal advantage function.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Proof. Given</head><p>&#8747;&#65025; A e A(s,a)/&#945; da = 1, consider the corresponding policy &#960; A (a|s) = e A(s,a)/&#945; . Let the reward function be the advantage, or r(s, a) = A(s, a) = &#945; log &#960; A (a|s). We can determine the optimal policy &#960; * for this reward according to Eq. ( <ref type="formula">1</ref>):</p><p>Thus, the objective is point-wise maximized if and only if &#960; A (&#8226;|s) = &#960;(&#8226;|s) &#8704; s &#8712; S. Therefore, &#960; A is the optimal policy for reward function r(s, a) = A(s, a).<ref type="foot">foot_0</ref> Under this reward function, &#960; * = &#960; A = e A , which implies that A is a consistent advantage function.</p><p>Proposition 1. CPL learns a consistent advantage function.</p><p>Optimization via CPL fits a valid policy &#960; subject to &#8747;&#65025; A &#960;(a|s)da = 1 &#8704;s &#8712; S, with corresponding MaxEnt Advantage function A(s, a) = &#945; log &#960;(a|s). Corollary 1. The reward function r and the reward function defined as the optimal advantage function for r, A * r , have the same optimal MaxEnt policy.</p><p>This corollary can be seen by examining the proof of Lemma 1. According to the MaxEnt RL objective for reward r the optimal policy is &#960; * r = e A * r /&#945; <ref type="bibr">(Ziebart, 2010)</ref>. Therefore A * r = &#945; log &#960; * r . Repeating the steps of Lemma 1 by setting r &#8242; = A * r = &#945; log &#960; * r , we get the following objective for the optimal policy &#960; * r &#8242; with respect to r &#8242; :</p><p>Since the final expression above is minimized only when &#960; = &#960; * r , then &#960; * r &#8242; = &#960; * r . In other words, the reward function r and reward function r &#8242; = A * r have the same optimal MaxEnt policy. Implication for our P-IQL baseline. With regret-based preferences, an algorithm that learns a reward function while assuming the partial return preference model and then conducts RL on that learned reward function-including P-IQL-is actually using an approximation of A * r as the reward function. This corollary therefore implies that if that approximation is error-free, then P-IQL is using a reward function that preserves the optimal policy of the expert user's reward function r E . This application of the corollary extends the similar insight of <ref type="bibr">Knox et al. (2023)</ref> to the MaxEnt RL setting. Furthermore, as shown in Lemma 1, when &#960; = &#960; * , E &#961;&#960; [r(s, a) -&#945; log &#960;(a|s)] = 0, implying that V * (s) = 0 as the reward and entropy regularization over the occupancy measure from any state is exactly the value function. Thus, as originally pointed out by <ref type="bibr">(Ng et al., 1999)</ref>, using A * r as the reward function results in a high amount of shaping, so much so that a horizon of one transition is sufficient to determine the optimal action in each state <ref type="bibr">(Knox et al., 2023)</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A.2 PROOF OF CONVERGENCE</head><p>Theorem 1. Assume an unbounded number of preferences generated from a noisy rational regretpreference model with expert advantage function A * . CPL recovers the optimal policy &#960; * .</p><p>Proof. Without loss of generality we let &#945; = 1. For the purposes of this proof only, let &#963; k denote a segment of length k where the state-actions in the segment are denoted by &#963; k = (s 0 , a 0 , s 1 , a 1 , ..., s k-1 , a k-1 ). Let y be the label indicating whether the expert regret preference model prefers &#963; 1 k to &#963; 0 k , i.e., y</p><p>. Let A &#710;= log &#960; &#710;be the implicit estimate of A * learned by CPL. For brevity, we will use the shorthand A(&#963; k ) = &#8721;&#65025; &#963; k &#947; t A(s t , a t ) to denote the discounted sum of advantages of a segment &#963;.</p><p>e A &#710;(&#963; 1 ) +e A &#710;(&#963; 0 ) ) The cross-entropy CPL loss function can be re-written as follows:</p><p>The KL divergence is optimized only when the two distributions are exactly equal. Because the preference model is rational and we assume sufficient representation power and unbounded data, it is possible for the loss to converge to zero by pointwise matching KL-divergence for each two comparisons (See <ref type="bibr">Knox et al. (2022)</ref> for more information specific to the identifiability of regret based preferences). Thus, under the assumption of unbounded data, for all possible segments &#963; 1 k , &#963; 0 k we must have that</p><p>Rearranging, we get:</p><p>) where p &#8712; {0, 1}. We will show that the above equality also holds for all sequences of length k -1. Consider the last action for the segment &#963; 1 k denoted as a 1 k-1 , then:</p><p>Now, we will use the consistency of CPL. Per <ref type="bibr">Ziebart (2010)</ref>, for the optimal value function A * , &#8721;&#65025; a&#8712;A e A * (s,a) = 1, &#8704;s. Because CPL is consistent (Proposition 1), we also have that &#8721;&#65025; a&#8712;A e A &#710;(s,a) = 1, &#8704;s. We use this, in combination with the fact that all possible dynamically feasible segments of length k -1 are a subset of dynamically feasible segments of length k to arrive at:</p><p>Inductively we have that:</p><p>Applying the same argument again, this time for &#963; 0 k , we have</p><p>which is equivalent to A * (s, a) = A &#710;(s, a) &#8704;s, a.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A.3 CONVEXITY OF CPL WITH FINITE DATA</head><p>CPL is convex, but not strictly convex. Here we show that the CPL loss function is convex in log &#960;.</p><p>Consider the logistic regression interpretation of CPL for finite data</p><p>where x i is the "comaprison" vector for the ith comparison in D pref . We can re-write this using matrix notation as:</p><p>The hessian of this objective (logistic regression) with respect to log &#960; is X &#8868; DX, where D is the diagonal matrix such that</p><p>As X &#8868; DX is symmetric, it is guaranteed to be positive semi-definite making the objective function convex. The distributional constraint of CPL, that &#8704;s &#8712; S, &#8747;&#65025; A e log &#960;(a|s) da = 1, is also convex as e log &#960; is convex in log &#960;. Thus, the overall objective is convex. However, this does not imply strict convexity, or that there is a unique solution. X &#8868; DX is only positive definite if it is full rank, which is unlikely to happen in practice as usually |S &#215; A| &gt;&gt; n. This means that the objective is likely not strictly convex in practice, as there can exist more than one minimizer of the objective, formally denoted &#960; &#710;= arg min &#960; L CPL (&#960;, D pref ). To prove that CPL is not always strictly convex, we construct another policy &#960; &#710;&#8242; such that</p><p>First, we demonstrate this on a simple single-state MDP and then provide a general construction for arbitrary MDPs with discrete actions.</p><p>A simple example. Consider a single state MDP with three actions a 1 , a 2 , a 3 and expert reward function r E (s, a i ) = r i where i indexes the actions. It can be shown that, due to the single state nature of this simple MDP, the optimal maximum entropy advantage function is A * (s, a i ) = r i . Consider a preference dataset D pref consisting only of comparisons between segments (s, a 1 ) and (s, a 2 ). According to the regret preference model, the expert labels these preferences according to Bern (&#65025; exp r 1 /(exp r 1 + exp r 2 ) )&#65025; and thus we expect some labels in the preference matrix X to conflict. The finite CPL loss becomes</p><p>where c 1 and c 2 are the number of comparisons where a 1 and a 2 were preferred respectively. By taking the gradient of this objective, it can be shown that the loss is optimized only when logistic</p><p>Intuitively, this makes sense, as the logits are optimized to produce the same ratio of preferences as found in the dataset. However, when we consider the unseen action a 3 , to which we can assign arbitrary probability, the existence of multiple optimizers &#960; &#710;becomes clear. For example, take c 1 = c 2 . By the conditions above its straightforward to see that &#960; &#710;= [0.5, 0.5, 0.0] is an optimum of the CPL loss function. However, &#960; &#710;= [0.1, 0.1, 0.8] achieves the same loss as its difference in log probabilities log &#960;(a 1 |s) -log &#960;(a 2 |s) is the same. If c 2 = 0, or we have no conflicting preferences, &#960; &#710;= [1, 0, 0] and the implied A &#710;= log &#960; &#710;is undefined, implying some of the reward values are infinite. This means we do not have enough data to accurately fit &#960; * . Next, we provide a construction for more general MDPs in the presence of OOD actions.</p><p>A more general construction. Let the expert reward function r E to be bounded. We will interpret the finite preference dataset as a matrix X as described in Section 3.2 and use N (X) to denote the null space of X. For a vector u &#8712; R |S&#215;A| we use u(s, a) to index the vector at state s and action a.</p><p>Assume the following about X:</p><p>1. There exists a vector u &#8712; N (X) such that for state action s, a contained in X, u(s, a) &#824; = 0.</p><p>In other words, the null space is non-trival on the support of D pref .</p><p>2. For every state in the dataset where there is an action such that u(s, a) &#824; = 0, there exists at least one out-of-distribution (OOD) action a OOD not in the dataset. The indicator vector for s, a OOD is thus a basis vector for N (X).</p><p>Let &#960; &#710;be the minima of the CPL loss function. We will construct &#960; &#710;&#8242; as follows. Select a vector u &#8712; N (X) that is non-zero for at least one s, a pair in X. As u &#8712; N (X), we have that L CPL (&#960; &#710;, D pref ) = L CPL (e log &#960; &#710;+u , D pref ). However, e log &#960; &#710;+u violates the policy constraint as it may not integrate to one. We can fix this problem by adding or removing probability mass from the OOD actions we have assumed exist at states where u is non-zero. We do this by constructing another vector v &#8712; N (X) by choosing one a OOD at each state without loss of generality. By examining the total sum of probabilities of the modified policy, &#8704;s &#8712; X, &#8721;&#65026; As v is formed from a linear combination of basis vectors of N (X), v &#8712; N (X). Consequently, L CPL (&#960; &#710;, D pref ) = L CPL (e log &#960; &#710;+u+v , D pref ) and by the above construction &#960; &#710;&#8242; = &#960; &#710;eu+v is a valid policy. This completes the construction.</p><p>We have shown that an infinite number of policies can attain the same optima, just by shifting the amount of probability assigned to OOD actions. For some of these solutions, the entire mode of the policy is potentially out-of-distribution. In the offline setting, the pessimism principle dictates that we should discourage modes that are out-of-distribution. We fix this by introducing regularization.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A.4 CONSERVATIVE BIAS REGULARIZATION</head><p>CPL loss translates a relative weighting between preferences to a policy, but does not employ any mechanism to ensure the learned policy is close to the dataset. In the offline setting, this can be detrimental if the learned policy incorrectly extrapolates to out of distribution actions. A similar approach, under the name of pessimism or conservatism, is commonly seen in offline RL literature <ref type="bibr">(Levine et al., 2020;</ref><ref type="bibr">Jin et al., 2021;</ref><ref type="bibr">Sikchi et al., 2023b)</ref>. As expalined in Section 3.2, we want to learn policies that have a high-probability on the dataset. However, there are many datasets that potentially have the the same loss, as L CPL depends only on the difference in probability for each preference comparison, or &#8721;&#65025; &#963; + &#947; t log &#960;(a t |s t ) -&#8721;&#65025; &#963; -&#947; t log &#960;(a t |s t ), and thus constants added to the log probabilities of each segment cancel. However, we would prefer that a higher loss is given when the policy is assigns lower probability to actions in the dataset.</p><p>To remedy this, we introduced bias regularizer &#955; &#8712; (0, 1) in Section 3, which leads to the modified preference loss:</p><p>]&#65027; .</p><p>Next, we prove that this loss discourages the policy from learning modes that are out-of-distribution, starting with the proposition from the main text.</p><p>Proposition 2. Consider a comparison &#963; + &#8827; &#963; -from D pref and an arbitrary comparison</p><p>Succinctly, this proposition states that if preference comparisons each achieve the same loss, the less likely comparisons under the policy (in this case &#963; &#8242;+ &#8827; &#963; &#8242;-), will have higher regularized CPL loss.</p><p>Essentially, this shows that the regularized objective encourages the policy to have higher likelihood on the provided comparisons than any other potential comparison that exists. Proof. By the stated assumptions, it must be that &#8721;&#65025; &#963; &#8242;+ &#947; t log &#960;(a t |s t ) + &#948; = &#8721;&#65025; &#963; + &#947; t log &#960;(a t |s t ) for some &#948; &gt; 0. As the two comparisons also have the same CPL Loss, their logits must be the same, or</p><p>Consequently, the same &#948; must hold for the negative segments, or &#8721;&#65025; &#963; &#8242;-&#947; t log &#960;(a t |s t ) + &#948; = &#8721;&#65025; &#963; -&#947; t log &#960;(a t |s t ). We can then examine the regularized CPL loss under each comparison. First, we evaluate the finite regularized loss for &#963; + &#8827; &#963; -, algebraically simplified for clarity:</p><p>log &#960;(a t |s t ) exp &#8721;&#65025; &#963; + &#947; t &#945; log &#960;(a t |s t ) + exp &#955; &#8721;&#65025; &#963; -&#947; t &#945; log &#960;(a t |s t ) = -log logistic (&#65028; &#8721;&#65026; &#963; + &#947; t log &#960;(a t |s t ) -&#955; &#8721;&#65026; &#963; - &#947; t log &#960;(a t |s t ) )&#65028; = log (&#65028; 1 + exp (&#65028; &#955; &#8721;&#65026; &#963; - &#947; t log &#960;(a t |s t ) -&#8721;&#65026; &#963; + &#947; t log &#960;(a t |s t )</p><p>)&#65028;)&#65028;</p><p>We can then compare this to the regularized loss for &#963; &#8242;+ &#8827; &#963; &#8242;-.</p><p>The key step in the above is substituting the relationship between the log probabilities of the comparisons. As &#948; &gt; 0 and 0 &lt; &#955; &lt; 1, it can easily be seen that the loss is lower for &#963; + &#8827; &#963; -, letting us conclude that</p><p>We can extend this proposition to the regularized CPL loss over entire datasets as follows:</p><p>For a fixed policy &#960;, consider two preference datasets</p><p>for all i and strictly for at least one i,</p><p>The proof of this amounts to first noticing that, because the preference losses are the same for every ordered subset, the losses for the ith datapoints in D &#8242; n and D n must be the same. Then, we can repeatedly apply Proposition 2. Since the inequality is strict at at-least one datapoint, the regularized loss will be strictly lower.</p><p>We can construct datasets for which this is applicable. For example, consider a dataset D containing a total ordering over n segments, &#963; 1 &#10928; &#963; 2 &#10928; ... &#10928; &#963; n . The unregularized loss for this policy and dataset is L CPL (&#960;, D). We can construct another dataset D &#8242; over a different set of totally ordered segments from anywhere in the state space &#963; &#8242;1 &#10928; &#963; &#8242;2 &#10928; .. &#10928; &#963; &#8242;n such that:</p><p>for all i = 1, 2, ..., n and some &#948; &#8805; 0.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A.5 CPL FOR RANKINGS</head><p>We can derive a version of CPL for ranking data using a Plackett-Luce model <ref type="bibr">(Plackett, 1975)</ref>. We denote the chosen ranking as a permutation &#964; :</p><p>where K is the number of segments presented, &#963; 1 , ..., &#963; K . The Plackett-Luce model under regret based preferences is:</p><p>This model generalizes to <ref type="bibr">Bradley-Terry (Bradley &amp; Terry, 1952)</ref> when K = 2. To learn the optimal policy, we maximize the log likelihood of the above and make the same substitution as CPL, &#945; log &#960; * (a|s) = A * (s, a). This gives us the CPL loss function for rankings, which can be seen as a version of the InfoNCE objective. Without loss of generality, we order the permutations &#964; such that</p><p>]&#65028;</p><p>Except for the sum over k, this is the exact objective from <ref type="bibr">Oord et al. (2018)</ref> where the scores are the discounted sum of log probabilities over the segments.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A.6 DIRECT PREFERENCE OPTIMIZATION AS SPECIAL CASE OF CPL</head><p>Reduction via Maximum Entropy Advantage. Note that by the Bellman equation,</p><p>DPO <ref type="bibr">(Rafailov et al., 2023)</ref> assumes the contextual-bandits setting, thus the MDP terminates after a single step and there is no next state s &#8242; . As we can see from the above, in this setting, A * (s, a) = r E (s, a) -V * (s). DPO also assumes that all preferences start from the same state s, and thus only actions a + and a -differ. This is consistent with RLHF on LLMs as humans score "responses" to fixed prompts.</p><p>The regret preference model becomes:</p><p>which is the same preference model used in DPO. From here the same conservative derivation as DPO can be applied by noting that, for KL-constrained contextual bandits, &#960; * (a|s) = &#181;(a|s)e Q * (s,a)-V * (s) = &#181;(a|s)e r E (s,a)-V * (s) for reference distribution &#181;. Solving for r E , we can perform a substitution just like in CPL to arrive at the DPO objective.</p><p>CPL under Constrained Regret Preferences. We can also consider a setting where users provide preferences constrained to a reference distribution &#181;. This might arise in scenarios where users are only shown a fixed set of behaviors, and do not extrapolate far beyond them. Though we do not believe this premise has previously been considered, it leads to an interesting result. Assume preferences to be distributed according to the KL constrained advantage function. In this setting, &#960; * (a|s) = &#181;(a|s)e A * (s,a) and by substitution the CPL loss becomes</p><p>which is essentially a multi-step generalization of DPO which has not previously been considered. In the next section, we expand on this as a variant of CPL.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B VARIANTS OF CPL</head><p>In the main body of the paper, we presented the version of CPL which we found to consistently attain good performance. In some of our experiments, we also considered two other variants of CPL. We detail these below.</p><p>BC-Regularized CPL. Instead of using our biased conservative regularization from An et al. ( <ref type="formula">2023</ref>), we consider using a simple BC regularizer. This can be derived by considering the objective: We refer to this method as CPL (BC).</p><p>KL Constrained CPL. We can also consider the setting where preferences are assumed to be distributed according to the constrained advantage function. Though in practice we sample preferences according to the maximum entropy advantage function, we found this approach to still work in many settings. First, we learn the reference distribution &#181; using behavior cloning. Then, we use constrained CPL with bias regularization, making the final loss function:</p><p>We refer to this method as CPL (KL).</p><p>CPL with Dense Preferences. When learning from "dense" preference data, it is possible to augment the batch to include more comparisons using the transitive property. Specifically, given a batch of b segments, we compute all possible pairwise comparisons within a batch:</p><p>This provides as much contrastive signal per-batch as possible. We applied this technique to our CPL experiments with images, and found that it lead to a slight increase in performance for some tasks.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C EXTENDED RESULTS</head><p>In this section we provide our full experimental results:</p><p>1. Learning curves from state for CPL, baselines, and variants described in Appendix B.</p><p>2. Learning curves from images for CPL and baselines.</p><p>3. Scaling results for CPL and P-IQL with different sized dense datasets and fixed sparse datasets with a varying number of comparisons.</p><p>4. Results when varying the number of comparisons for a fixed dataset.</p><p>5. More Hyper-parameter ablations, include temperature and pretraining. 100000 200000 300000 400000 500000 0.0 0.2 0.4 0.6 0.8 Success Rate Bin Picking 100000 200000 300000 400000 500000 0.0 0.1 0.2 0.3 0.4 Button Press 100000 200000 300000 400000 500000 0.5 0.6 0.7 0.8 0.9 Door Open 100000 200000 300000 400000 500000 Training Steps 0.5 0.6 0.7 0.8 0.9 Success Rate Drawer Open 100000 200000 300000 400000 500000 Training Steps 0.3 0.4 0.5 0.6 Plate Slide 100000 200000 300000 400000 500000 Training Steps 0.4 0.5 0.6 0.7 0.8 Sweep Into MetaWorld State 20K Sparse SFT P-IQL PPO CPL (BC) CPL (KL) CPL We find that for these results, P-IQL's performance sometimes goes down. Inspecting our training logs reveals that this is likely due to the reward function underfitting. For example, on Door Open, the reward modeling loss is near zero with only 2 comparisons per segment (10K comparisons total, which is the amount we tuned our hyper-parameters for). With 16 comparisons per segment, the loss ends near 0.16. This highlights an additional limitation of P-IQL: it requires tuning an addition reward model, which can be very sensitive to its training parameters. CPL removes this additional complexity, and is thus easier to scale.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>Note that we assume that all states are reachable and therefore have support in &#961; t &#960; (s) for any optimal MaxEnt policy.</p></note>
		</body>
		</text>
</TEI>
