Introduction
Large Language Models (LLMs) (Singh et al., 2025; Team et al., 2023; Liu et al., 2024a) have demonstrated remarkable capabilities across a wide range of domains, including summarization (Stiennon et al., 2020; Ziegler et al., 2019; Koh et al., 2022), conversational assistance (Ouyang et al., 2022; Touvron et al., 2023), and complex reasoning [7 , 33 , 13 ] (Köster et al. 2026). As LLMs are increasingly deployed in real-world applications with broad societal impact, it is crucial to ensure that their responses do not contain harmful or toxic content, such as discrimination [34 , 26 ] (Weidinger et al. 2021), or violate social norms [8 , 32 , 9 ] . To this end, recent work [23 ] (Liu et al. 2024c; Liu et al. 2026b; Zhang et al. 2026) has extended the standard fine-tuning framework of Reinforcement Learning from Human Feedback (RLHF) by incorporating safety constraints that limit the expected harmfulness of model outputs. However, expectation-based safety constraints primarily control average behavior. As a result, highly safe responses can offset harmful ones in expectation, leaving the low-probability tail of generations still vulnerable to rare but severe harmful outputs.
To address this issue, Risk-Averse RLHF (RA-RLHF) [12 ] introduces risk aversion into LLM fine-tuning. RA-RLHF adopts Conditional Value-at-Risk (CVaR) [39 ] (Tamar et al. 2015a) to directly optimize rare high-risk generations rather than average response quality, making it particularly suitable for LLM safety alignment in high-stakes applications, such as medical advice (Yang et al., 2022; Moor et al., 2023), legal assistance (Katz et al., 2024), and disaster management [37 , 14 , 29 ] (Liu et al. 2026a), where even a small probability of severe harmful output may be unacceptable. The degree of risk aversion in CVaR is controlled by the risk level α ∈ ( 0 , 1 ] \alpha\in(0, 1] α ∈ ( 0 , 1 ] , which determines the fraction of worst-case outcomes used to evaluate the policy. A smaller α \alpha α concentrates on more extreme rare failures. In contrast, a larger α \alpha α considers a broader portion of the output distribution and behaves closer to average harm, which is appropriate for lower-risk applications such as casual conversation (Ouyang et al., 2022; Touvron et al., 2023) or creative writing [27 ] (Xie et al. 2023), where overly conservative behavior can unnecessarily reduce helpfulness or diversity. Therefore, the choice of risk level plays a central role in determining the behavior of the aligned policy.
However, selecting an appropriate α \alpha α is challenging because there is unlikely to be a universal risk level that works well across all applications and users ((Yoo et al., 2024)). Different deployment scenarios may require different degrees of conservativeness, and individual users may also have different preferences over the trade-off between safety and utility ([1 , 2 , 5 ] ). Existing methods, such as RA-RLHF, train the policy for a fixed risk level, and therefore do not provide a mechanism for adjusting the desired degree of risk aversion at inference time. A naive solution is to train and deploy multiple policies, one for each target risk level. However, this requires repeated training and storing multiple model instances, which is computationally expensive and may be impractical in resource-limited settings ([36 ] (Wang et al. 2024c)).
In this paper, we propose risk-conditioned RLHF (Figure 1 ), which trains a single policy that can be steered across a continuum of risk levels within a deployment interval at inference time. To do this, we condition the policy π \pi π on both the prompt x x x and the desired risk level α ∈ [ α min , α max ] \alpha\in[\alpha_{\min}, \alpha_{\max}] α ∈ [ α m i n , α m a x ] , producing responses Y ∼ π ( ⋅ ∣ x , α ) Y \sim\pi(\cdot\mid x, \alpha) Y ∼ π ( ⋅ ∣ x , α ) . We formulate this as a risk-conditioned RLHF optimization problem, where training is performed over a distribution of risk levels p ( α ) p(\alpha) p ( α ) . As a result, the learned policy provides a continuous risk-control interface: users can select the desired degree of risk aversion at inference time without retraining or deploying multiple risk-specific models. To optimize this objective,
Figure 1. Risk-conditioned RLHF pipeline compared to prior risk-averse RLHF method. Existing risk-averse RLHF methods do not support inference-time adjustment. In contrast, our method trains a single policy over risk levels. At inference time, the same policy can be steered by selecting α \alpha α , enabling continuous control over the degree of risk aversion without retraining or deploying multiple models.
we propose a risk-conditioned policy gradient algorithm (Algorithm 1), provide convergence analysis (Theorem 2), and present additional analysis showing that the resulting policy yields a uniform approximation of the risk frontier (Theorem 3). To instantiate the risk-conditioned policy, we further study how the risk level α \alpha α should be injected into the LLM (Figure 2 ). Inspired by recent work on multi-objective fine-tuning ((Wang et al., 2024b; Rame et al., 2023)), we consider both prompt-based conditioning, which represents α \alpha α as part of the input text, and parameter-based conditioning, which injects α \alpha α directly into selected model parameters. Empirically, we find that explicit parameter-level conditioning provides more reliable risk control than natural-language prompting. Experiments across multiple benchmarks show that the proposed risk-conditioned policy can closely match the performance of policies trained specifically for individual risk levels, while using only a single deployable model. More importantly, the learned policy remains steerable at risk levels not observed within the training interval, achieving competitive or stronger tail-risk performance than baselines such as inference-time prompting, multiple fixed-risk policies and logit-mixing policy (§ 4.3 ).
Figure 2. Illustration of the three risk-conditioning mechanisms studied in this work.
In summary, our contributions are: 1. We introduce the risk-conditioned RLHF framework, where a single language model is trained to adapt to different CVaR risk levels at inference time. This formulation avoids training and deploying separate policies for different target risk levels while retaining an explicit risk interpretation. 2. We propose a risk-conditioned policy gradient algorithm for the proposed framework, provide convergence analysis, and show that the resulting policy leads to uniform approximation over the risk frontier. 3. Extensive experiments with Pythia-70M (§ 4 ), Pythia-2.8B model (Appendix § 10 .§ 1 ), and Llama-3.1-8B-Instruct (Appendix § 10 .§ 2 ) show that our risk-conditioned policy achieves performance comparable to risk-specific policies trained at individual risk levels, while offering better inference-time steerability.
Preliminary
Reinforcement Learning from Human Feedback (RLHF). RLHF is a widely used technique for aligning LLMs with human preferences and typically consists of three stages ((Ziegler et al., 2019)). The first stage is supervised fine-tuning (SFT), where a LLM is fine-tuned on a high-quality dataset. In the second stage, the SFT model is prompted with x ∈ X x \in\mathcal{X} x ∈ X , where X \mathcal{X} X is a finite context space, and generates multiple responses y i ∈ Y y_i \in\mathcal{Y} y i ∈ Y , where Y \mathcal{Y} Y is a finite completion space. These responses are then presented to human annotators, who provide preference labels. A reward model r ( x , y ) r(x,y) r ( x , y ) is subsequently trained from these preference comparisons. The third stage is policy optimization, where the learned reward model provides feedback for further fine-tuning the SFT model. In particular, let π ∈ Δ Y \pi\in\Delta^{\mathcal{Y}} π ∈ Δ Y denote an LLM policy that maps each prompt x x x to a discrete probability distribution π ( ⋅ ∣ x ) ∈ Δ Y \pi(\cdot|x) \in\Delta_{\mathcal{Y}} π ( ⋅ ∣ x ) ∈ Δ Y , where Δ Y \Delta_{\mathcal{Y}} Δ Y is the set of discrete distributions over Y \mathcal{Y} Y . The standard RLHF objective optimizes a policy π \pi π to maximize the expected reward while regularizing its deviation from a reference policy π r e f \pi_{\mathrm{ref}} π ref through a KL-divergence penalty: E x ∼ D , y ∼ π ( ⋅ ∣ x ) [ r ( x , y ) ] − β KL ( π ∥ π r e f ) \mathbb{E}_{x\sim D,y\sim\pi(\cdot|x)}[r(x,y)]-\beta\operatorname{KL}(\pi\|\pi_{\mathrm{ref}}) E x ∼ D , y ∼ π ( ⋅ ∣ x ) [ r ( x , y )] − β KL ( π ∥ π ref ) , where D D D is a dataset of prompts, and KL ( π ∥ π r e f ) = E x ∼ D , y ∼ π ( ⋅ ∣ x ) [ log π ( y ∣ x ) π r e f ( y ∣ x ) ] \operatorname{KL}(\pi\|\pi_{\mathrm{ref}})=\mathbb{E}_{x\sim D,y\sim\pi(\cdot|x)}\left[\log\frac{\pi(y|x)}{\pi_{\mathrm{ref}}(y|x)}\right] KL ( π ∥ π ref ) = E x ∼ D , y ∼ π ( ⋅ ∣ x ) [ log π ref ( y ∣ x ) π ( y ∣ x ) ] . Equivalently, the RLHF objective can be written as E x ∼ D , y ∼ π ( ⋅ ∣ x ) [ r ( x , y ) − β log π ( y ∣ x ) π r e f ( y ∣ x ) ] \mathbb{E}_{x\sim D,y\sim\pi(\cdot|x)}\left[r(x,y)-\beta\log\frac{\pi(y|x)}{\pi_{\mathrm{ref}}(y|x)}\right] E x ∼ D , y ∼ π ( ⋅ ∣ x ) [ r ( x , y ) − β log π ref ( y ∣ x ) π ( y ∣ x ) ] . We define G ( x , y ) : = r ( x , y ) − β log π ( y ∣ x ) π r e f ( y ∣ x ) G(x,y):=r(x,y)-\beta\log\frac{\pi(y|x)}{\pi_{\mathrm{ref}}(y|x)} G ( x , y ) := r ( x , y ) − β log π ref ( y ∣ x ) π ( y ∣ x ) as the regularized reward. In this work, we focus only on the third stage.
Conditional Value-at-risk (CVaR). CVaR has recently been introduced as a risk-sensitive criterion for evaluating learned policies ([12 ] ). While the expected value in the standard RLHF objective measures the average performance of a policy, CVaR focuses on tail behavior and captures how the policy performs under unfavorable outcomes ([18 ] ). Formally, let Z Z Z be an integrable random variable. For a risk level α ∈ ( 0 , 1 ] \alpha\in(0,1] α ∈ ( 0 , 1 ] , the value-at-risk (VaR) of Z Z Z is defined as: VaR α ( Z ) = min { z ∣ F ( z ) ≥ α } \operatorname{VaR}_{\alpha}(Z)=\min\{z \mid F(z)\ge\alpha\} VaR α ( Z ) = min { z ∣ F ( z ) ≥ α } , where F ( z ) = P ( Z ≤ z ) F(z)=\mathbb{P}(Z\le z) F ( z ) = P ( Z ≤ z ) is the cumulative distribution function (CDF). VaR α ( Z ) \operatorname{VaR}_{\alpha}(Z) VaR α ( Z ) is the threshold below which approximately an α \alpha α -fraction of outcomes fall. CVaR then measures the average value of Z Z Z in this lower tail as CVaR α ( Z ) = E z ∼ Z { z ∣ z ≤ VaR α ( Z ) } \operatorname{CVaR}_{\alpha}(Z)=\mathbb{E}_{z\sim Z}\{z\mid z\le\operatorname{VaR}_{\alpha}(Z)\} CVaR α ( Z ) = E z ∼ Z { z ∣ z ≤ VaR α ( Z )} . A useful variational characterization of CVaR is given by ([20 ] (Rockafellar et al. 2000)):
CVaR α ( Z ) = max η ∈ R { η − 1 α E [ ( η − Z ) + ] } (1) \operatorname{CVaR}_{\alpha}(Z)=\max_{\eta\in\mathbb{R}}\left\{\eta-\frac{1}{\alpha}\mathbb{E}\left[(\eta-Z)_{+}\right]\right\} \tag*{(1)} CVaR α ( Z ) = η ∈ R max { η − α 1 E [ ( η − Z ) + ] } (1)
where ( ⋅ ) + = max ( ⋅ , 0 ) (\cdot)_{+}=\max(\cdot,0) ( ⋅ ) + = max ( ⋅ , 0 ) . In this formulation, η \eta η plays the role of a learnable tail threshold, and the penalty term ( η − Z ) + (\eta-Z)_{+} ( η − Z ) + emphasizes samples whose outcomes fall below this threshold. While CVaR is often formulated as minimizing upper-tail costs, we adopt the equivalent reward-maximization formulation appropriate for RLHF and use this variational form for optimization.
Risk-Averse RLHF. To improve the tail performance of RLHF policies, ([12 ] ) incorporates CVaR into the standard RLHF objective. Instead of maximizing the average regularized reward over all sampled responses, risk-averse RLHF optimizes the average performance over the worst α \alpha α -fraction of responses. Formally, for a fixed risk level α \alpha α , the objective is to find a policy π ⋆ \pi^{\star} π ⋆ that solves max π E x ∼ D [ CVaR α ( G ( x , Y ) ) ] \max_{\pi}\mathbb{E}_{x\sim D}[\operatorname{CVaR}_{\alpha}(G(x,Y))] max π E x ∼ D [ CVaR α ( G ( x , Y ))] , where Y ∼ π ( ⋅ ∣ x ) Y\sim\pi(\cdot|x) Y ∼ π ( ⋅ ∣ x ) . Here, for each prompt x x x , G ( x , Y ) G(x,Y) G ( x , Y ) is a random variable induced by sampling a response from the policy, and CVaR α ( G ( x , Y ) ) \operatorname{CVaR}_{\alpha}(G(x,Y)) CVaR α ( G ( x , Y )) measures the expected regularized reward among the worst α \alpha α -fraction of responses. Thus, the objective encourages the policy to avoid low-reward tail responses. We include a detailed related work on risk-conditioned RL, risk averseness in LLMs, and multi-objective finetuning in Appendix § 6 .
Risk-conditioned RLHF
This section presents our risk-conditioned RLHF framework. We first formalize the risk-conditioned RLHF problem in § 3.1 . We then introduce a risk-conditioned policy gradient algorithm for optimizing the proposed problem in § 3.2 . Finally, in § 3.3 , we describe several practical mechanisms for instantiating risk-conditioned policies by injecting the risk level α \alpha α into LLMs.
Problem Formulation
Our goal is to learn a single policy that can adapt to different risk levels at inference time. Instead of training a separate risk-averse policy for each fixed α \alpha α , we augment the policy with α \alpha α as an additional conditioning input together with the prompt x x x . Formally, we define a risk-conditioned policy as π : X × ( 0 , 1 ] ⟶ Δ Y \pi:\mathcal{X}\times(0,1]\longrightarrow\Delta_{\mathcal{Y}} π : X × ( 0 , 1 ] ⟶ Δ Y , where π ( ⋅ ∣ x , α ) \pi(\cdot\mid x,\alpha) π ( ⋅ ∣ x , α ) denotes the response distribution for prompt x x x under risk level α \alpha α . Given Y ∼ π ( ⋅ ∣ x , α ) Y\sim\pi(\cdot\mid x,\alpha) Y ∼ π ( ⋅ ∣ x , α ) , we write the corresponding regularized reward as G ( x , Y ; α ) G(x,Y;\alpha) G ( x , Y ; α ) , emphasizing that both the sampled response and the KL-regularized reward are induced by the α \alpha α -conditioned policy. We define the risk-conditioned RLHF objective as
max π E α ∼ p ( α ) E x ∼ D [ CVaR α ( G ( x , Y ; α ) ) ] (2) \max_{\pi}\mathbb{E}_{\alpha\sim p(\alpha)}\mathbb{E}_{x\sim\mathcal{D}}\left[\operatorname{CVaR}_{\alpha}(G(x,Y;\alpha))\right] \tag*{(2)} π max E α ∼ p ( α ) E x ∼ D [ CVaR α ( G ( x , Y ; α )) ] (2)
where p ( α ) p(\alpha) p ( α ) is a distribution supported on a risk interval [ α min , α max ] ⊂ ( 0 , 1 ] [\alpha_{\min},\alpha_{\max}]\subset(0,1] [ α m i n , α m a x ] ⊂ ( 0 , 1 ] . For each sampled α ∈ [ α min , α max ] \alpha\in[\alpha_{\min},\alpha_{\max}] α ∈ [ α m i n , α m a x ] , the policy π ( ⋅ ∣ x , α ) \pi(\cdot\mid x,\alpha) π ( ⋅ ∣ x , α ) is optimized to improve the average regularized reward among the worst α \alpha α -fraction of responses for each prompt. By training over α ∼ p ( α ) \alpha\sim p(\alpha) α ∼ p ( α ) , the resulting policy learns a continuous risk-control interface, allowing the desired level of risk aversion to be selected at inference time without training.
Risk-conditioned Policy Gradient
A direct way to optimize (2) is to sample risk levels and apply an existing fixed-α \alpha α risk-averse method to the conditioned policy. For example, RA-RLHF ([12 ] ) estimates the CVaR objective by ranking sampled trajectories according to their rewards and updating the policy using low-reward tail samples. Although this method provides a practical way to estimate risk aversion, it relies on empirical tail selection, which is difficult to characterize the resulting optimization error. To learn a continuous risk-control interface and obtain an analyzable optimization procedure, we instead use the variational form of CVaR in (1) . Specifically, we treat η \eta η as an optimizable tail threshold, which allows us to develop a gradient-based method for jointly updating the risk-conditioned policy and the threshold predictor. Formally, we parameterize the tail threshold by a neural network η ω ( x , α ) \eta_{\omega}(x,\alpha) η ω ( x , α ) and the risk-conditioned policy by π θ ( ⋅ ∣ x , α ) \pi_{\theta}(\cdot\mid x,\alpha) π θ ( ⋅ ∣ x , α ) . We then define
J ( θ , ω ) : = E α , x [ η ω ( x , α ) − 1 α E Y ∼ π θ ( η ω ( x , α ) − G ( x , Y ; α ) ) + ] . \mathcal{J}(\theta,\omega):=\mathbb{E}_{\alpha,x}\left[\eta_{\omega}(x,\alpha)-\frac{1}{\alpha}\mathbb{E}_{Y\sim\pi_{\theta}}\left(\eta_{\omega}(x,\alpha)-G(x,Y;\alpha)\right)_{+}\right]. J ( θ , ω ) := E α , x [ η ω ( x , α ) − α 1 E Y ∼ π θ ( η ω ( x , α ) − G ( x , Y ; α ) ) + ] .
Under (1) , optimizing the risk-conditioned objective in (2) leads to the parameterized optimization problem max θ , ω J ( θ , ω ) \max_{\theta,\omega}\mathcal{J}(\theta,\omega) max θ , ω J ( θ , ω ) . We next derive the gradients of J ( θ , ω ) \mathcal{J}(\theta,\omega) J ( θ , ω ) with respect to the policy parameters θ \theta θ and the threshold parameters ω \omega ω .
Theorem 1. The gradients of J ( θ , ω ) \mathcal{J}(\theta,\omega) J ( θ , ω ) for our proposed risk-conditioned RLHF objective can be computed as follows:
∇ ω J ( θ , ω ) = E α , x , Y ∼ π θ [ ( 1 − 1 α 1 { G ≤ η ω } ) ∇ ω η ω ] (3) \nabla_{\omega}\mathcal{J}(\theta,\omega)
=
\mathbb{E}_{\alpha,x,Y\sim\pi_{\theta}}\left[\left(1-\frac{1}{\alpha}\mathbf{1}\{G\leq\eta_{\omega}\}\right)\nabla_{\omega}\eta_{\omega}\right] \tag*{(3)} ∇ ω J ( θ , ω ) = E α , x , Y ∼ π θ [ ( 1 − α 1 1 { G ≤ η ω } ) ∇ ω η ω ] (3) ∇ θ J ( θ , ω ) = E α , x , Y ∼ π θ [ ( u θ , ω ( x , Y , α ) − β α 1 { G ≤ η ω } ) ∇ θ log π θ ] . (4) \nabla_{\theta}\mathcal{J}(\theta,\omega)
=
\mathbb{E}_{\alpha,x,Y\sim\pi_{\theta}}\left[\left(u_{\theta,\omega}(x,Y,\alpha)-\frac{\beta}{\alpha}\mathbf{1}\{G\leq\eta_{\omega}\}\right)\nabla_{\theta}\log\pi_{\theta}\right]. \tag*{(4)} ∇ θ J ( θ , ω ) = E α , x , Y ∼ π θ [ ( u θ , ω ( x , Y , α ) − α β 1 { G ≤ η ω } ) ∇ θ log π θ ] . (4) where u θ , ω ( x , Y , α ) = η ω ( x , α ) − 1 α ( η ω ( x , α ) − G ( x , Y ; α ) ) + u_{\theta,\omega}(x,Y,\alpha)=\eta_{\omega}(x,\alpha)-\frac{1}{\alpha}\left(\eta_{\omega}(x,\alpha)-G(x,Y;\alpha)\right)_{+} u θ , ω ( x , Y , α ) = η ω ( x , α ) − α 1 ( η ω ( x , α ) − G ( x , Y ; α ) ) + , and 1 { ⋅ } \mathbf{1}\{\cdot\} 1 { ⋅ } is the indicator function.
The proof is deferred to Appendix § 7 .§ 1 . In practice, the exact gradient (3) and (4) are unavailable and can only be estimated via stochastic samples. We refer the details to Appendix § 7 .§ 2 . Specifically, given a batch { ( x b , α b ) } b = 1 B \{(x_b,\alpha_b)\}_{b=1}^{B} {( x b , α b ) } b = 1 B , where B B B is the batch size, we sample N N N responses y b , 1 , … , y b , N ∼ π θ ( ⋅ ∣ x b , α b ) y_{b,1},\ldots,y_{b,N}\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b) y b , 1 , … , y b , N ∼ π θ ( ⋅ ∣ x b , α b ) for each prompt risk pair. We then construct stochastic estimators g ^ ω ( θ , ω ) \hat{g}_{\omega}(\theta,\omega) g ^ ω ( θ , ω ) and g ^ θ ( θ , ω ) \hat{g}_{\theta}(\theta,\omega) g ^ θ ( θ , ω ) to approximate ∇ ω J ( θ , ω ) \nabla_{\omega}\mathcal{J}(\theta,\omega) ∇ ω J ( θ , ω ) and ∇ θ J ( θ , ω ) \nabla_{\theta}\mathcal{J}(\theta,\omega) ∇ θ J ( θ , ω ) , respectively. Moreover, we show that their estimation errors decrease on the order of O ( 1 B N + 1 B ) \mathcal{O}\left(\frac{1}{BN}+\frac{1}{B}\right) O ( B N 1 + B 1 ) , which vanishes as the batch size B B B and the number of completions N N N become large.
We describe our risk-conditioned policy gradient algorithm in Algorithm 1. Each training round t = 1 , 2 , … , T t=1,2,\ldots,T t = 1 , 2 , … , T proceeds as follows. We first sample a batch of prompts x b x_b x b and risk levels α b \alpha_b α b (Lines 2–3). For each prompt risk pair ( x b , α b ) (x_b,\alpha_b) ( x b , α b ) , we condition the policy on α b \alpha_b α b and sample completions y b , n ∼ π θ ( ⋅ ∣ x b , α b ) y_{b,n}\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b) y b , n ∼ π θ ( ⋅ ∣ x b , α b ) (Line 5). We then compute the threshold network prediction, regularized return, and other quantities needed for the stochastic gradient estimators (Lines 6–8). Next, we estimate the stochastic gradients for both the threshold network and the policy (Line 11). Finally, we update ω \omega ω and θ \theta θ by gradient ascent (Lines 12–13). The policy update is written in a generic policy-gradient form and can be implemented using standard RLHF optimization methods, such as REINFORCE (Williams, 1992; [6 ] )
Algorithm 1 Risk-conditioned Policy Gradient
Require: Prompt dataset D \mathcal{D} D , reward model r r r , reference policy π r e f \pi_{\mathrm{ref}} π ref , initial risk-conditioned policy π θ \pi_{\theta} π θ , threshold network η ω \eta_{\omega} η ω , KL coefficient β \beta β , batch size B B B , samples per prompt N N N , CVaR sampling distribution p ( α ) p(\alpha) p ( α ) , learning rates γ θ , γ ω \gamma_{\theta}, \gamma_{\omega} γ θ , γ ω , iteration number T T T
for t = 1 , 2 , … , T t = 1,2,\ldots,T t = 1 , 2 , … , T do
Sample prompts x 1 , … , x B ∼ D x_1,\ldots,x_B \sim\mathcal{D} x 1 , … , x B ∼ D
Sample risk levels α 1 , … , α B ∼ p ( α ) \alpha_1,\ldots,\alpha_B \sim p(\alpha) α 1 , … , α B ∼ p ( α ) , where α b ∈ [ α min , α max ] \alpha_b \in[\alpha_{\min},\alpha_{\max}] α b ∈ [ α m i n , α m a x ]
for b = 1 , … , B b = 1,\ldots,B b = 1 , … , B do
Sample completions y b , 1 , … , y b , N ∼ π θ ( ⋅ ∣ x b , α b ) y_{b,1},\ldots,y_{b,N} \sim\pi_{\theta}(\cdot\mid x_b,\alpha_b) y b , 1 , … , y b , N ∼ π θ ( ⋅ ∣ x b , α b )
Compute threshold prediction η ω ( x b , α b ) \eta_{\omega}(x_b,\alpha_b) η ω ( x b , α b )
for n = 1 , … , N n = 1,\ldots,N n = 1 , … , N do
Compute the utility quantity u θ , ω ( x b , y b , n , α b ) = η ω ( x b , α b ) − 1 α b ( η ω ( x b , α b ) − G ( x b , y b , n ; α b ) ) + , u_{\theta,\omega}(x_b,y_{b,n},\alpha_b) = \eta_{\omega}(x_b,\alpha_b) - \frac{1}{\alpha_b}\left(\eta_{\omega}(x_b,\alpha_b)-G(x_b,y_{b,n};\alpha_b)\right)_{+}, u θ , ω ( x b , y b , n , α b ) = η ω ( x b , α b ) − α b 1 ( η ω ( x b , α b ) − G ( x b , y b , n ; α b ) ) + , where G ( x b , y b , n ; α b ) = r ( x b , y b , n ) − β log π θ ( y b , n ∣ x b , α b ) π r e f ( y b , n ∣ x b ) G(x_b,y_{b,n};\alpha_b) = r(x_b,y_{b,n})-\beta\log\frac{\pi_{\theta}(y_{b,n}\mid x_b,\alpha_b)}{\pi_{\mathrm{ref}}(y_{b,n}\mid x_b)} G ( x b , y b , n ; α b ) = r ( x b , y b , n ) − β log π ref ( y b , n ∣ x b ) π θ ( y b , n ∣ x b , α b ) .
end for
end for
Estimate the stochastic gradients g ^ ω ( θ , ω ) \hat{g}_{\omega}(\theta,\omega) g ^ ω ( θ , ω ) and g ^ θ ( θ , ω ) \hat{g}_{\theta}(\theta,\omega) g ^ θ ( θ , ω ) using u θ , ω ( x b , y b , n , α b ) u_{\theta,\omega}(x_b,y_{b,n},\alpha_b) u θ , ω ( x b , y b , n , α b ) and G ( x b , y b , n ; α b ) G(x_b,y_{b,n};\alpha_b) G ( x b , y b , n ; α b )
Update the threshold network by gradient ascent: ω ← ω + γ ω g ^ ω ( θ , ω ) \omega\leftarrow\omega+ \gamma_{\omega}\hat{g}_{\omega}(\theta,\omega) ω ← ω + γ ω g ^ ω ( θ , ω )
Update the policy by gradient ascent: θ ← θ + γ θ g ^ θ ( θ , ω ) \theta\leftarrow\theta+ \gamma_{\theta}\hat{g}_{\theta}(\theta,\omega) θ ← θ + γ θ g ^ θ ( θ , ω )
end for
or PPO (Schulman et al., 2017). Next, we state the convergence result of Algorithm 1.
Theorem 2. Under the assumptions stated in Appendix § 7 .§ 3 , Algorithm 1 converges to a nonsmooth stationary point of (2) . Moreover, with a constant step size γ ω = γ θ = Θ ( T − 1 / 2 ) \gamma_{\omega} = \gamma_{\theta} = \Theta(T^{-1/2}) γ ω = γ θ = Θ ( T − 1/2 ) , its stationarity error satisfies O ( T − 1 / 2 ) ( 1 + 1 B N + 1 B ) O(T^{-1/2})\left(1+\frac{1}{BN}+\frac{1}{B}\right) O ( T − 1/2 ) ( 1 + B N 1 + B 1 ) .
The formal statement and proof are deferred to Appendix § 7 .§ 3 . We further show that strong performance of the policy learned by Algorithm 1 on the training risk levels leads to a uniform approximation over the entire risk frontier.
Theorem 3. Let A h = { α 1 , … , α K } \mathcal{A}_h = \{\alpha_1,\ldots,\alpha_K\} A h = { α 1 , … , α K } be a grid of all training risk levels with mesh size h = max i ( α i + 1 − α i ) h = \max_i(\alpha_{i+1}-\alpha_i) h = max i ( α i + 1 − α i ) . Define the CVaR α \operatorname{CVaR}_{\alpha} CVaR α value of π θ \pi_{\theta} π θ as V ( θ , α ) : = E x ∼ D [ CVaR α ( G ( x , Y ; α ) ) ] , Y ∼ π θ ( ⋅ ∣ x , α ) \mathcal{V}(\theta,\alpha) := \mathbb{E}_{x\sim\mathcal{D}}\left[\operatorname{CVaR}_{\alpha}(G(x,Y;\alpha))\right], Y \sim\pi_{\theta}(\cdot\mid x,\alpha) V ( θ , α ) := E x ∼ D [ CVaR α ( G ( x , Y ; α )) ] , Y ∼ π θ ( ⋅ ∣ x , α ) . The optimal CVaR frontier is then defined as V ⋆ ( α ) : = sup θ V ( θ , α ) \mathcal{V}^{\star}(\alpha) := \sup_{\theta}\mathcal{V}(\theta,\alpha) V ⋆ ( α ) := sup θ V ( θ , α ) . Under assumptions detailed in Appendix § 7 .§ 3 , if the learned conditioned policy is ϵ \epsilon ϵ -suboptimal on the grid, then
sup α ∈ [ α min , α max ] ( V ⋆ ( α ) − V ( θ ^ , α ) ) ≤ ϵ + 2 L h , \sup_{\alpha\in[\alpha_{\min},\alpha_{\max}]}\left(\mathcal{V}^{\star}(\alpha)-\mathcal{V}(\hat{\theta},\alpha)\right)\leq\epsilon+2Lh, α ∈ [ α m i n , α m a x ] sup ( V ⋆ ( α ) − V ( θ ^ , α ) ) ≤ ϵ + 2 L h , where L L L is a constant detailed in Theorem 7 .
The proof is given in Appendix § 7 .§ 3 . Theorem 3 shows that the error for unseen risk levels within the risk interval [ α min , α max ] [\alpha_{\min},\alpha_{\max}] [ α m i n , α m a x ] has two sources: the optimization error on the observed risk levels and the grid-coverage error 2 L h 2Lh 2 L h , which decreases as the training risk grid becomes denser. We empirically examine this grid-coverage effect in Appendix § 10 .§ 4 .
Conditioning Mechanisms
We now describe the parameter-based mechanism used to instantiate the risk-conditioned policy π θ ( ⋅ ∣ x , α ) \pi_{\theta}(\cdot\mid x,\alpha) π θ ( ⋅ ∣ x , α ) in Algorithm 1. Our design follows the general idea of multi-objective finetuning (Wang et al., 2024b; Rame et al., 2023). Let S \mathcal{S} S denote the subset of policy parameters selected for conditioning, and let S C \mathcal{S}^{C} S C denote the remaining parameters. The parameters in S C \mathcal{S}^{C} S C are shared across all risk levels. For the conditioned subset S \mathcal{S} S , we keep the base parameters of the original policy θ r e f \theta^{\mathrm{ref}} θ ref and K K K sets of conditioned parameters { Δ θ S k } k = 1 K \{\Delta\theta_{\mathcal{S}}^{k}\}_{k=1}^{K} { Δ θ S k } k = 1 K . To condition on the CVaR risk level α \alpha α , we use a small trainable gating network with parameters θ S g a t e \theta_{\mathrm{Sgate}} θ Sgate mapping the risk level α \alpha α to mixture weights m α = ( m α 1 , … , m α K ) m_{\alpha}=(m_{\alpha}^{1},\ldots,m_{\alpha}^{K}) m α = ( m α 1 , … , m α K ) . Unlike prior works (Wang et al., 2024b; Rame et al., 2023), where the conditioning variables are reward-weight vectors with a direct multi-objective interpretation, the CVaR risk level α \alpha α controls the tail fraction of the objective and affects the optimization nonlinearly, especially when α \alpha α is small.
We therefore learn the mapping from α \alpha α to mixture weights, rather than treating α \alpha α itself as a fixed coefficient. The effective conditioned parameter is then θ S = θ r e f + ∑ k = 1 K m k α Δ θ k \theta_{\mathcal{S}} = \theta_{\mathrm{ref}} + \sum_{k=1}^{K} m_k^\alpha\Delta\theta_k θ S = θ ref + ∑ k = 1 K m k α Δ θ k . Concatenating the conditioned subset and the gating network with the shared unconditioned parameters gives the full parameter θ α = θ S α ⊕ θ S C ⊕ θ S g a t e \theta^\alpha= \theta_{\mathcal{S}}^\alpha\oplus\theta_{\mathcal{S}^{C}} \oplus\theta_{\mathcal{S}_{\mathrm{gate}}} θ α = θ S α ⊕ θ S C ⊕ θ S gate . Thus, the parameter count of the conditioned policy is O ( K ∣ S ∣ + ∣ S C ∣ + ∣ S g a t e ∣ ) O(K|\mathcal{S}| + |\mathcal{S}^{C}| + |\mathcal{S}_{\mathrm{gate}}|) O ( K ∣ S ∣ + ∣ S C ∣ + ∣ S gate ∣ ) . Overall, this construction amortizes risk control across α \alpha α : most parameters are shared across all risk levels, while only a small set of parameters is trained.
The choice of S \mathcal{S} S determines both the expressiveness and the memory cost of the conditioned policy. Following prior work ((Wang et al., 2024b; Liu et al., 2024b)), we study two parameter-conditioning choices (Figure 2 ). The first is a logit-conditioned policy ((Liu et al., 2024b)), where conditioning is applied only to the final linear layer. This provides a lightweight output-level conditioning mechanism and is theoretically well motivated. The second is an attention-conditioned policy, where conditioning is applied to selected attention parameters. Prior work has found this form of conditioning to be highly steerable ((Wang et al., 2024b)), as it allows the conditioning variable to influence intermediate token interactions. In addition to parameter conditioning, we also consider a prompt-conditioned policy ((Guo et al., 2024; Jang et al., 2023; Wang et al., 2024a)), which appends the target risk level to the input prompt. This approach requires no additional model parameters and serves as a simple conditioning baseline. Additional implementation details are provided in Appendix § 8 .§ 1 .
Experiments
Through our experiments, we aim to answer the following research questions. RQ1: Conditioning mechanism. How does the choice of risk-conditioning mechanism affect both performance (ability to achieve strong results on risk levels observed during training) and steerability (ability to generalize to unseen risk levels within the risk interval)? RQ2: Benchmarking. How do different methods compare in terms of performance and steerability? RQ3: Ablations. How sensitive is the risk-conditioned method to key design choices?
Experiment Setup
Baselines. We compare our risk-conditioned policy with the following baselines. 1. Base LM:
This is the pretrained LM used as the initialization for all fine-tuned models. In our experiments, we use Pythia-70M, Pythia-2.8B ([11 ] ), and Llama-3.1-8B-Instruct ([38 ] ). 2. Prompt LM: This baseline uses the same risk-level prefix as the prompt-conditioned variant described in Appendix § 8 .§ 1 . The prefix is prepended to the sampled prompts from each dataset, but the model itself is not trained. This baseline tests whether the pretrained model can respond to risk-level instructions through prompting alone. 3. RA-RLHF: We compare against RA-RLHF ([12 ] ), a risk-averse RLHF method trained for a specified CVaR risk level. We consider three variants. RA-RLHF-Fix (α \alpha α ) denotes a policy trained with RA-RLHF at a single fixed risk level α \alpha α . RA-RLHF-Oracle reports, for each evaluation risk level α \alpha α , the performance of the RA-RLHF-Fix model trained at the same α \alpha α . This serves as an oracle baseline that assumes a separately trained model is available for every evaluation risk level. RA-RLHF-Mix trains a collection of separate RA-RLHF-Fix (α \alpha α ) models on the same training risk grid A t r a i n \mathcal{A}_{\mathrm{train}} A train used by our conditioned policy, and reports the best-performing model at test time: max α i ∈ A t r a i n J ( π α i ) \max_{\alpha_i \in\mathcal{A}_{\mathrm{train}}} J(\pi_{\alpha_i}) max α i ∈ A train J ( π α i ) . This represents a natural multi-model baseline that relies on training and selecting among several risk-specific policies. 4. Logit-Mixing LM: This baseline similarly trains a collection of separate RA-RLHF-Fix (α \alpha α ) models. At inference time, for a target α \alpha α , it selects two nearby trained policies and linearly interpolates their output logits ((Liu et al., 2024b)). This baseline tests whether inference-time interpolation between fixed-risk policies is sufficient for risk control.
Tasks. We consider generative versions of two established classification tasks, following prior work ([12 ] ). IMDB-Gen, adapted from ((Ramamurthy et al., 2022)), asks the LLM to complete a movie review while maximizing positive sentiment. RealToxicityPrompts-Gen ([34 ] ) evaluates whether the model can generate continuations with minimal toxicity. In addition, we include a safety-oriented task based on Safe-RLHF ((Ji et al., 2024)), where the objective is to reduce harmfulness responses across 19 harm categories. We report the main results using Pythia-70M and provide additional experiment results with Pythia-2.8B in Appendix § 10 .§ 1 and Llama-3.1-8B-Instruct in Appendix § 10 .§ 2 .
Evaluation Metrics. We evaluate each method using the task-specific reward model or cost model. For IMDB-Gen, we use the sentiment classifier lvwerra/distilbert-imdb and report the probability assigned to the positive sentiment class for each generated review continuation. For RealToxicityPrompts-Gen, we use the toxicity classifier unitary/toxic-bert and report the negative sigmoid-normalized probability assigned to the toxicity label for each generated continuation. For Safe-RLHF, we use PKU-Alignment/beaver-7b-unified-cost, which directly outputs a harmfulness cost, and report its negative value. For all metrics, higher values indicate better performance. We report the mean and standard deviation of C V a R α \mathrm{CVaR}_{\alpha} CVaR α across five random seeds. We include additional experiment setup in Appendix § 9 .
Results on Conditioning Mechanism
Figure 3 compares the three conditioning mechanisms. All methods are trained on the risk grid A h = { 0.1 , 0.3 , 0.5 , 0.7 , 0.9 } \mathcal{A}_{h} = \{0.1, 0.3, 0.5, 0.7, 0.9\} A h = { 0.1 , 0.3 , 0.5 , 0.7 , 0.9 } , which covers the interval ( 0 , 1 ] (0, 1] ( 0 , 1 ] with a small number of representative risk levels. We hold out the intermediate values { 0.2 , 0.4 , 0.6 , 0.8 } \{0.2, 0.4, 0.6, 0.8\} { 0.2 , 0.4 , 0.6 , 0.8 } to evaluate whether a single risk-conditioned policy can provide smooth and reliable interpolation over the risk frontier. Overall, parameter-based conditioning outperforms prompt-based conditioning, indicating that natural-language prompting alone provides limited risk controllability. Among parameter-based methods, the attention-conditioned policy only slightly outperforms the logit-conditioned policy. This differs from prior findings in multi-objective finetuning (Wang et al., 2024b), where attention conditioning shows a clearer advantage, and suggests that both parameter-based variants can provide effective risk control in our CVaR-conditioned setting.
Figure 3. Comparison of different conditioning mechanisms across CVaR risk levels on three benchmarks.
Moreover, Table 1 reports the computational overhead of different conditioning mechanisms. Overall, the conditioned policies introduce negligible parameter overhead relative to the base policy. Empirically, both peak GPU memory and per-update training time remain close to RA-RLHF, suggesting that the proposed conditioning mechanisms improve risk controllability without meaningfully increasing computational cost. Based on these results, we use the attention-conditioned policy as the default risk-conditioned LM in the remaining experiments.
Table 1. Computational overhead of different methods.
Core Benchmarking Results
Figure 4 reports performance at the risk levels observed during training. In addition to RA-RLHF-Oracle, we include Risk-conditioned-Oracle, which applies Algorithm 1 separately at each fixed risk level. This baseline isolates the effect of our gradient-based CVaR optimization from the effect of sharing one conditioned policy across risk levels. Overall, Risk-conditioned-Oracle performs better than RA-RLHF-Oracle in most cases, suggesting that the hard tail-selection strategy used in RA-RLHF can be less effective than our gradient-based CVaR optimization. The full Risk-conditioned LM is slightly below the oracle variants. However, its performance remains close to both oracle models, indicating that the degradation from risk conditioning and shared training across α \alpha α ’s is modest.
Figure 4. Performance of various methods across CVaR risk levels observed during training on three benchmarks.
Table 2 reports the steerability of different methods at held-out CVaR risk levels. Overall, our risk-conditioned LM remains comparable to RA-RLHFOracle, demonstrating that a single conditioned policy can interpolate effectively across the risk frontier without requiring a separately trained policy for every target α \alpha α . At the same time, our method outperforms RA-RLHF-Mix in most cases, showing the benefit of directly learning a risk-conditioned policy rather than repeatedly training, storing, and selecting among multiple fixed-risk models. We also observe that Prompt LM performs poorly, indicating that inference-time prompting alone is insufficient for reliable risk control. Logit-Mixing LM also underperforms our method. In Appendix § 7 .§ 4 , we provide a theoretical explanation. Logit interpolation is constrained by the behaviors supported by the endpoint policies and cannot easily recover intermediate behaviors. Overall, these results demonstrate the steerability of our method: a single model can adapt from stricter small-α \alpha α risk control to larger-α \alpha α settings that place more weight on broader expected performance.
Table 2. Steerability of different methods across unknown CVaR risk levels on three benchmarks. The red and blue markers represent the best and second-best values, respectively.
Following the common practice of using LLM judges as scalable approximations of human evaluation [16 ] (Liu et al. 2023), we additionally use an LLM-based judge for cross-evaluation. This also helps reduce the dependence between the training cost/reward model and the evaluation signal. Specifically, we use google/gemma-4-31B-it (Team et al., 2026) as the judge and adopt the prompt from Appendix G.§ 4.2 of [23 ] , which asks the model to assign a safety score from 0 to 10, where a higher score indicates better safety. We then compute the win rate of each baseline method against our risk-conditioned LM based on Pythia-70M in Table 3 . Our method achieves performance comparable to RA-RLHF-Oracle, outperforms RA-RLHF-Mix in most cases, and performs better than the other baselines. These results provide additional cross-evaluation evidence that the improvement is not solely tied to the original proxy reward/cost model used in the main experiments.
Table 3. Win rate (%) of each baseline method against the Risk-conditioned LM under LLM-judge evaluation. Lower values indicate that the Risk-conditioned LM is preferred more often.
We include two additional controllability evaluations in Appendix § 10 .§ 3 . First, we vary α \alpha α while fixing the evaluation risk level, showing that our method induces smooth, stable, and overall monotonic changes in worst-tail behavior. Second, we evaluate our method on a denser set of previously unreported α \alpha α values, demonstrating reliable control over continuous risk levels within the covered range, beyond the held-out values { 0.2 , 0.4 , 0.6 , 0.8 } \{0.2, 0.4, 0.6, 0.8\} { 0.2 , 0.4 , 0.6 , 0.8 } reported in the main experiments.
Ablations
Since the number of conditioned parameter sets controls how flexibly the policy can adapt to different risk levels, we ablate the capacity of the attention-conditioned LM on Safe-RLHF. Specifically, we vary K K K , the number of conditioned parameter sets, while keeping the rest of the training setup unchanged. Table 4 shows that increasing K K K substantially improves held-out risk performance when moving from K = 1 K = 1 K = 1 to K = 5 K = 5 K = 5 . However, the gains saturate after K = 5 K = 5 K = 5 . Increasing K K K from 5 to 16 raises the number of extra parameters from 0.74M to 2.37M, but improves the average score by only 0.39%. Moreover, further increasing K K K to 32 slightly degrades performance despite using 4.73M extra parameters. These results suggest that a small number of risk-conditioned parameter sets is sufficient to provide effective steerability, while larger conditioning capacity brings limited additional benefit and may make optimization harder. We provide the complete ablation results on the remaining datasets, along with additional ablations on different training risk grids, in Appendix § 10 .§ 4 . We further include a qualitative analysis in Appendix § 10 .§ 5 to examine whether the risk-conditioned LM exhibits risk-dependent behavior for individual prompts at inference time.
Table 4. Ablation on the number of conditioned parameter sets K K K for the attention-conditioned LM on Safe-RLHF. We compute the parameter increase and average performance gain relative to the K = 5 K = 5 K = 5 setting.
Conclusion
In this paper, we introduced risk-conditioned RLHF, a framework for training a single language model that can adapt to different CVaR risk levels at inference time. Unlike fixed-risk RA-RLHF, which requires a separate policy for each target risk level, our approach conditions the policy directly on the desired risk level and learns a continuous risk-control interface. Across three benchmarks, our experiments show that risk-conditioned policies can closely match risk-specific policies while improving steerability. These results suggest that risk conditioning is a promising direction for amortizing risk-averse alignment across diverse deployment scenarios and user safety requirements.
Limitations
Despite the effectiveness of the risk-conditioned framework, several limitations remain. First, our evaluation mainly relies on reward or cost models. Although these models provide scalable and task-specific measurements, they are still imperfect proxies for human judgments. As in other RLHF settings, optimizing against a learned proxy may introduce reward hacking or superficial improvements (Liu et al., 2026c; Wang et al., 2026). Human evaluation would therefore provide valuable additional validation, especially for assessing whether proxy-measured safety improvements align with human judgments. For CVaR-based evaluation, one possible protocol is to ask human evaluators to score a set of responses for each prompt and then compute the mean score over the worst-tail responses as the evaluation metric. We leave such human validation to future work.
Second, although our method provides an inference-time interface for changing the CVaR risk level, we do not fully solve the deployment problem of how users or system designers should choose α \alpha α . Selecting α \alpha α for a specific deployment domain is a nontrivial calibration problem. However, this issue arises from the use of CVaR itself rather than from our risk-conditioned framework specifically. Across application domains of CVaR, there does not appear to be a universally accepted operational procedure for choosing α \alpha α . Instead, α \alpha α is typically treated as an application-specific confidence, selected according to regulation or sensitivity analysis over several candidate values ([30 ] ). For example, in energy applications, prior work often evaluates standard values ranging from 0.1 to 0.01, corresponding to increasingly conservative risk preferences. Recent work in behavioral decision-making ([31 ] ) has estimated α \alpha α from observed sequential choice data by fitting a CVaR-based choice model with maximum-likelihood estimation. While this does not provide a deployment-specific rule for selecting α \alpha α in LLM safety applications, it suggests that future work may calibrate risk levels using behavioral or preference data rather than relying only on hand-specified values. We view this as an important and underexplored direction for future work that is beyond the scope of current paper.
Ethical Considerations
The main ethical risk of our framework is dual use. A controllable risk parameter can improve deployment flexibility by allowing more conservative behavior in high-risk settings, but it could also be misused to intentionally reduce conservatism by selecting a larger α \alpha α . Our method should therefore not be interpreted as a mechanism for bypassing safety safeguards. In practical deployments, the allowable range of α \alpha α should be governed by application-level safety policies, access control, and monitoring. For high-stakes domains, such as medical, legal, or emergency-response applications, we recommend restricting users to a validated safe interval of α \alpha α , logging risk-level choices, and combining risk-conditioned alignment with external safety filters and human oversight.
Acknowledgments
This work was supported in part by NSF grant CNS-2146548, a grant from the Louisiana Board of Regents, a gift from Coefficient Giving, and funding from Tulane University Jurist Center for Artificial Intelligence. We thank the anonymous reviewers for their insightful and constructive feedback.
Related Work
Risk-conditioned RL
In the RL community, early research on risk-sensitive control primarily studied how to optimize agents under a fixed risk measure (Howard and Matheson, 1972; Sato et al., 2001), such as WVaR (Mihatsch and Neuneier, 2002) or CVaR [19 , 22 ] (Tamar et al. 2015b). A representative example is IQN [22 ] , which connects distributional RL with risk-sensitive RL by estimating the quantile function of policy returns, thereby enabling the computation of WVaR-based objectives.
Subsequent work has moved from optimizing for a single prescribed risk measure toward conditioning the agent on different risk preferences. In this direction, RCDSAC [17 ] extends risk-sensitive RL to the risk-conditioned setting within the IQN framework. It considers risk measures that can be parameterized as subsets of WVaR, such as CVaR and CPW, and learns the risk-conditioned objective by uniformly sampling these parameters during training. Yoo et al. (2024) further improve this framework by introducing a risk proposal network to sample diverse risk measures. This network combines a conditional adversarial auto-encoder with a normalizing flow, allowing the model to learn coherent representations of different risk measures.
In contrast to these works, which mainly study risk-conditioned policies in standard RL domains, our work brings the risk-conditioned perspective to LLM alignment.
Risk Averseness in LLMs
Recently, risk aversion has been introduced into LLM alignment to reduce rare but harmful generations. For example, Chaudhary et al. [12 ] propose RA-RLHF, which formulates risk-averse alignment as tail-risk minimization in RLHF. Their method adapts CVaR from risk-sensitive RL to the RLHF setting, shifting the objective from maximizing expected reward to improving performance on the low-return tail. This is particularly useful for suppressing rare but high-severity toxic generations that may be overlooked by average-reward optimization. However, RA-RLHF trains the policy for a fixed CVaR risk level and therefore does not provide inference-time control over the desired degree of risk aversion. A complementary line of work studies risk control at the prompt-selection level. Instead of modifying model parameters, these methods aim to choose prompts that reduce the likelihood of unsafe model behavior. In particular, Zollo et al. (2024) propose Prompt Risk Control, a framework for selecting prompts using rigorous statistical upper bounds on deployment risk measures, including mean loss and CVaR. Their method is lightweight and provides statistical guarantees for safer prompt selection without fine-tuning the underlying language model.
In contrast to both fixed-risk policy optimization and prompt-level risk control, our method learns a single policy explicitly conditioned on the target risk level. This allows the model to adjust its risk sensitivity at inference time and interpolate to unseen risk levels, without retraining or deploying a separate policy for each target risk level.
Multi-objective Finetuning
Multi-objective finetuning has recently been explored for multi-reward alignment, where the objective is to train a language model that can be steered across a continuum of reward weightings (Hayes et al., 2022; Rame et al., 2023). Existing methods can be broadly categorized into prompt-based conditioning and parameter-based conditioning. Prompt-based methods expose the desired reward weights to the model through the input context. For instance, Personalized Soups (Jang et al., 2023) uses manually designed prompts to personalize language models according to binary preferences over multiple rewards, while RiC (Yang et al., 2024) incorporates reward-conditioning prompts into supervised fine-tuning. Despite their simplicity, prompt-based approaches may provide limited controllability and can be sensitive to the specific textual format used to express the reward weights [12 ] . An alternative line of work performs conditioning directly in parameter space, so that the reward preference is mapped into the language policy itself rather than only described in the prompt. Rewarded Soups (Rame et al., 2023) follows this direction with a zero-shot parameter-averaging strategy, combining models that are separately trained for individual rewards. Panacea (Zhong et al., 2024) instead embeds reward weights into the singular values of the AdaLoRA framework (Hu et al., 2022; Zhang et al., 2023). CLP (Wang et al., 2024b) further propose a general parameter-space conditioning framework that injects reward weights into attention layers, achieving parameter-efficient and steerable control over multi-objective generation. More recently, HoE (Li et al., 2025) uses a hierarchy of LoRA experts and router experts to select and combine preference-specific modules for multi-objective alignment. NP-DPO (Kobalczyk et al., 2024) introduces functional parameter-space conditioning to adapt both rewards and policies to continuous user preferences.
Different from these studies, which primarily address reward-weight conditioning for multi-objective alignment, our work studies conditioning with respect to the risk level. We adapt the above conditioning mechanisms to construct a risk-conditioned LLM policy, enabling the model to vary its degree of risk sensitivity under a unified alignment framework.
Proofs
Proof of Theorem 1
Recall that
J ( θ , ω ) : = E α , x [ η ω ( x , α ) − 1 α E Y ∼ π θ ( η ω ( x , α ) − G ( x , Y ; α ) ) + ] \mathcal{J}(\theta,\omega) := \mathbb{E}_{\alpha,x}\left[\eta_{\omega}(x,\alpha) - \frac{1}{\alpha}\mathbb{E}_{Y\sim\pi_{\theta}}\left(\eta_{\omega}(x,\alpha)-G(x,Y;\alpha)\right)_{+}\right] J ( θ , ω ) := E α , x [ η ω ( x , α ) − α 1 E Y ∼ π θ ( η ω ( x , α ) − G ( x , Y ; α ) ) + ]
To compute the gradient for ω \omega ω , for fixed ( x , α , y ) (x,\alpha,y) ( x , α , y ) ,
∂ ∂ η [ η − 1 α ( η − G ) + ] = 1 − 1 α 1 { G ≤ η } . \frac{\partial}{\partial\eta}\left[\eta-\frac{1}{\alpha}(\eta-G)_{+}\right] = 1-\frac{1}{\alpha}\mathbf{1}\{G\leq\eta\}. ∂ η ∂ [ η − α 1 ( η − G ) + ] = 1 − α 1 1 { G ≤ η } .
By chain rule,
∇ ω J ( θ , ω ) = E α , x , Y ∼ π θ [ ( 1 − 1 α 1 { G ( x , Y ; α ) ≤ η ω ( x , α ) } ) ∇ ω η ω ( x , α ) ] . \nabla_{\omega}\mathcal{J}(\theta,\omega)=\mathbb{E}_{\alpha,x,Y\sim\pi_{\theta}}\left[\left(1-\frac{1}{\alpha}\mathbf{1}\{G(x,Y;\alpha)\leq\eta_{\omega}(x,\alpha)\}\right)\nabla_{\omega}\eta_{\omega}(x,\alpha)\right]. ∇ ω J ( θ , ω ) = E α , x , Y ∼ π θ [ ( 1 − α 1 1 { G ( x , Y ; α ) ≤ η ω ( x , α )} ) ∇ ω η ω ( x , α ) ] .
As for the gradient with respect to θ \theta θ , using the following equation,
∇ θ E Y ∼ π θ [ f θ ( Y ) ] = E Y ∼ π θ [ f θ ( Y ) ∇ θ log π θ + ∇ θ f θ ( Y ) ] . \nabla_{\theta}\mathbb{E}_{Y\sim\pi_{\theta}}[f_{\theta}(Y)]=\mathbb{E}_{Y\sim\pi_{\theta}}[f_{\theta}(Y)\nabla_{\theta}\log\pi_{\theta}+\nabla_{\theta}f_{\theta}(Y)]. ∇ θ E Y ∼ π θ [ f θ ( Y )] = E Y ∼ π θ [ f θ ( Y ) ∇ θ log π θ + ∇ θ f θ ( Y )] .
Apply this with
f θ ( Y ) = u θ , ω ( x , Y , α ) . f_{\theta}(Y)=u_{\theta,\omega}(x,Y,\alpha). f θ ( Y ) = u θ , ω ( x , Y , α ) .
Then
∇ θ J ( θ , ω ) = E α , x , Y ∼ π θ [ u θ , ω ( x , Y , α ) ∇ θ log π θ + ∇ θ u θ , ω ( x , Y , α ) ] . \nabla_{\theta}\mathcal{J}(\theta,\omega)=\mathbb{E}_{\alpha,x,Y\sim\pi_{\theta}}[u_{\theta,\omega}(x,Y,\alpha)\nabla_{\theta}\log\pi_{\theta}+\nabla_{\theta}u_{\theta,\omega}(x,Y,\alpha)]. ∇ θ J ( θ , ω ) = E α , x , Y ∼ π θ [ u θ , ω ( x , Y , α ) ∇ θ log π θ + ∇ θ u θ , ω ( x , Y , α )] .
with u θ , ω ( x , Y , α ) = η ω ( x , α ) − 1 α ( η ω ( x , α ) − G ( x , Y ; α ) ) + u_{\theta,\omega}(x,Y,\alpha)=\eta_{\omega}(x,\alpha)-\frac{1}{\alpha}(\eta_{\omega}(x,\alpha)-G(x,Y;\alpha))_{+} u θ , ω ( x , Y , α ) = η ω ( x , α ) − α 1 ( η ω ( x , α ) − G ( x , Y ; α ) ) + , and η ω \eta_{\omega} η ω does not depend on θ \theta θ ,
∇ θ u θ , ω ( x , Y , α ) = 1 α 1 { G ( x , Y ; α ) ≤ η ω ( x , α ) } ∇ θ G ( x , Y ; α ) . \nabla_{\theta}u_{\theta,\omega}(x,Y,\alpha)=\frac{1}{\alpha}\mathbf{1}\{G(x,Y;\alpha)\leq\eta_{\omega}(x,\alpha)\}\nabla_{\theta}G(x,Y;\alpha). ∇ θ u θ , ω ( x , Y , α ) = α 1 1 { G ( x , Y ; α ) ≤ η ω ( x , α )} ∇ θ G ( x , Y ; α ) .
Hence the exact gradient is
∇ θ J ( θ , ω ) = E α , x , Y ∼ π θ [ u θ , ω ( x , Y , α ) ∇ θ log π θ + 1 α 1 { G ( x , Y ; α ) ≤ η ω ( x , α ) } ∇ θ G ] . \nabla_{\theta}\mathcal{J}(\theta,\omega)=\mathbb{E}_{\alpha,x,Y\sim\pi_{\theta}}\left[u_{\theta,\omega}(x,Y,\alpha)\nabla_{\theta}\log\pi_{\theta}+\frac{1}{\alpha}\mathbf{1}\{G(x,Y;\alpha)\leq\eta_{\omega}(x,\alpha)\}\nabla_{\theta}G\right]. ∇ θ J ( θ , ω ) = E α , x , Y ∼ π θ [ u θ , ω ( x , Y , α ) ∇ θ log π θ + α 1 1 { G ( x , Y ; α ) ≤ η ω ( x , α )} ∇ θ G ] .
We use
G ( x , Y ; α ) = r ( x , Y ) − β log π θ ( Y ∣ x , α ) π r e f ( Y ∣ x ) G(x,Y;\alpha)=r(x,Y)-\beta\log\frac{\pi_{\theta}(Y\mid x,\alpha)}{\pi_{\mathrm{ref}}(Y\mid x)} G ( x , Y ; α ) = r ( x , Y ) − β log π ref ( Y ∣ x ) π θ ( Y ∣ x , α )
then
∇ θ G ( x , Y ; α ) = − β ∇ θ log π θ ( Y ∣ x , α ) . \nabla_{\theta}G(x,Y;\alpha)=-\beta\nabla_{\theta}\log\pi_{\theta}(Y\mid x,\alpha). ∇ θ G ( x , Y ; α ) = − β ∇ θ log π θ ( Y ∣ x , α ) .
So the exact gradient simplifies to
∇ θ J ( θ , ω ) = E α , x , Y ∼ π θ [ ( u θ , ω ( x , Y , α ) − β α 1 { G ( x , Y ; α ) ≤ η ω ( x , α ) } ) ∇ θ log π θ ] . \nabla_{\theta}\mathcal{J}(\theta,\omega)=\mathbb{E}_{\alpha,x,Y\sim\pi_{\theta}}\left[\left(u_{\theta,\omega}(x,Y,\alpha)-\frac{\beta}{\alpha}\mathbf{1}\{G(x,Y;\alpha)\leq\eta_{\omega}(x,\alpha)\}\right)\nabla_{\theta}\log\pi_{\theta}\right]. ∇ θ J ( θ , ω ) = E α , x , Y ∼ π θ [ ( u θ , ω ( x , Y , α ) − α β 1 { G ( x , Y ; α ) ≤ η ω ( x , α )} ) ∇ θ log π θ ] .
This completes the proof.
Stochastic Gradients
We now describe the stochastic estimators used to approximate the gradients. Given a batch of { ( x b , α b ) } b = 1 B \{(x_b,\alpha_b)\}_{b=1}^{B} {( x b , α b ) } b = 1 B , where B B B is the batch size. Sample y b , 1 , … , y b , N ∼ π θ ( ⋅ ∣ x b , α b ) y_{b,1},\ldots,y_{b,N}\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b) y b , 1 , … , y b , N ∼ π θ ( ⋅ ∣ x b , α b ) responses, where N N N is the number of completions for each prompt x b x_b x b and risk level α b \alpha_b α b . Then the stochastic gradients (3) and (4) can be approximated respectively by the following equations:
g ^ ω ( θ , ω ) : = 1 B ∑ b = 1 B [ 1 − 1 α b N ∑ n = 1 N 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b ) } ] ∇ ω η ω ( x b , α b ) \widehat{g}_{\omega}(\theta,\omega):=\frac{1}{B}\sum_{b=1}^{B}\left[1-\frac{1}{\alpha_bN}\sum_{n=1}^{N}\mathbf{1}\{G(x_b,y_{b,n};\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\}\right]\nabla_{\omega}\eta_{\omega}(x_b,\alpha_b) g ω ( θ , ω ) := B 1 b = 1 ∑ B [ 1 − α b N 1 n = 1 ∑ N 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b )} ] ∇ ω η ω ( x b , α b )
g ^ θ ( θ , ω ) : = 1 B N ∑ b = 1 B ∑ n = 1 N ( u θ , ω ( x b , y b , n , α b ) − β α b 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b ) } ) ∇ θ log π θ ( y b , n ∣ x b , α b ) , \widehat{g}_{\theta}(\theta,\omega):=\frac{1}{BN}\sum_{b=1}^{B}\sum_{n=1}^{N}\left(u_{\theta,\omega}(x_b,y_{b,n},\alpha_b)-\frac{\beta}{\alpha_b}\mathbf{1}\{G(x_b,y_{b,n};\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\}\right)\nabla_{\theta}\log\pi_{\theta}(y_{b,n}\mid x_b,\alpha_b), g θ ( θ , ω ) := B N 1 b = 1 ∑ B n = 1 ∑ N ( u θ , ω ( x b , y b , n , α b ) − α b β 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b )} ) ∇ θ log π θ ( y b , n ∣ x b , α b ) ,
where g ^ ω ( θ , ω ) ≈ ∇ ω J ( θ , ω ) \widehat{g}_{\omega}(\theta,\omega)\approx\nabla_{\omega}\mathcal{J}(\theta,\omega) g ω ( θ , ω ) ≈ ∇ ω J ( θ , ω ) and g ^ θ ( θ , ω ) ≈ ∇ θ J ( θ , ω ) \widehat{g}_{\theta}(\theta,\omega)\approx\nabla_{\theta}\mathcal{J}(\theta,\omega) g θ ( θ , ω ) ≈ ∇ θ J ( θ , ω ) .
Gradients estimation error. We next provide error bounds for the stochastic gradient estimators relative to the gradients (3) and (4) . We begin by stating the standard assumptions used throughout the analysis.
Assumption 1. For every ( x , α ) (x,\alpha) ( x , α ) , the threshold network and its gradient are uniformly bounded:
∣ η ω ( x , α ) ∣ ≤ M η , ∥ ∇ ω η ω ( x , α ) ∥ ≤ ℓ η . |\eta_\omega(x,\alpha)| \le M_\eta,\qquad\|\nabla_\omega\eta_\omega(x,\alpha)\| \le\ell_\eta. ∣ η ω ( x , α ) ∣ ≤ M η , ∥ ∇ ω η ω ( x , α ) ∥ ≤ ℓ η . Assumption 1 imposes a standard uniform boundedness condition on the threshold network and its parameter gradient.
Assumption 2. Conditioned on ( x b , α b ) (x_b,\alpha_b) ( x b , α b ) , the completions y b , 1 , … , y b , N y_{b,1},\ldots,y_{b,N} y b , 1 , … , y b , N are i.i.d. draws from π θ ( ⋅ ∣ x b , α b ) \pi_\theta(\cdot\mid x_b,\alpha_b) π θ ( ⋅ ∣ x b , α b ) , and the pairs ( x b , α b ) (x_b,\alpha_b) ( x b , α b ) are i.i.d. across b b b .
Assumption 2 specifies the standard i.i.d. sampling setup for the stochastic estimators: completions are sampled independently from the current policy conditioned on each prompt risk pair, and the prompt risk pairs are independently sampled across the batch.
Assumption 3. For every ( x , α , Y ) (x,\alpha,Y) ( x , α , Y ) , we have
∥ ∇ θ log π θ ( Y ∣ x , α ) ∥ ≤ ℓ π . \|\nabla_\theta\log\pi_\theta(Y\mid x,\alpha)\| \le\ell_\pi. ∥ ∇ θ log π θ ( Y ∣ x , α ) ∥ ≤ ℓ π . Assumption 3 imposes a standard boundedness condition on the risk-conditioned policy gradient term.
Assumption 4. The regularized return
G ( x , Y ; α ) = r ( x , Y ) − β log π θ ( Y ∣ x , α ) π r e f ( Y ∣ x ) , G(x,Y;\alpha)=r(x,Y)-\beta\log\frac{\pi_\theta(Y\mid x,\alpha)}{\pi_{\mathrm{ref}}(Y\mid x)}, G ( x , Y ; α ) = r ( x , Y ) − β log π ref ( Y ∣ x ) π θ ( Y ∣ x , α ) , with Y ∼ π θ ( ⋅ ∣ x , α ) Y\sim\pi_\theta(\cdot\mid x,\alpha) Y ∼ π θ ( ⋅ ∣ x , α ) , is uniformly bounded. That is, for all x , Y , θ , α x,Y,\theta,\alpha x , Y , θ , α , G ( x , Y ; α ) ∈ [ Z min , Z max ] G(x,Y;\alpha)\in[Z_{\min},Z_{\max}] G ( x , Y ; α ) ∈ [ Z m i n , Z m a x ] .
Assumption 4 requires the KL-regularized return to lie in a fixed bounded interval uniformly over prompts, completions, policies, and risk levels. This condition is standard when the reward is bounded and the log-ratio term is controlled, for example by restricting the policy class or by ensuring sufficient support overlap between π θ \pi_\theta π θ and π r e f \pi_{\mathrm{ref}} π ref .
We next state the error bounds for approximating the gradients (3) and (4) with stochastic gradient estimators. The proof follows a similar argument to Proposition 9 of Chen et al., [15 ] and Proposition 8 of Liu et al., 2026d.
Proposition 1. Under Assumptions 1, 2, 3, and 4, the stochastic gradient estimators g ^ ω ( θ , ω ) \hat{g}_\omega(\theta,\omega) g ^ ω ( θ , ω ) and g ^ θ ( θ , ω ) \hat{g}_\theta(\theta,\omega) g ^ θ ( θ , ω ) are unbiased estimators of the corresponding gradients:
E [ g ^ ω ( θ , ω ) ] = ∇ ω J ( θ , ω ) , \mathbb{E}[\hat{g}_\omega(\theta,\omega)] = \nabla_\omega J(\theta,\omega), E [ g ^ ω ( θ , ω )] = ∇ ω J ( θ , ω ) , E [ g ^ θ ( θ , ω ) ] = ∇ θ J ( θ , ω ) . \mathbb{E}[\hat{g}_\theta(\theta,\omega)] = \nabla_\theta J(\theta,\omega). E [ g ^ θ ( θ , ω )] = ∇ θ J ( θ , ω ) . Moreover, their mean-squared errors satisfy
E [ ∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] ≤ ℓ η 2 4 B N α min 2 + ℓ η 2 B α min 2 , \mathbb{E}\left[\|\hat{g}_\omega(\theta,\omega)-\nabla_\omega J(\theta,\omega)\|^2\right] \le\frac{\ell_\eta^2}{4BN\alpha_{\min}^2}+\frac{\ell_\eta^2}{B\alpha_{\min}^2}, E [ ∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] ≤ 4 B N α m i n 2 ℓ η 2 + B α m i n 2 ℓ η 2 , E [ ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] ≤ C A 2 ℓ π 2 B N + C A 2 ℓ π 2 B , \mathbb{E}\left[\|\hat{g}_\theta(\theta,\omega)-\nabla_\theta J(\theta,\omega)\|^2\right] \le\frac{C_A^2\ell_\pi^2}{BN}+\frac{C_A^2\ell_\pi^2}{B}, E [ ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] ≤ B N C A 2 ℓ π 2 + B C A 2 ℓ π 2 , where
C A : = max { M η , M η 1 − α min α min + max { ∣ Z min ∣ , ∣ Z max ∣ } + β α min } . C_A := \max\left\{M_\eta,M_\eta\frac{1-\alpha_{\min}}{\alpha_{\min}}+\frac{\max\{|Z_{\min}|,|Z_{\max}|\}+\beta}{\alpha_{\min}}\right\}. C A := max { M η , M η α m i n 1 − α m i n + α m i n max { ∣ Z m i n ∣ , ∣ Z m a x ∣ } + β } .
Proof. We start the proof for g ^ ω ( θ , ω ) \hat{g}_\omega(\theta,\omega) g ^ ω ( θ , ω ) . For brevity, write
I b , n : = 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b ) } , I_{b,n}:=\mathbf{1}\{G(x_b,y_{b,n};\alpha_b)\le\eta_\omega(x_b,\alpha_b)\}, I b , n := 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b )} ,
Conditioned on ( x b , α b ) (x_b,\alpha_b) ( x b , α b ) , the variables I b , 1 , … , I b , N I_{b,1},\ldots,I_{b,N} I b , 1 , … , I b , N are i.i.d. with mean
P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) . \mathbb{P}_{y\sim\pi_\theta(\cdot\mid x_b,\alpha_b)}\left(G(x_b,y;\alpha_b)\le\eta_\omega(x_b,\alpha_b)\right). P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) .
Therefore,
E [ 1 α b N ∑ n = 1 N I b , n ∣ x b , α b ] = P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) α b , \mathbb{E}\left[\left.\frac{1}{\alpha_bN}\sum_{n=1}^{N}I_{b,n}\right|x_b,\alpha_b\right]
=
\frac{\mathbb{P}_{y\sim\pi_\theta(\cdot\mid x_b,\alpha_b)}\left(G(x_b,y;\alpha_b)\le\eta_\omega(x_b,\alpha_b)\right)}{\alpha_b}, E [ α b N 1 n = 1 ∑ N I b , n x b , α b ] = α b P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) ,
and hence
E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] = 1 B ∑ b = 1 B ( 1 − P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) α b ) ∇ ω η ω ( x b , α b ) . \mathbb{E}[\hat{g}_\omega(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]
=
\frac{1}{B}\sum_{b=1}^{B}\left(1-
\frac{\mathbb{P}_{y\sim\pi_\theta(\cdot\mid x_b,\alpha_b)}\left(G(x_b,y;\alpha_b)\le\eta_\omega(x_b,\alpha_b)\right)}{\alpha_b}\right)
\nabla_\omega\eta_\omega(x_b,\alpha_b). E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] = B 1 b = 1 ∑ B ( 1 − α b P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) ) ∇ ω η ω ( x b , α b ) .
Taking expectation again over ( x b , α b ) (x_b,\alpha_b) ( x b , α b ) gives
E [ g ^ ω ( θ , ω ) ] = ∇ ω J ( θ , ω ) . \mathbb{E}[\hat{g}_\omega(\theta,\omega)] = \nabla_\omega J(\theta,\omega). E [ g ^ ω ( θ , ω )] = ∇ ω J ( θ , ω ) .
Thus g ^ ω ( θ , ω ) \hat{g}_\omega(\theta,\omega) g ^ ω ( θ , ω ) is unbiased. Next, we bound the mean-squared error
E [ ∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] . \mathbb{E}\left[\|\hat{g}_\omega(\theta,\omega)-\nabla_\omega J(\theta,\omega)\|^2\right]. E [ ∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] .
We write
g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) = ( g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ) + ( E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ) . \hat{g}_\omega(\theta,\omega)-\nabla_\omega J(\theta,\omega)
=
\left(\hat{g}_\omega(\theta,\omega)-\mathbb{E}[\hat{g}_\omega(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\right)
+
\left(\mathbb{E}[\hat{g}_\omega(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\omega J(\theta,\omega)\right). g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) = ( g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ) + ( E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ) .
Therefore,
∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 = ∥ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 + ∥ E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ∥ 2 + 2 ⟨ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ⟩ . \begin{aligned}
\left\lVert\widehat{g}_{\omega}(\theta,\omega)-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rVert^{2}
={}&\left\lVert\widehat{g}_{\omega}(\theta,\omega)-\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]\right\rVert^{2}\\
&+\left\lVert\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rVert^{2}\\
&+2\left\langle\widehat{g}_{\omega}(\theta,\omega)-\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right],\right.\\
&\qquad\left.\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rangle.
\end{aligned} ∥ g ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 = ∥ g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 + ∥ E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ∥ 2 + 2 ⟨ g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ⟩ .
Taking expectation on both sides yields
E [ ∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] = E [ ∥ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] + E [ ∥ E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ∥ 2 ] + 2 E [ ⟨ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ⟩ ] . \begin{aligned}
\mathbb{E}\left[\left\lVert\widehat{g}_{\omega}(\theta,\omega)-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rVert^{2}\right]
={}&\mathbb{E}\left[\left\lVert\widehat{g}_{\omega}(\theta,\omega)-\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]\right\rVert^{2}\right]\\
&+\mathbb{E}\left[\left\lVert\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rVert^{2}\right]\\
&+2\mathbb{E}\left[\left\langle\widehat{g}_{\omega}(\theta,\omega)-\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right],\right.\right.\\
&\qquad\left.\left.\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rangle\right].
\end{aligned} E [ ∥ g ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] = E [ ∥ g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] + E [ ∥ E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ∥ 2 ] + 2 E [ ⟨ g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ⟩ ] .
Now consider the last term. By the tower property of conditional expectation,
E [ ⟨ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ⟩ ] = E [ E [ ⟨ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ⟩ ∣ x 1 : B , α 1 : B ] ] . \begin{aligned}
\mathbb{E}\left[\left\langle\widehat{g}_{\omega}(\theta,\omega)-\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right],\right.\right.\\
\left.\left.\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rangle\right]\\
=\mathbb{E}\left[\mathbb{E}\left[\left\langle\widehat{g}_{\omega}(\theta,\omega)-\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right],\right.\right.\right.\\
\left.\left.\left.\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rangle\mid x_{1:B},\alpha_{1:B}\right]\right].
\end{aligned} E [ ⟨ g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ⟩ ] = E [ E [ ⟨ g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ⟩ ∣ x 1 : B , α 1 : B ] ] .
Conditioned on ( x 1 : B , α 1 : B ) (x_{1:B},\alpha_{1:B}) ( x 1 : B , α 1 : B ) , the vector
E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) \mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]-\nabla_{\omega}\mathcal{J}(\theta,\omega) E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω )
is deterministic, so it can be taken outside the inner conditional expectation. Thus the above is equal to
E [ ⟨ E [ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∣ x 1 : B , α 1 : B ] , E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ⟩ ] . \begin{aligned}
\mathbb{E}\left[\left\langle\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)-\right.\right.\right.\\
\left.\left.\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]\mid x_{1:B},\alpha_{1:B}\right],\right.\\
\left.\left.\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rangle\right].
\end{aligned} E [ ⟨ E [ g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∣ x 1 : B , α 1 : B ] , E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ⟩ ] .
But
E [ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∣ x 1 : B , α 1 : B ] = 0. \mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)-\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]\mid x_{1:B},\alpha_{1:B}\right]=0. E [ g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∣ x 1 : B , α 1 : B ] = 0.
Hence the cross term is zero, and therefore
E [ ∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] = E [ ∥ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] + E [ ∥ E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ∥ 2 ] . \begin{aligned}
\mathbb{E}\left[\left\lVert\widehat{g}_{\omega}(\theta,\omega)-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rVert^{2}\right]
={}&\mathbb{E}\left[\left\lVert\widehat{g}_{\omega}(\theta,\omega)-\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]\right\rVert^{2}\right]\\
&+\mathbb{E}\left[\left\lVert\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rVert^{2}\right].
\end{aligned} E [ ∥ g ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] = E [ ∥ g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] + E [ ∥ E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ∥ 2 ] .
We bound these two terms separately. For the first term, we have
g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] = 1 B ∑ b = 1 B [ P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) α b − 1 α b N ∑ n = 1 N I b , n ] ∇ ω η ω ( x b , α b ) . \widehat{g}_{\omega}(\theta,\omega)-\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]
=\frac{1}{B}\sum_{b=1}^{B}\left[\frac{\mathbb{P}_{y\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b)}\left(G(x_b,y;\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\right)}{\alpha_b}-\frac{1}{\alpha_bN}\sum_{n=1}^{N}I_{b,n}\right]\nabla_{\omega}\eta_{\omega}(x_b,\alpha_b). g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] = B 1 b = 1 ∑ B [ α b P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) − α b N 1 n = 1 ∑ N I b , n ] ∇ ω η ω ( x b , α b ) .
Conditioned on ( x 1 : B , α 1 : B ) (x_{1:B},\alpha_{1:B}) ( x 1 : B , α 1 : B ) , we have
E [ ∥ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ∣ x 1 : B , α 1 : B ] = 1 B 2 ∑ b = 1 B E [ ∥ ( P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) α b − 1 α b N ∑ n = 1 N I b , n ) ∇ ω η ω ( x b , α b ) ∥ 2 ∣ x 1 : B , α 1 : B ] . \mathbb{E}\left[\left\lVert\widehat{g}_{\omega}(\theta,\omega)-\mathbb{E}\left[\widehat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}\right]\right\rVert^{2}\mid x_{1:B},\alpha_{1:B}\right]
=\frac{1}{B^{2}}\sum_{b=1}^{B}\mathbb{E}\left[\left\lVert\left(\frac{\mathbb{P}_{y\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b)}\left(G(x_b,y;\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\right)}{\alpha_b}-\frac{1}{\alpha_bN}\sum_{n=1}^{N}I_{b,n}\right)\nabla_{\omega}\eta_{\omega}(x_b,\alpha_b)\right\rVert^{2}\mid x_{1:B},\alpha_{1:B}\right]. E [ ∥ g ω ( θ , ω ) − E [ g ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ∣ x 1 : B , α 1 : B ] = B 2 1 b = 1 ∑ B E ( α b P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) − α b N 1 n = 1 ∑ N I b , n ) ∇ ω η ω ( x b , α b ) 2 ∣ x 1 : B , α 1 : B .
Using ∥ ∇ ω η ω ( x b , α b ) ∥ ≤ ℓ η \left\lVert\nabla_{\omega}\eta_{\omega}(x_b,\alpha_b)\right\rVert\leq\ell_{\eta} ∥ ∇ ω η ω ( x b , α b ) ∥ ≤ ℓ η , this is at most
ℓ η 2 B 2 ∑ b = 1 B Var ( 1 α b N ∑ n = 1 N I b , n ∣ x b , α b ) . \frac{\ell_{\eta}^{2}}{B^{2}}\sum_{b=1}^{B}\operatorname{Var}\left(\frac{1}{\alpha_bN}\sum_{n=1}^{N}I_{b,n}\mid x_b,\alpha_b\right). B 2 ℓ η 2 b = 1 ∑ B Var ( α b N 1 n = 1 ∑ N I b , n ∣ x b , α b ) .
Since I b , n I_{b,n} I b , n are i.i.d.,
Var ( 1 α b N ∑ n = 1 N I b , n ∣ x b , α b ) = 1 α b 2 N 2 ∑ n = 1 N Var ( I b , n ∣ x b , α b ) = 1 α b 2 N P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) ( 1 − P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) ) . \begin{aligned}
\operatorname{Var}\left(\frac{1}{\alpha_bN}\sum_{n=1}^{N}I_{b,n}\mid x_b,\alpha_b\right)
=\frac{1}{\alpha_b^{2}N^{2}}\sum_{n=1}^{N}\operatorname{Var}(I_{b,n}\mid x_b,\alpha_b) \\
&=\frac{1}{\alpha_b^{2}N}\mathbb{P}_{y\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b)}\left(G(x_b,y;\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\right)
\left(1-\mathbb{P}_{y\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b)}\left(G(x_b,y;\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\right)\right).
\end{aligned} Var ( α b N 1 n = 1 ∑ N I b , n ∣ x b , α b ) = α b 2 N 2 1 n = 1 ∑ N Var ( I b , n ∣ x b , α b ) = α b 2 N 1 P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) ( 1 − P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) ) .
Since the quantity
P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) \mathbb{P}_{y\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b)}\left(G(x_b,y;\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\right) P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) )
is a probability in [ 0 , 1 ] [0,1] [ 0 , 1 ] , it satisfies P ( 1 − P ) ≤ 1 4 \mathbb{P}(1-\mathbb{P})\leq\frac{1}{4} P ( 1 − P ) ≤ 4 1 . We obtain
Var ( 1 α b N ∑ n = 1 N I b , n ∣ x b , α b ) ≤ 1 4 α b 2 N ≤ 1 4 α min 2 N . \operatorname{Var}\left(\frac{1}{\alpha_bN}\sum_{n=1}^{N}I_{b,n}\mid x_b,\alpha_b\right)\leq\frac{1}{4\alpha_b^{2}N}\leq\frac{1}{4\alpha_{\min}^{2}N}. Var ( α b N 1 n = 1 ∑ N I b , n ∣ x b , α b ) ≤ 4 α b 2 N 1 ≤ 4 α m i n 2 N 1 .
Therefore,
E ∥ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ∣ x 1 : B , α 1 : B ] ≤ ℓ η 2 4 B N α min 2 . \mathbb{E}\lVert\hat{g}_{\omega}(\theta,\omega)-\mathbb{E}[\hat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\rVert^{2}\mid x_{1:B},\alpha_{1:B}]
\le\frac{\ell_{\eta}^{2}}{4BN\alpha_{\min}^{2}}. E ∥ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ∣ x 1 : B , α 1 : B ] ≤ 4 B N α m i n 2 ℓ η 2 .
Taking expectation again gives
E [ ∥ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] ≤ ℓ η 2 4 B N α min 2 . \mathbb{E}\left[\lVert\hat{g}_{\omega}(\theta,\omega)-\mathbb{E}[\hat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\rVert^{2}\right]
\le\frac{\ell_{\eta}^{2}}{4BN\alpha_{\min}^{2}}. E [ ∥ g ^ ω ( θ , ω ) − E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] ≤ 4 B N α m i n 2 ℓ η 2 .
Now consider the second term,
E [ ∥ E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ∥ 2 ] . \mathbb{E}\left[\left\lVert\mathbb{E}[\hat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rVert^{2}\right]. E [ ∥ E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ∥ 2 ] .
From the unbiasedness calculation above,
E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] = 1 B ∑ b = 1 B ( 1 − P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b ) ) α b ) ∇ ω η ω ( x b , α b ) . \mathbb{E}[\hat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]
=\frac{1}{B}\sum_{b=1}^{B}\left(1-\frac{\mathbb{P}_{y\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b)}(G(x_b,y;\alpha_b)\le\eta_{\omega}(x_b,\alpha_b))}{\alpha_b}\right)\nabla_{\omega}\eta_{\omega}(x_b,\alpha_b). E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] = B 1 b = 1 ∑ B ( 1 − α b P y ∼ π θ ( ⋅ ∣ x b , α b ) ( G ( x b , y ; α b ) ≤ η ω ( x b , α b )) ) ∇ ω η ω ( x b , α b ) .
This is an average of B B B i.i.d. random vectors with mean ∇ ω J ( θ , ω ) \nabla_{\omega}\mathcal{J}(\theta,\omega) ∇ ω J ( θ , ω ) . Therefore,
E [ ∥ E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ∥ 2 ] = Σ ω 2 B , \mathbb{E}\left[\left\lVert\mathbb{E}[\hat{g}_{\omega}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rVert^{2}\right]
=\frac{\Sigma_{\omega}^{2}}{B}, E [ ∥ E [ g ^ ω ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ ω J ( θ , ω ) ∥ 2 ] = B Σ ω 2 ,
where
Σ ω 2 : = E x , α [ ∥ ( 1 − P y ( G ( x , y ; α ) ≤ η ω ( x , α ) ) α ) ∇ ω η ω ( x , α ) − ∇ ω J ( θ , ω ) ∥ 2 ] . \Sigma_{\omega}^{2}:=\mathbb{E}_{x,\alpha}\left[\left\lVert\left(1-\frac{\mathbb{P}_{y}(G(x,y;\alpha)\le\eta_{\omega}(x,\alpha))}{\alpha}\right)\nabla_{\omega}\eta_{\omega}(x,\alpha)-\nabla_{\omega}\mathcal{J}(\theta,\omega)\right\rVert^{2}\right]. Σ ω 2 := E x , α [ ( 1 − α P y ( G ( x , y ; α ) ≤ η ω ( x , α )) ) ∇ ω η ω ( x , α ) − ∇ ω J ( θ , ω ) 2 ] .
Combining the two bounds yields
E [ ∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] ≤ ℓ η 2 4 B N α min 2 + Σ ω 2 B . \mathbb{E}\left[\lVert\hat{g}_{\omega}(\theta,\omega)-\nabla_{\omega}\mathcal{J}(\theta,\omega)\rVert^{2}\right]\le\frac{\ell_{\eta}^{2}}{4BN\alpha_{\min}^{2}}+\frac{\Sigma_{\omega}^{2}}{B}. E [ ∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] ≤ 4 B N α m i n 2 ℓ η 2 + B Σ ω 2 .
Finally, since
0 ≤ P y ∼ π θ ( ⋅ ∣ x , α ) ( G ( x , y ; α ) ≤ η ω ( x , α ) ) ≤ 1 0\le\mathbb{P}_{y\sim\pi_{\theta}(\cdot\mid x,\alpha)}(G(x,y;\alpha)\le\eta_{\omega}(x,\alpha))\le1 0 ≤ P y ∼ π θ ( ⋅ ∣ x , α ) ( G ( x , y ; α ) ≤ η ω ( x , α )) ≤ 1
and α ≥ α min \alpha\ge\alpha_{\min} α ≥ α m i n , we have
∣ 1 − P y ∼ π θ ( ⋅ ∣ x , α ) ( G ( x , y ; α ) ≤ η ω ( x , α ) ) α ∣ ≤ 1 α ≤ 1 α min . \left\lvert1-\frac{\mathbb{P}_{y\sim\pi_{\theta}(\cdot\mid x,\alpha)}(G(x,y;\alpha)\le\eta_{\omega}(x,\alpha))}{\alpha}\right\rvert
\le\frac{1}{\alpha}\le\frac{1}{\alpha_{\min}}. 1 − α P y ∼ π θ ( ⋅ ∣ x , α ) ( G ( x , y ; α ) ≤ η ω ( x , α )) ≤ α 1 ≤ α m i n 1 .
Together with ∥ ∇ ω η ω ( x , α ) ∥ ≤ ℓ η \lVert\nabla_{\omega}\eta_{\omega}(x,\alpha)\rVert\le\ell_{\eta} ∥ ∇ ω η ω ( x , α )∥ ≤ ℓ η , this implies
∥ ∇ ω η ω ( x , α ) ∥ ≤ ℓ η α min . \lVert\nabla_{\omega}\eta_{\omega}(x,\alpha)\rVert\le\frac{\ell_{\eta}}{\alpha_{\min}}. ∥ ∇ ω η ω ( x , α )∥ ≤ α m i n ℓ η .
Hence
Σ ω 2 ≤ ℓ η 2 α min 2 , \Sigma_{\omega}^{2}\le\frac{\ell_{\eta}^{2}}{\alpha_{\min}^{2}}, Σ ω 2 ≤ α m i n 2 ℓ η 2 ,
and therefore
E [ ∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] ≤ ℓ η 2 4 B N α min 2 + ℓ η 2 B α min 2 . \mathbb{E}\left[\lVert\hat{g}_{\omega}(\theta,\omega)-\nabla_{\omega}\mathcal{J}(\theta,\omega)\rVert^{2}\right]
\le\frac{\ell_{\eta}^{2}}{4BN\alpha_{\min}^{2}}+\frac{\ell_{\eta}^{2}}{B\alpha_{\min}^{2}}. E [ ∥ g ^ ω ( θ , ω ) − ∇ ω J ( θ , ω ) ∥ 2 ] ≤ 4 B N α m i n 2 ℓ η 2 + B α m i n 2 ℓ η 2 .
Next, we state the proof for g ^ θ ( θ , ω ) \hat{g}_{\theta}(\theta,\omega) g ^ θ ( θ , ω ) . Since
u θ , ω ( x , y , α ) = η ω ( x , α ) − 1 α ( η ω ( x , α ) − G ( x , y ; α ) ) + u_{\theta,\omega}(x,y,\alpha)=\eta_{\omega}(x,\alpha)-\frac{1}{\alpha}\left(\eta_{\omega}(x,\alpha)-G(x,y;\alpha)\right)+ u θ , ω ( x , y , α ) = η ω ( x , α ) − α 1 ( η ω ( x , α ) − G ( x , y ; α ) ) +
If G ( x , y ; α ) > η ω ( x , α ) G(x,y;\alpha)>\eta_{\omega}(x,\alpha) G ( x , y ; α ) > η ω ( x , α ) , then
u θ , ω ( x , y , α ) = η ω ( x , α ) u_{\theta,\omega}(x,y,\alpha)=\eta_{\omega}(x,\alpha) u θ , ω ( x , y , α ) = η ω ( x , α )
and (Assumption 1)
∣ u θ , ω ( x , y , α ) − β α 1 { G ( x , y ; α ) ≤ η ω ( x , α ) } ∣ = ∣ η ω ( x , α ) ∣ ≤ M η . \left\lvert u_{\theta,\omega}(x,y,\alpha)-\frac{\beta}{\alpha}\mathbb{1}\{G(x,y;\alpha)\le\eta_{\omega}(x,\alpha)\}\right\rvert
=|\eta_{\omega}(x,\alpha)|\le M_{\eta}. u θ , ω ( x , y , α ) − α β 1 { G ( x , y ; α ) ≤ η ω ( x , α )} = ∣ η ω ( x , α ) ∣ ≤ M η .
If G ( x , y ; α ) ≤ η ω ( x , α ) G(x,y;\alpha)\le\eta_{\omega}(x,\alpha) G ( x , y ; α ) ≤ η ω ( x , α ) , then
u θ , ω ( x , y , α ) = ( 1 − 1 α ) η ω ( x , α ) + 1 α G ( x , y ; α ) . u_{\theta,\omega}(x,y,\alpha)=\left(1-\frac{1}{\alpha}\right)\eta_{\omega}(x,\alpha)+\frac{1}{\alpha}G(x,y;\alpha). u θ , ω ( x , y , α ) = ( 1 − α 1 ) η ω ( x , α ) + α 1 G ( x , y ; α ) .
Therefore,
u θ , ω ( x , y , α ) − β α = − 1 − α α η ω ( x , α ) + G ( x , y ; α ) − β α . u_{\theta,\omega}(x,y,\alpha)-\frac{\beta}{\alpha}
=-\frac{1-\alpha}{\alpha}\eta_{\omega}(x,\alpha)+\frac{G(x,y;\alpha)-\beta}{\alpha}. u θ , ω ( x , y , α ) − α β = − α 1 − α η ω ( x , α ) + α G ( x , y ; α ) − β .
Using ∣ η ω ( x , α ) ∣ ≤ M η |\eta_{\omega}(x,\alpha)|\le M_{\eta} ∣ η ω ( x , α ) ∣ ≤ M η (Assumption 1), ∣ G ( x , y ; α ) ∣ ≤ max { ∣ Z min ∣ , ∣ Z max ∣ } |G(x,y;\alpha)|\le\max\{|Z_{\min}|,|Z_{\max}|\} ∣ G ( x , y ; α ) ∣ ≤ max { ∣ Z m i n ∣ , ∣ Z m a x ∣ } (Assumption 4), and α ≥ α min \alpha\ge\alpha_{\min} α ≥ α m i n , we obtain
∣ u θ , ω ( x , y , α ) − β α ∣ ≤ M η 1 − α min α min + max { ∣ Z min ∣ , ∣ Z max ∣ } + β α min . \left\lvert u_{\theta,\omega}(x,y,\alpha)-\frac{\beta}{\alpha}\right\rvert
\le M_{\eta}\frac{1-\alpha_{\min}}{\alpha_{\min}}
+\frac{\max\{|Z_{\min}|,|Z_{\max}|\}+\beta}{\alpha_{\min}}. u θ , ω ( x , y , α ) − α β ≤ M η α m i n 1 − α m i n + α m i n max { ∣ Z m i n ∣ , ∣ Z m a x ∣ } + β .
Combining the two cases gives
∣ u θ , ω ( x , y , α ) − β α 1 { G ( x , y ; α ) ≤ η ω ( x , α ) } ∣ ≤ C A , \left\lvert u_{\theta,\omega}(x,y,\alpha)-\frac{\beta}{\alpha}\mathbb{1}\{G(x,y;\alpha)\le\eta_{\omega}(x,\alpha)\}\right\rvert
\le C_A, u θ , ω ( x , y , α ) − α β 1 { G ( x , y ; α ) ≤ η ω ( x , α )} ≤ C A ,
where
C A : = max { M η , 1 − α min α min + max { ∣ Z min ∣ , ∣ Z max ∣ } + β α min } . C_A := \max\left\{M_\eta,\frac{1-\alpha_{\min}}{\alpha_{\min}}+\frac{\max\{|Z_{\min}|,|Z_{\max}|\}+\beta}{\alpha_{\min}}\right\}. C A := max { M η , α m i n 1 − α m i n + α m i n max { ∣ Z m i n ∣ , ∣ Z m a x ∣ } + β } .
We first verify that g ^ θ ( θ , ω ) \hat{g}_\theta(\theta,\omega) g ^ θ ( θ , ω ) is unbiased. Conditioned on ( x b , α b ) (x_b,\alpha_b) ( x b , α b ) , the completions y b , 1 , … , y b , N y_{b,1},\ldots,y_{b,N} y b , 1 , … , y b , N are i.i.d. draws from π θ ( ⋅ ∣ x b , α b ) \pi_\theta(\cdot\mid x_b,\alpha_b) π θ ( ⋅ ∣ x b , α b ) . Therefore,
E [ [ 1 N ∑ n = 1 N ( u θ , ω ( x b , y b , n , α b ) − β α b 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b ) } ) ] ∇ θ log π θ ( y b , n ∣ x b , α b ) ∣ x b , α b ] = E y ∼ π θ ( ⋅ ∣ x b , α b ) [ ( u θ , ω ( x b , y , α b ) − β α b 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b ) } ) ∇ θ log π θ ( y ∣ x b , α b ) ] . \begin{aligned}
\mathbb{E}\left[\left.\left[\frac{1}{N}\sum_{n=1}^{N}\left(u_{\theta,\omega}(x_b,y_{b,n},\alpha_b)-\frac{\beta}{\alpha_b}\mathbf{1}\{G(x_b,y_{b,n};\alpha_b)\leq\eta_\omega(x_b,\alpha_b)\}\right)\right]\nabla_\theta\log\pi_\theta(y_{b,n}\mid x_b,\alpha_b)\right|x_b,\alpha_b\right] \\
&=\mathbb{E}_{y\sim\pi_\theta(\cdot\mid x_b,\alpha_b)}\left[\left(u_{\theta,\omega}(x_b,y,\alpha_b)-\frac{\beta}{\alpha_b}\mathbf{1}\{G(x_b,y;\alpha_b)\leq\eta_\omega(x_b,\alpha_b)\}\right)\nabla_\theta\log\pi_\theta(y\mid x_b,\alpha_b)\right].
\end{aligned} E [ [ N 1 n = 1 ∑ N ( u θ , ω ( x b , y b , n , α b ) − α b β 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b )} ) ] ∇ θ log π θ ( y b , n ∣ x b , α b ) x b , α b ] = E y ∼ π θ ( ⋅ ∣ x b , α b ) [ ( u θ , ω ( x b , y , α b ) − α b β 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b )} ) ∇ θ log π θ ( y ∣ x b , α b ) ] .
Hence
E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] = 1 B ∑ b = 1 B E y ∼ π θ ( ⋅ ∣ x b , α b ) [ ( u θ , ω ( x b , y , α b ) − β α b 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b ) } ) ∇ θ log π θ ( y ∣ x b , α b ) ] . \mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]
=\frac{1}{B}\sum_{b=1}^{B}\mathbb{E}_{y\sim\pi_\theta(\cdot\mid x_b,\alpha_b)}\left[\left(u_{\theta,\omega}(x_b,y,\alpha_b)-\frac{\beta}{\alpha_b}\mathbf{1}\{G(x_b,y;\alpha_b)\leq\eta_\omega(x_b,\alpha_b)\}\right)\nabla_\theta\log\pi_\theta(y\mid x_b,\alpha_b)\right]. E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] = B 1 b = 1 ∑ B E y ∼ π θ ( ⋅ ∣ x b , α b ) [ ( u θ , ω ( x b , y , α b ) − α b β 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b )} ) ∇ θ log π θ ( y ∣ x b , α b ) ] .
Taking expectation again over ( x b , α b ) (x_b,\alpha_b) ( x b , α b ) gives
E [ g ^ θ ( θ , ω ) ] = ∇ θ J ( θ , ω ) . \mathbb{E}[\hat{g}_\theta(\theta,\omega)]=\nabla_\theta J(\theta,\omega). E [ g ^ θ ( θ , ω )] = ∇ θ J ( θ , ω ) .
Thus g ^ θ ( θ , ω ) \hat{g}_\theta(\theta,\omega) g ^ θ ( θ , ω ) is unbiased. Next, we bound
E [ ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] . \mathbb{E}\left[\left\|\hat{g}_\theta(\theta,\omega)-\nabla_\theta J(\theta,\omega)\right\|^2\right]. E [ ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] .
We write
g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) = ( g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ) + ( E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ) . \hat{g}_\theta(\theta,\omega)-\nabla_\theta J(\theta,\omega)
=\left(\hat{g}_\theta(\theta,\omega)-\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\right)
+\left(\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\theta J(\theta,\omega)\right). g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) = ( g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ) + ( E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ) .
Therefore,
∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 = ∥ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 + ∥ E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ∥ 2 + 2 ⟨ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ⟩ . \begin{aligned}
\left\|\hat{g}_\theta(\theta,\omega)-\nabla_\theta J(\theta,\omega)\right\|^2
={}&\left\|\hat{g}_\theta(\theta,\omega)-\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\right\|^2\\
&+\left\|\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\theta J(\theta,\omega)\right\|^2\\
&+2\left\langle\hat{g}_\theta(\theta,\omega)-\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}],\right.\\
&\qquad\left.\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\theta J(\theta,\omega)\right\rangle.
\end{aligned} ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 = ∥ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 + ∥ E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ∥ 2 + 2 ⟨ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ⟩ .
Taking expectation on both sides yields
E [ ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] = E [ ∥ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] + E [ ∥ E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ∥ 2 ] + 2 E [ ⟨ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ⟩ ] . \begin{aligned}
\mathbb{E}\left[\left\|\hat{g}_\theta(\theta,\omega)-\nabla_\theta J(\theta,\omega)\right\|^2\right]
={}&\mathbb{E}\left[\left\|\hat{g}_\theta(\theta,\omega)-\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\right\|^2\right]\\
&+\mathbb{E}\left[\left\|\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\theta J(\theta,\omega)\right\|^2\right]\\
&+2\mathbb{E}\left[\left\langle\hat{g}_\theta(\theta,\omega)-\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}],\right.\right.\\
&\qquad\left.\left.\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\theta J(\theta,\omega)\right\rangle\right].
\end{aligned} E [ ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] = E [ ∥ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] + E [ ∥ E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ∥ 2 ] + 2 E [ ⟨ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ⟩ ] .
Now consider the last term. By the tower property of conditional expectation,
E [ ⟨ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ⟩ ] = E [ E [ ⟨ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ⟩ | x 1 : B , α 1 : B ] ] . \begin{aligned}
\mathbb{E}\left[\left\langle\hat{g}_\theta(\theta,\omega)-\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}],\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\theta J(\theta,\omega)\right\rangle\right] \\
&=\mathbb{E}\left[\mathbb{E}\left[\left\langle\hat{g}_\theta(\theta,\omega)-\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}],\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\theta J(\theta,\omega)\right\rangle\middle|x_{1:B},\alpha_{1:B}\right]\right].
\end{aligned} E [ ⟨ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ⟩ ] = E [ E [ ⟨ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] , E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ⟩ ∣ x 1 : B , α 1 : B ] ] .
Conditioned on ( x 1 : B , α 1 : B ) (x_{1:B},\alpha_{1:B}) ( x 1 : B , α 1 : B ) , the vector E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) \mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\theta J(\theta,\omega) E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) is deterministic, so it can be taken outside the inner conditional expectation. Thus the above is equal to
E [ ⟨ E [ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] | x 1 : B , α 1 : B ] , E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ⟩ ] . \mathbb{E}\left[\left\langle\mathbb{E}\left[\hat{g}_\theta(\theta,\omega)-\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\middle|x_{1:B},\alpha_{1:B}\right],\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\theta J(\theta,\omega)\right\rangle\right]. E [ ⟨ E [ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∣ x 1 : B , α 1 : B ] , E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ⟩ ] .
E [ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] | x 1 : B , α 1 : B ] = 0. \mathbb{E}\left[\hat{g}_\theta(\theta,\omega)-\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\middle|x_{1:B},\alpha_{1:B}\right]=0. E [ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∣ x 1 : B , α 1 : B ] = 0.
Hence the cross term is zero, and therefore
E [ ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] = E [ ∥ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] + E [ ∥ E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ∥ 2 ] . \mathbb{E}\left[\left\|\hat{g}_\theta(\theta,\omega)-\nabla_\theta J(\theta,\omega)\right\|^2\right]
=\mathbb{E}\left[\left\|\hat{g}_\theta(\theta,\omega)-\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\right\|^2\right]
+\mathbb{E}\left[\left\|\mathbb{E}[\hat{g}_\theta(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_\theta J(\theta,\omega)\right\|^2\right]. E [ ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] = E [ ∥ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] + E [ ∥ E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ∥ 2 ] .
We bound these two terms separately. For the first term, conditioned on ( x 1 : B , α 1 : B ) (x_{1:B}, \alpha_{1:B}) ( x 1 : B , α 1 : B ) , we have
g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] = 1 B ∑ b = 1 B [ 1 N ∑ n = 1 N ( u θ , ω ( x b , y b , n , α b ) − β α b 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b ) } ) ∇ θ log π θ ( y b , n ∣ x b , α b ) − E y ∼ π θ ( ⋅ ∣ x b , α b ) [ ( u θ , ω ( x b , y , α b ) − β α b 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b ) } ) ∇ θ log π θ ( y ∣ x b , α b ) ] ] . \widehat{g}_{\theta}(\theta,\omega)-\mathbb{E}[\widehat{g}_{\theta}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]
= \frac{1}{B}\sum_{b=1}^{B}\left[\frac{1}{N}\sum_{n=1}^{N}\left(u_{\theta,\omega}(x_b,y_{b,n},\alpha_b)-\frac{\beta}{\alpha_b}\mathbf{1}\{G(x_b,y_{b,n};\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\}\right)\nabla_{\theta}\log\pi_{\theta}(y_{b,n}\mid x_b,\alpha_b)-\mathbb{E}_{y\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b)}\left[\left(u_{\theta,\omega}(x_b,y,\alpha_b)-\frac{\beta}{\alpha_b}\mathbf{1}\{G(x_b,y;\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\}\right)\nabla_{\theta}\log\pi_{\theta}(y\mid x_b,\alpha_b)\right]\right]. g θ ( θ , ω ) − E [ g θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] = B 1 b = 1 ∑ B [ N 1 n = 1 ∑ N ( u θ , ω ( x b , y b , n , α b ) − α b β 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b )} ) ∇ θ log π θ ( y b , n ∣ x b , α b ) − E y ∼ π θ ( ⋅ ∣ x b , α b ) [ ( u θ , ω ( x b , y , α b ) − α b β 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b )} ) ∇ θ log π θ ( y ∣ x b , α b ) ] ] .
Because the completions are independent across b b b , the cross terms vanish after taking conditional expectation. Hence
E [ ∥ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 | x 1 : B , α 1 : B ] = 1 B 2 ∑ b = 1 B E [ ∥ 1 N ∑ n = 1 N ( u θ , ω ( x b , y b , n , α b ) − β α b 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b ) } ) ∇ θ log π θ ( y b , n ∣ x b , α b ) − E y ∼ π θ ( ⋅ ∣ x b , α b ) [ ( u θ , ω ( x b , y , α b ) − β α b 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b ) } ) ∇ θ log π θ ( y ∣ x b , α b ) ] ∥ 2 | x 1 : B , α 1 : B ] . \mathbb{E}\left[\left\|\widehat{g}_{\theta}(\theta,\omega)-\mathbb{E}[\widehat{g}_{\theta}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\right\|^{2}\,\middle|\,x_{1:B},\alpha_{1:B}\right]
= \frac{1}{B^{2}}\sum_{b=1}^{B}\mathbb{E}\left[\left\|\frac{1}{N}\sum_{n=1}^{N}\left(u_{\theta,\omega}(x_b,y_{b,n},\alpha_b)-\frac{\beta}{\alpha_b}\mathbf{1}\{G(x_b,y_{b,n};\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\}\right)\nabla_{\theta}\log\pi_{\theta}(y_{b,n}\mid x_b,\alpha_b)-\mathbb{E}_{y\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b)}\left[\left(u_{\theta,\omega}(x_b,y,\alpha_b)-\frac{\beta}{\alpha_b}\mathbf{1}\{G(x_b,y;\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\}\right)\nabla_{\theta}\log\pi_{\theta}(y\mid x_b,\alpha_b)\right]\right\|^{2}\,\middle|\,x_{1:B},\alpha_{1:B}\right]. E [ ∥ g θ ( θ , ω ) − E [ g θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 x 1 : B , α 1 : B ] = B 2 1 b = 1 ∑ B E N 1 n = 1 ∑ N ( u θ , ω ( x b , y b , n , α b ) − α b β 1 { G ( x b , y b , n ; α b ) ≤ η ω ( x b , α b )} ) ∇ θ log π θ ( y b , n ∣ x b , α b ) − E y ∼ π θ ( ⋅ ∣ x b , α b ) [ ( u θ , ω ( x b , y , α b ) − α b β 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b )} ) ∇ θ log π θ ( y ∣ x b , α b ) ] 2 x 1 : B , α 1 : B .
For each sample,
∣ u θ , ω ( x b , y , α b ) − β α b 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b ) } ∣ ≤ C A \left|u_{\theta,\omega}(x_b,y,\alpha_b)-\frac{\beta}{\alpha_b}\mathbf{1}\{G(x_b,y;\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\}\right|\leq C_A u θ , ω ( x b , y , α b ) − α b β 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b )} ≤ C A
and
∥ ∇ θ log π θ ( y ∣ x b , α b ) ∥ ≤ ℓ π . \left\|\nabla_{\theta}\log\pi_{\theta}(y\mid x_b,\alpha_b)\right\|\leq\ell_{\pi}. ∥ ∇ θ log π θ ( y ∣ x b , α b ) ∥ ≤ ℓ π .
Hence every summand is bounded in norm by C A ℓ π C_A\ell_{\pi} C A ℓ π . Therefore,
E [ ∥ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 | x 1 : B , α 1 : B ] ≤ C A 2 ℓ π 2 B N . \mathbb{E}\left[\left\|\widehat{g}_{\theta}(\theta,\omega)-\mathbb{E}[\widehat{g}_{\theta}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\right\|^{2}\,\middle|\,x_{1:B},\alpha_{1:B}\right]\leq\frac{C_A^{2}\ell_{\pi}^{2}}{BN}. E [ ∥ g θ ( θ , ω ) − E [ g θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 x 1 : B , α 1 : B ] ≤ B N C A 2 ℓ π 2 .
Taking expectation again gives
E [ ∥ g ^ θ ( θ , ω ) − E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] ≤ C A 2 ℓ π 2 B N . \mathbb{E}\left[\left\|\widehat{g}_{\theta}(\theta,\omega)-\mathbb{E}[\widehat{g}_{\theta}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]\right\|^{2}\right]\leq\frac{C_A^{2}\ell_{\pi}^{2}}{BN}. E [ ∥ g θ ( θ , ω ) − E [ g θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] ∥ 2 ] ≤ B N C A 2 ℓ π 2 .
Now consider the second term,
E [ ∥ E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ∥ 2 ] . \mathbb{E}\left[\left\|\mathbb{E}[\widehat{g}_{\theta}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_{\theta}J(\theta,\omega)\right\|^{2}\right]. E [ ∥ E [ g θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ∥ 2 ] .
From the unbiasedness calculation above,
E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] = 1 B ∑ b = 1 B E y ∼ π θ ( ⋅ ∣ x b , α b ) [ ( u θ , ω ( x b , y , α b ) − β α b 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b ) } ) ∇ θ log π θ ( y ∣ x b , α b ) ] . \mathbb{E}[\widehat{g}_{\theta}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]
=\frac{1}{B}\sum_{b=1}^{B}\mathbb{E}_{y\sim\pi_{\theta}(\cdot\mid x_b,\alpha_b)}\left[\left(u_{\theta,\omega}(x_b,y,\alpha_b)-\frac{\beta}{\alpha_b}\mathbf{1}\{G(x_b,y;\alpha_b)\leq\eta_{\omega}(x_b,\alpha_b)\}\right)\nabla_{\theta}\log\pi_{\theta}(y\mid x_b,\alpha_b)\right]. E [ g θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] = B 1 b = 1 ∑ B E y ∼ π θ ( ⋅ ∣ x b , α b ) [ ( u θ , ω ( x b , y , α b ) − α b β 1 { G ( x b , y ; α b ) ≤ η ω ( x b , α b )} ) ∇ θ log π θ ( y ∣ x b , α b ) ] .
This is an average of B B B i.i.d. random vectors with mean ∇ θ J ( θ , ω ) \nabla_{\theta}J(\theta,\omega) ∇ θ J ( θ , ω ) . Therefore,
E [ ∥ E [ g ^ θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ∥ 2 ] = Σ θ 2 B . \mathbb{E}\left[\left\|\mathbb{E}[\widehat{g}_{\theta}(\theta,\omega)\mid x_{1:B},\alpha_{1:B}]-\nabla_{\theta}J(\theta,\omega)\right\|^{2}\right]=\frac{\Sigma_{\theta}^{2}}{B}. E [ ∥ E [ g θ ( θ , ω ) ∣ x 1 : B , α 1 : B ] − ∇ θ J ( θ , ω ) ∥ 2 ] = B Σ θ 2 .
where
Σ θ 2 : = E x , α [ ∥ E y ∼ π θ ( ⋅ ∣ x , α ) [ ( u θ , ω ( x , y , α ) − β α 1 { G ( x , y ; α ) ≤ η ω ( x , α ) } ) ∇ θ log π θ ( y ∣ x , α ) ] − ∇ θ J ( θ , ω ) ∥ 2 ] . \Sigma_{\theta}^{2}:=\mathbb{E}_{x,\alpha}\left[\left\|\mathbb{E}_{y\sim\pi_{\theta}(\cdot\mid x,\alpha)}\left[\left(u_{\theta,\omega}(x,y,\alpha)-\frac{\beta}{\alpha}\mathbf{1}\{G(x,y;\alpha)\leq\eta_{\omega}(x,\alpha)\}\right)\nabla_{\theta}\log\pi_{\theta}(y\mid x,\alpha)\right]-\nabla_{\theta}J(\theta,\omega)\right\|^{2}\right]. Σ θ 2 := E x , α [ E y ∼ π θ ( ⋅ ∣ x , α ) [ ( u θ , ω ( x , y , α ) − α β 1 { G ( x , y ; α ) ≤ η ω ( x , α )} ) ∇ θ log π θ ( y ∣ x , α ) ] − ∇ θ J ( θ , ω ) 2 ] .
Combining the two bounds yields
E [ ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] ≤ C A 2 ℓ π 2 B N + Σ θ 2 B . \mathbb{E}\left[\left\|\widehat{g}_{\theta}(\theta,\omega)-\nabla_{\theta}J(\theta,\omega)\right\|^{2}\right]\leq\frac{C_A^{2}\ell_{\pi}^{2}}{BN}+\frac{\Sigma_{\theta}^{2}}{B}. E [ ∥ g θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] ≤ B N C A 2 ℓ π 2 + B Σ θ 2 .
Finally, since
∣ u θ , ω ( x , y , α ) − β α 1 { G ( x , y ; α ) ≤ η ω ( x , α ) } ∣ ≤ C A \left|u_{\theta,\omega}(x,y,\alpha)-\frac{\beta}{\alpha}\mathbf{1}\{G(x,y;\alpha)\leq\eta_{\omega}(x,\alpha)\}\right|\leq C_A u θ , ω ( x , y , α ) − α β 1 { G ( x , y ; α ) ≤ η ω ( x , α )} ≤ C A
and
∥ ∇ θ log π θ ( y ∣ x , α ) ∥ ≤ ℓ π , \left\|\nabla_{\theta}\log\pi_{\theta}(y\mid x,\alpha)\right\|\leq\ell_{\pi}, ∥ ∇ θ log π θ ( y ∣ x , α ) ∥ ≤ ℓ π ,
we have
∥ E y ∼ π θ ( ⋅ ∣ x , α ) [ ( u θ , ω ( x , y , α ) − β α 1 { G ( x , y ; α ) ≤ η ω ( x , α ) } ) ∇ θ log π θ ( y ∣ x , α ) ] ∥ ≤ C A ℓ π . \left\|\mathbb{E}_{y\sim\pi_{\theta}(\cdot\mid x,\alpha)}\left[\left(u_{\theta,\omega}(x,y,\alpha)-\frac{\beta}{\alpha}\mathbf{1}\{G(x,y;\alpha)\leq\eta_{\omega}(x,\alpha)\}\right)\nabla_{\theta}\log\pi_{\theta}(y\mid x,\alpha)\right]\right\|\leq C_A\ell_{\pi}. E y ∼ π θ ( ⋅ ∣ x , α ) [ ( u θ , ω ( x , y , α ) − α β 1 { G ( x , y ; α ) ≤ η ω ( x , α )} ) ∇ θ log π θ ( y ∣ x , α ) ] ≤ C A ℓ π .
Hence
Σ θ 2 ≤ C A 2 ℓ π 2 . \Sigma_\theta^2 \le C_A^2\ell_\pi^2. Σ θ 2 ≤ C A 2 ℓ π 2 .
and therefore
E [ ∥ g ^ θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] ≤ C A 2 ℓ π 2 B N + C A 2 ℓ π 2 B . \mathbb{E}\left[\left\|\widehat{g}_\theta(\theta,\omega)-\nabla_\theta\mathcal{J}(\theta,\omega)\right\|^2\right]\le\frac{C_A^2\ell_\pi^2}{BN}+\frac{C_A^2\ell_\pi^2}{B}. E [ ∥ g θ ( θ , ω ) − ∇ θ J ( θ , ω ) ∥ 2 ] ≤ B N C A 2 ℓ π 2 + B C A 2 ℓ π 2 .
This completes the proof.
Analysis of Algorithm 1
Convergence Analysis of Algorithm 1. Recall that
J ( θ , ω ) : = E α , x [ η ω ( x , α ) − 1 α E Y ∼ π θ ( η ω ( x , α ) − G ( x , Y ; α ) ) + ] \mathcal{J}(\theta,\omega):=\mathbb{E}_{\alpha,x}\left[\eta_\omega(x,\alpha)-\frac{1}{\alpha}\mathbb{E}_{Y\sim\pi_\theta}\left(\eta_\omega(x,\alpha)-G(x,Y;\alpha)\right)_+\right] J ( θ , ω ) := E α , x [ η ω ( x , α ) − α 1 E Y ∼ π θ ( η ω ( x , α ) − G ( x , Y ; α ) ) + ]
and our optimization problem is
max θ , ω J ( θ , ω ) \max_{\theta,\omega}\mathcal{J}(\theta,\omega) θ , ω max J ( θ , ω )
Since J \mathcal{J} J contains a hinge term ( η − G ) + (\eta-G)_+ ( η − G ) + , the optimization objective is generally nonsmooth. We analyze Algorithm 1 as a stochastic subgradient method for the equivalent minimization problem
min θ , ω F ( θ , ω ) : = − max θ , ω J ( θ , ω ) . \min_{\theta,\omega}F(\theta,\omega):=-\max_{\theta,\omega}\mathcal{J}(\theta,\omega). θ , ω min F ( θ , ω ) := − θ , ω max J ( θ , ω ) .
Let ϕ = ( θ , ω ) \phi=(\theta,\omega) ϕ = ( θ , ω ) . For λ > 0 \lambda>0 λ > 0 , define the Moreau envelope of F F F by
F λ ( ϕ ) : = min ϕ ′ { F ( ϕ ′ ) + 1 2 λ ∥ ϕ ′ − ϕ ∥ 2 } . F_\lambda(\phi):=\min_{\phi'}\left\{F(\phi')+\frac{1}{2\lambda}\|\phi'-\phi\|^2\right\}. F λ ( ϕ ) := ϕ ′ min { F ( ϕ ′ ) + 2 λ 1 ∥ ϕ ′ − ϕ ∥ 2 } .
The Moreau envelope gradient ∇ F λ ( ϕ ) \nabla F_\lambda(\phi) ∇ F λ ( ϕ ) is a standard stationarity measure for weakly convex nonsmooth objectives ([24 , 25 ] ). Next, we make the following assumptions:
Assumption 5. On the domains visited by Algorithm 1, the threshold network η ω \eta_\omega η ω and the regularized return G G G have uniformly Lipschitz gradients with respect to their parameters. Specifically, there exist constants L η , L G < ∞ L_\eta,L_G<\infty L η , L G < ∞ such that, for all prompts x x x , completions y y y , risk levels α ∈ [ α min , α max ] \alpha\in[\alpha_{\min},\alpha_{\max}] α ∈ [ α m i n , α m a x ] , and parameter values ω , ω ′ , θ , θ ′ \omega,\omega',\theta,\theta' ω , ω ′ , θ , θ ′ visited by the algorithm,
∥ ∇ ω η ω ( x , α ) − ∇ ω η ω ′ ( x , α ) ∥ ≤ L η ∥ ω − ω ′ ∥ , \left\|\nabla_\omega\eta_\omega(x,\alpha)-\nabla_\omega\eta_{\omega'}(x,\alpha)\right\|\le L_\eta\|\omega-\omega'\|, ∥ ∇ ω η ω ( x , α ) − ∇ ω η ω ′ ( x , α ) ∥ ≤ L η ∥ ω − ω ′ ∥ ,
and
∥ ∇ θ G ( x , y ; α ) ∣ θ − ∇ θ G ( x , y ; α ) ∣ θ ′ ∥ ≤ L G ∥ θ − θ ′ ∥ . \left\|\left.\nabla_\theta G(x,y;\alpha)\right|_\theta-\left.\nabla_\theta G(x,y;\alpha)\right|_{\theta'}\right\|\le L_G\|\theta-\theta'\|. ∥ ∇ θ G ( x , y ; α ) ∣ θ − ∇ θ G ( x , y ; α ) ∣ θ ′ ∥ ≤ L G ∥ θ − θ ′ ∥.
Here G ( x , y ; α ) ∣ θ G(x,y;\alpha)|_\theta G ( x , y ; α ) ∣ θ denotes the regularized return
G ( x , y ; α ) ∣ θ = r ( x , y ) − β log π θ ( y ∣ x , α ) π r e f ( y ∣ x ) G(x,y;\alpha)|_\theta=r(x,y)-\beta\log\frac{\pi_\theta(y\mid x,\alpha)}{\pi_{\mathrm{ref}}(y\mid x)} G ( x , y ; α ) ∣ θ = r ( x , y ) − β log π ref ( y ∣ x ) π θ ( y ∣ x , α )
evaluated using policy parameter θ \theta θ , with the completion y y y held fixed.
This is a standard regularity assumption and has been widely used in optimization analyses (Chen et al., [15 ] ).
Assumption 6. The function F ( ϕ ) = − J ( ϕ ) F(\phi)=-\mathcal{J}(\phi) F ( ϕ ) = − J ( ϕ ) is ρ \rho ρ -weakly convex. That is, ∀ ϕ , ϕ ′ , ∀ v ∈ ∂ F ( ϕ ) \forall\phi,\phi',\ \forall v\in\partial F(\phi) ∀ ϕ , ϕ ′ , ∀ v ∈ ∂ F ( ϕ )
F ( ϕ ′ ) ≥ F ( ϕ ) + ⟨ v , ϕ ′ − ϕ ⟩ − ρ 2 ∥ ϕ ′ − ϕ ∥ 2 . F(\phi')\ge F(\phi)+\langle v,\phi'-\phi\rangle-\frac{\rho}{2}\|\phi'-\phi\|^2. F ( ϕ ′ ) ≥ F ( ϕ ) + ⟨ v , ϕ ′ − ϕ ⟩ − 2 ρ ∥ ϕ ′ − ϕ ∥ 2 .
Remark. Assumption 6 is natural for the hard-hinge CVaR objective J \mathcal{J} J . Recall that the nonsmooth component of F F F has the form
1 α ( η ω ( x , α ) − G ( x , y ; α ) ) + . \frac{1}{\alpha}\left(\eta_\omega(x,\alpha)-G(x,y;\alpha)\right)_+. α 1 ( η ω ( x , α ) − G ( x , y ; α ) ) + .
Let
h ( z ) = z + , c x , y , α ( ϕ ) = η ω ( x , α ) − G ( x , y ; α ) . h(z)=z_+,\quad c_{x,y,\alpha}(\phi)=\eta_\omega(x,\alpha)-G(x,y;\alpha). h ( z ) = z + , c x , y , α ( ϕ ) = η ω ( x , α ) − G ( x , y ; α ) .
The hinge function h h h is convex and 1-Lipschitz. Moreover, Assumption 5 implies that c x , y , α c_{x,y,\alpha} c x , y , α has Lipschitz continuous gradient. Indeed, since
∇ ϕ c x , y , α ( ϕ ) = ( − ∇ θ G ( x , y ; α ) ∣ θ , ∇ ω η ω ( x , α ) ) , \nabla_\phi c_{x,y,\alpha}(\phi)=\left(-\left.\nabla_\theta G(x,y;\alpha)\right|_\theta,\nabla_\omega\eta_\omega(x,\alpha)\right), ∇ ϕ c x , y , α ( ϕ ) = ( − ∇ θ G ( x , y ; α ) ∣ θ , ∇ ω η ω ( x , α ) ) ,
Assumption 5 gives, for any ϕ = ( θ , ω ) \phi=(\theta,\omega) ϕ = ( θ , ω ) and ϕ ′ = ( θ ′ , ω ′ ) \phi'=(\theta',\omega') ϕ ′ = ( θ ′ , ω ′ ) ,
∥ ∇ ϕ c x , y , α ( ϕ ) − ∇ ϕ c x , y , α ( ϕ ′ ) ∥ 2 = ∥ ∇ θ G ( x , y ; α ) ∣ θ − ∇ θ G ( x , y ; α ) ∣ θ ′ ∥ 2 + ∥ ∇ ω η ω ( x , α ) − ∇ ω η ω ′ ( x , α ) ∥ 2 ≤ L G 2 ∥ θ − θ ′ ∥ 2 + L η 2 ∥ ω − ω ′ ∥ 2 ≤ max { L G 2 , L η 2 } ∥ ϕ − ϕ ′ ∥ 2 . \begin{aligned}
\left\|\nabla_\phi c_{x,y,\alpha}(\phi)-\nabla_\phi c_{x,y,\alpha}(\phi')\right\|^2
&=\left\|\left.\nabla_\theta G(x,y;\alpha)\right|_\theta-\left.\nabla_\theta G(x,y;\alpha)\right|_{\theta'}\right\|^2\\
&\quad+\left\|\nabla_\omega\eta_\omega(x,\alpha)-\nabla_\omega\eta_{\omega'}(x,\alpha)\right\|^2\\
&\le L_G^2\|\theta-\theta'\|^2+L_\eta^2\|\omega-\omega'\|^2\\
&\le\max\{L_G^2,L_\eta^2\}\|\phi-\phi'\|^2.
\end{aligned} ∥ ∇ ϕ c x , y , α ( ϕ ) − ∇ ϕ c x , y , α ( ϕ ′ ) ∥ 2 = ∥ ∇ θ G ( x , y ; α ) ∣ θ − ∇ θ G ( x , y ; α ) ∣ θ ′ ∥ 2 + ∥ ∇ ω η ω ( x , α ) − ∇ ω η ω ′ ( x , α ) ∥ 2 ≤ L G 2 ∥ θ − θ ′ ∥ 2 + L η 2 ∥ ω − ω ′ ∥ 2 ≤ max { L G 2 , L η 2 } ∥ ϕ − ϕ ′ ∥ 2 .
Thus c x , y , α c_{x,y,\alpha} c x , y , α has Lipschitz continuous gradient with constant
L c : = max { L G , L η } . L_c:=\max\{L_G,L_\eta\}. L c := max { L G , L η } .
By Lemma 4.2 of (Drusvyatskiy and Paquette, [28 ] ), if h h h is convex and Lipschitz and c c c is smooth with Lipschitz Jacobian, then h ∘ c h\circ c h ∘ c is weakly convex. Therefore,
( η ω ( x , α ) − G ( x , y ; α ) ) + = h ( c x , y , α ( ϕ ) ) \left(\eta_\omega(x,\alpha)-G(x,y;\alpha)\right)_+=h\left(c_{x,y,\alpha}(\phi)\right) ( η ω ( x , α ) − G ( x , y ; α ) ) + = h ( c x , y , α ( ϕ ) )
is L c L_c L c -weakly convex in ϕ \phi ϕ . After scaling by 1 / α ≤ 1 / α min 1/\alpha\le1/\alpha_{\min} 1/ α ≤ 1/ α m i n , the hinge component is L c / α min L_c/\alpha_{\min} L c / α m i n -weakly convex. Taking expectations preserves weak convexity. The remaining explicit term in F = − J F=-\mathcal{J} F = − J is − η ω ( x , α ) -\eta_\omega(x,\alpha) − η ω ( x , α ) . By Assumption 5, η ω ( x , α ) \eta_\omega(x,\alpha) η ω ( x , α ) has L η L_\eta L η -Lipschitz gradient, and therefore − η ω ( x , α ) -\eta_\omega(x,\alpha) − η ω ( x , α ) is L η L_\eta L η -weakly convex. Consequently, F = − J F=-\mathcal{J} F = − J is weakly convex.
Assumption 7. There exists F ⋆ > − ∞ F_\star>-\infty F ⋆ > − ∞ such that
F ( ϕ ) ≥ F ⋆ F(\phi) \ge F_\star F ( ϕ ) ≥ F ⋆ for all iterates generated by Algorithm 1.
This is a standard assumption in convergence analysis, ensuring that the objective is bounded below along the optimization trajectory.
The convergence analysis for weakly convex nonsmooth objectives requires the stochastic update direction to be a valid generalized subgradient of the objective. Since the hard-hinge term in J \mathcal{J} J is nondifferentiable when G ( x , y ; α ) = η ω ( x , α ) G(x,y;\alpha)=\eta_\omega(x,\alpha) G ( x , y ; α ) = η ω ( x , α ) , we use the Clarke subdifferential to justify that the indicator-based update in Algorithm 1 is still a valid stochastic subgradient.
Lemma 1. Let
g ^ t = ( g ^ θ , t , g ^ ω , t ) , \hat{g}_t=(\hat{g}_{\theta,t},\hat{g}_{\omega,t}), g ^ t = ( g ^ θ , t , g ^ ω , t ) , denote the stochastic ascent direction used by Algorithm 1, and define the stochastic descent direction for F = − J F=-\mathcal{J} F = − J as
ξ t = − g ^ t . \xi_t=-\hat{g}_t. ξ t = − g ^ t . Then
E t [ ξ t ] ∈ ∂ F ( ϕ t ) , \mathbb{E}_t[\xi_t]\in\partial F(\phi_t), E t [ ξ t ] ∈ ∂ F ( ϕ t ) , where ∂ F \partial F ∂ F denotes the Clarke subdifferential.
Proof. Recall that
F ( ϕ ) = − J ( ϕ ) , ϕ = ( θ , ω ) . F(\phi)=-\mathcal{J}(\phi),\qquad\phi=(\theta,\omega). F ( ϕ ) = − J ( ϕ ) , ϕ = ( θ , ω ) .
Algorithm 1 performs stochastic ascent on J \mathcal{J} J . Equivalently, it performs stochastic descent on F = − J F=-\mathcal{J} F = − J . Since
ξ t = − g ^ t , \xi_t=-\hat{g}_t, ξ t = − g ^ t ,
we have
E t [ ξ t ] = − E t [ g ^ t ] . \mathbb{E}_t[\xi_t]=-\mathbb{E}_t[\hat{g}_t]. E t [ ξ t ] = − E t [ g ^ t ] .
We first show that E t [ g ^ t ] \mathbb{E}_t[\hat{g}_t] E t [ g ^ t ] is a valid subgradient of J \mathcal{J} J . To do this, we first introduce the Clarke subdifferential, which is a standard generalized derivative for locally Lipschitz nonsmooth functions (Clarke, 1990; Rockafellar and Wets, 1998). Intuitively, at points where the function is differentiable, the Clarke subdifferential reduces to the ordinary gradient. At nondifferentiable points, it collects all limiting first-order directions that can arise from nearby differentiable points. In our objective J \mathcal{J} J , the only nonsmooth term is the hard-hinge term
( η ω ( x , α ) − G ( x , y ; α ) ) + . \left(\eta_\omega(x,\alpha)-G(x,y;\alpha)\right)_+. ( η ω ( x , α ) − G ( x , y ; α ) ) + .
For fixed ( x , y , α ) (x,y,\alpha) ( x , y , α ) , define
z ( ϕ ) = η ω ( x , α ) − G ( x , y ; α ) . z(\phi)=\eta_\omega(x,\alpha)-G(x,y;\alpha). z ( ϕ ) = η ω ( x , α ) − G ( x , y ; α ) .
The scalar hinge function h ( z ) = z + h(z)=z_+ h ( z ) = z + is differentiable whenever z ≠ 0 z\ne0 z = 0 , with derivative
h ′ ( z ) = 1 { z > 0 } . h'(z)=1\{z>0\}. h ′ ( z ) = 1 { z > 0 } .
At the nondifferentiable point z = 0 z=0 z = 0 , its Clarke subdifferential is
∂ h ( 0 ) = [ 0 , 1 ] . \partial h(0)=[0,1]. ∂ h ( 0 ) = [ 0 , 1 ] .
Therefore, the indicator
1 { G ( x , y ; α ) ≤ η ω ( x , α ) } = 1 { z ( ϕ ) ≥ 0 } 1\{G(x,y;\alpha)\le\eta_\omega(x,\alpha)\}=1\{z(\phi)\ge0\} 1 { G ( x , y ; α ) ≤ η ω ( x , α )} = 1 { z ( ϕ ) ≥ 0 }
coincides with the ordinary derivative away from z = 0 z=0 z = 0 , and selects the valid endpoint 1 ∈ [ 0 , 1 ] 1\in[0,1] 1 ∈ [ 0 , 1 ] when z = 0 z=0 z = 0 . Thus, the indicator-based gradient used in Proposition 1 is a valid Clarke subgradient selection for the nonsmooth hinge term. Using this selection in the gradient derivation of Theorem 1 gives the stochastic ascent direction g ^ t \hat{g}_t g ^ t used by Algorithm 1. Therefore, g ^ t \hat{g}_t g ^ t is a valid stochastic generalized gradient estimator of J \mathcal{J} J at ϕ t \phi_t ϕ t .
It remains to justify that the expectation of the stochastic direction E t [ g ^ t ] \mathbb{E}_t[\hat{g}_t] E t [ g ^ t ] is a valid Clarke subgradient of the objective J \mathcal{J} J . Recall that
J ( ϕ ) = E x , α , y [ η ω ( x , α ) − 1 α ( η ω ( x , α ) − G ( x , y ; α ) ) + ] , \mathcal{J}(\phi)=\mathbb{E}_{x,\alpha,y}\left[\eta_\omega(x,\alpha)-\frac{1}{\alpha}\left(\eta_\omega(x,\alpha)-G(x,y;\alpha)\right)_+\right], J ( ϕ ) = E x , α , y [ η ω ( x , α ) − α 1 ( η ω ( x , α ) − G ( x , y ; α ) ) + ] ,
where ϕ = ( θ , ω ) \phi=(\theta,\omega) ϕ = ( θ , ω ) , y ∼ π θ ( ⋅ ∣ x , α ) y\sim\pi_\theta(\cdot\mid x,\alpha) y ∼ π θ ( ⋅ ∣ x , α ) . We first show that, for each fixed ( x , y , α ) (x,y,\alpha) ( x , y , α ) , the integrand η ω ( x , α ) − 1 α ( η ω ( x , α ) − G ( x , y ; α ) ) + \eta_\omega(x,\alpha)-\frac{1}{\alpha}\left(\eta_\omega(x,\alpha)-G(x,y;\alpha)\right)_+ η ω ( x , α ) − α 1 ( η ω ( x , α ) − G ( x , y ; α ) ) + is locally Lipschitz on the domain visited by the algorithm. Indeed, the hinge map z ↦ z + z\mapsto z_+ z ↦ z + is Lipschitz and Clarke regular (Clarke, 1990; Rockafellar and Wets, 1998), and the inner map
ϕ ↦ η ω ( x , α ) − G ( x , y ; α ) \phi\mapsto\eta_\omega(x,\alpha)-G(x,y;\alpha) ϕ ↦ η ω ( x , α ) − G ( x , y ; α )
is smooth on this domain by Assumption 5. We next verify that the subgradient selection g ^ t \hat{g}_t g ^ t is integrably bounded. Following the proof of Proposition 1, we have
∥ ( 1 − 1 α 1 { G ( x , y ; α ) ≤ η ω ( x , α ) } ) ∇ ω η ω ( x , α ) ∥ \left\|\left(1-\frac{1}{\alpha}1\{G(x,y;\alpha)\le\eta_\omega(x,\alpha)\}\right)
\nabla_\omega\eta_\omega(x,\alpha)\right\| ( 1 − α 1 1 { G ( x , y ; α ) ≤ η ω ( x , α )} ) ∇ ω η ω ( x , α )
∇ ω η ω ( x , α ) ≤ ℓ η α min . (5) \nabla_\omega\eta_\omega(x,\alpha)\le\frac{\ell_\eta}{\alpha_{\min}}. \tag*{(5)} ∇ ω η ω ( x , α ) ≤ α m i n ℓ η . (5)
∣ ( u θ , ω ( x , y , α ) − β α 1 { G ( x , y ; α ) ≤ η ω ( x , α ) } ) ∇ θ log π θ ∣ ≤ C A ℓ π . \left\lvert\left(u_{\theta,\omega}(x,y,\alpha)-\frac{\beta}{\alpha}\mathbf{1}\{G(x,y;\alpha)\leq\eta_\omega(x,\alpha)\}\right)\nabla_\theta\log\pi_\theta\right\rvert\leq C_A\ell_\pi. ( u θ , ω ( x , y , α ) − α β 1 { G ( x , y ; α ) ≤ η ω ( x , α )} ) ∇ θ log π θ ≤ C A ℓ π .
Hence, the full indicator-based stochastic direction is uniformly bounded by a finite constant depending only on C A C_A C A , ℓ π \ell_\pi ℓ π , ℓ η \ell_\eta ℓ η , and α min \alpha_{\min} α m i n . In particular, the selected generalized gradients are integrable.
Since the integrand defining J \mathcal{J} J is locally Lipschitz and Clarke regular, and since the selected generalized gradients are integrably bounded, the standard Clarke subdifferential interchange rule for expectations applies ([21 ] (Rockafellar and Wets 1998)): the expectation of any measurable Clarke-subgradient selection of the integrand is contained in the Clarke subdifferential of the expected objective. Therefore,
E t [ g ^ t ] ∈ ∂ J ( ϕ t ) . \mathbb{E}_t[\hat{g}_t]\in\partial\mathcal{J}(\phi_t). E t [ g ^ t ] ∈ ∂ J ( ϕ t ) .
Since F = − J F=-\mathcal{J} F = − J , the Clarke subdifferential satisfies
∂ F ( ϕ t ) = ∂ ( − J ) ( ϕ t ) = − ∂ J ( ϕ t ) . \partial F(\phi_t)=\partial(-\mathcal{J})(\phi_t)=-\partial\mathcal{J}(\phi_t). ∂ F ( ϕ t ) = ∂ ( − J ) ( ϕ t ) = − ∂ J ( ϕ t ) .
Therefore,
E t [ ξ t ] = − E t [ g ^ t ] ∈ ∂ F ( ϕ t ) . \mathbb{E}_t[\xi_t]=-\mathbb{E}_t[\hat{g}_t]\in\partial F(\phi_t). E t [ ξ t ] = − E t [ g ^ t ] ∈ ∂ F ( ϕ t ) .
This completes the proof.
The convergence analysis also requires the stochastic descent direction to have bounded second moment. The following lemma shows that such a bound follows from the gradient-estimation error bounds in Proposition 1:
Lemma 2. Let ξ t = − g ^ t \xi_t=-\hat{g}_t ξ t = − g ^ t as defined in Lemma 1. Then under Assumptions 1, 2, 3, and 4,
E t ∥ ξ t ∥ 2 ≤ G B , N 2 , \mathbb{E}_t\lVert\xi_t\rVert^2\leq G^2_{B,N}, E t ∥ ξ t ∥ 2 ≤ G B , N 2 , where
G B , N 2 : = G 0 2 + σ θ 2 + σ ω 2 , G^2_{B,N}:=G_0^2+\sigma_\theta^2+\sigma_\omega^2, G B , N 2 := G 0 2 + σ θ 2 + σ ω 2 , G 0 2 : = C A 2 ℓ π 2 + ℓ η 2 max { 1 , 1 − α min α min } 2 . G_0^2:=C_A^2\ell_\pi^2+\ell_\eta^2\max\left\{1,\frac{1-\alpha_{\min}}{\alpha_{\min}}\right\}^2. G 0 2 := C A 2 ℓ π 2 + ℓ η 2 max { 1 , α m i n 1 − α m i n } 2 . and
σ θ 2 : = C A 2 ℓ π 2 B N + C A 2 ℓ π 2 B , \sigma_\theta^2:=\frac{C_A^2\ell_\pi^2}{BN}+\frac{C_A^2\ell_\pi^2}{B}, σ θ 2 := B N C A 2 ℓ π 2 + B C A 2 ℓ π 2 , σ ω 2 : = ℓ η 2 4 B N α min 2 + ℓ η 2 B α min 2 . \sigma_\omega^2:=\frac{\ell_\eta^2}{4BN\alpha_{\min}^2}+\frac{\ell_\eta^2}{B\alpha_{\min}^2}. σ ω 2 := 4 B N α m i n 2 ℓ η 2 + B α m i n 2 ℓ η 2 .
Proof. By definition,
E t ∥ ξ t ∥ 2 = E t ∥ g ^ t ∥ 2 = E t ∥ g ^ θ , t ∥ 2 + E t ∥ g ^ ω , t ∥ 2 . \mathbb{E}_t\lVert\xi_t\rVert^2=\mathbb{E}_t\lVert\hat{g}_t\rVert^2=\mathbb{E}_t\lVert\hat{g}_{\theta,t}\rVert^2+\mathbb{E}_t\lVert\hat{g}_{\omega,t}\rVert^2. E t ∥ ξ t ∥ 2 = E t ∥ g ^ t ∥ 2 = E t ∥ g ^ θ , t ∥ 2 + E t ∥ g ^ ω , t ∥ 2 .
Proposition 1 shows unbiasedness as:
E t [ g ^ θ , t ] = ∇ θ J ( θ t , ω t ) , E t [ g ^ ω , t ] = ∇ ω J ( θ t , ω t ) . \mathbb{E}_t[\hat{g}_{\theta,t}]=\nabla_\theta J(\theta_t,\omega_t),\qquad\mathbb{E}_t[\hat{g}_{\omega,t}]=\nabla_\omega J(\theta_t,\omega_t). E t [ g ^ θ , t ] = ∇ θ J ( θ t , ω t ) , E t [ g ^ ω , t ] = ∇ ω J ( θ t , ω t ) .
Then by the bias-variance decomposition,
E t ∥ g ^ θ , t ∥ 2 = ∥ ∇ θ J ( θ t , ω t ) ∥ 2 + E t ∥ g ^ θ , t − ∇ θ J ( θ t , ω t ) ∥ 2 , \mathbb{E}_t\lVert\hat{g}_{\theta,t}\rVert^2=\lVert\nabla_\theta J(\theta_t,\omega_t)\rVert^2+\mathbb{E}_t\lVert\hat{g}_{\theta,t}-\nabla_\theta J(\theta_t,\omega_t)\rVert^2, E t ∥ g ^ θ , t ∥ 2 = ∥ ∇ θ J ( θ t , ω t ) ∥ 2 + E t ∥ g ^ θ , t − ∇ θ J ( θ t , ω t ) ∥ 2 ,
E t ∥ g ^ ω , t ∥ 2 = ∥ ∇ ω J ( θ t , ω t ) ∥ 2 + E t ∥ g ^ ω , t − ∇ ω J ( θ t , ω t ) ∥ 2 . \mathbb{E}_t\lVert\hat{g}_{\omega,t}\rVert^2=\lVert\nabla_\omega J(\theta_t,\omega_t)\rVert^2+\mathbb{E}_t\lVert\hat{g}_{\omega,t}-\nabla_\omega J(\theta_t,\omega_t)\rVert^2. E t ∥ g ^ ω , t ∥ 2 = ∥ ∇ ω J ( θ t , ω t ) ∥ 2 + E t ∥ g ^ ω , t − ∇ ω J ( θ t , ω t ) ∥ 2 .
Proposition 1 gives the bounds
σ θ 2 : = C A 2 ℓ π 2 B N + C A 2 ℓ π 2 B , σ ω 2 : = ℓ η 2 4 B N α min 2 + ℓ η 2 B α min 2 , \sigma_\theta^2:=\frac{C_A^2\ell_\pi^2}{BN}+\frac{C_A^2\ell_\pi^2}{B},\qquad\sigma_\omega^2:=\frac{\ell_\eta^2}{4BN\alpha_{\min}^2}+\frac{\ell_\eta^2}{B\alpha_{\min}^2}, σ θ 2 := B N C A 2 ℓ π 2 + B C A 2 ℓ π 2 , σ ω 2 := 4 B N α m i n 2 ℓ η 2 + B α m i n 2 ℓ η 2 ,
so that
E t ∥ g ^ θ , t − ∇ θ J ( θ t , ω t ) ∥ 2 ≤ σ θ 2 , \mathbb{E}_t\lVert\hat{g}_{\theta,t}-\nabla_\theta J(\theta_t,\omega_t)\rVert^2\leq\sigma_\theta^2, E t ∥ g ^ θ , t − ∇ θ J ( θ t , ω t ) ∥ 2 ≤ σ θ 2 ,
E t ∥ g ^ ω , t − ∇ ω J ( θ t , ω t ) ∥ 2 ≤ σ ω 2 . \mathbb{E}_t\lVert\hat{g}_{\omega,t}-\nabla_\omega J(\theta_t,\omega_t)\rVert^2\leq\sigma_\omega^2. E t ∥ g ^ ω , t − ∇ ω J ( θ t , ω t ) ∥ 2 ≤ σ ω 2 .
Next, we bound the norm of the true policy-gradient term. Recall that
∇ θ J ( θ , ω ) = E α , x , Y ∼ π θ [ ( u θ , ω ( x , Y , α ) − β α 1 { G ( x , Y ; α ) ≤ η ω ( x , α ) } ) ∇ θ log π θ ( Y ∣ x , α ) ] . \nabla_\theta J(\theta,\omega)=\mathbb{E}_{\alpha,x,Y\sim\pi_\theta}\left[\left(u_{\theta,\omega}(x,Y,\alpha)-\frac{\beta}{\alpha}\mathbf{1}\{G(x,Y;\alpha)\leq\eta_\omega(x,\alpha)\}\right)\nabla_\theta\log\pi_\theta(Y\mid x,\alpha)\right]. ∇ θ J ( θ , ω ) = E α , x , Y ∼ π θ [ ( u θ , ω ( x , Y , α ) − α β 1 { G ( x , Y ; α ) ≤ η ω ( x , α )} ) ∇ θ log π θ ( Y ∣ x , α ) ] .
By Jensen’s inequality and the triangle inequality,
∥ ∇ θ J ( θ , ω ) ∥ = ∥ E α , x , Y ∼ π θ [ ( u θ , ω ( x , Y , α ) − β α 1 { G ( x , Y ; α ) ≤ η ω ( x , α ) } ) ∇ θ log π θ ( Y ∣ x , α ) ] ∥ ≤ E α , x , Y ∼ π θ [ ∣ u θ , ω ( x , Y , α ) − β α 1 { G ( x , Y ; α ) ≤ η ω ( x , α ) } ∣ ∥ ∇ θ log π θ ( Y ∣ x , α ) ∥ ] . \begin{aligned}
\lVert\nabla_\theta J(\theta,\omega)\rVert
&=\left\lVert\mathbb{E}_{\alpha,x,Y\sim\pi_\theta}\left[\left(u_{\theta,\omega}(x,Y,\alpha)-\frac{\beta}{\alpha}\mathbf{1}\{G(x,Y;\alpha)\leq\eta_\omega(x,\alpha)\}\right)\nabla_\theta\log\pi_\theta(Y\mid x,\alpha)\right]\right\rVert\\
&\leq\mathbb{E}_{\alpha,x,Y\sim\pi_\theta}\left[\left\lvert u_{\theta,\omega}(x,Y,\alpha)-\frac{\beta}{\alpha}\mathbf{1}\{G(x,Y;\alpha)\leq\eta_\omega(x,\alpha)\}\right\rvert\left\lVert\nabla_\theta\log\pi_\theta(Y\mid x,\alpha)\right\rVert\right].
\end{aligned} ∥ ∇ θ J ( θ , ω )∥ = E α , x , Y ∼ π θ [ ( u θ , ω ( x , Y , α ) − α β 1 { G ( x , Y ; α ) ≤ η ω ( x , α )} ) ∇ θ log π θ ( Y ∣ x , α ) ] ≤ E α , x , Y ∼ π θ [ u θ , ω ( x , Y , α ) − α β 1 { G ( x , Y ; α ) ≤ η ω ( x , α )} ∥ ∇ θ log π θ ( Y ∣ x , α ) ∥ ] .
From Proposition 1, we have
∣ u θ , ω ( x , Y , α ) − β α 1 { G ( x , Y ; α ) ≤ η ω ( x , α ) } ∣ ≤ C A , \left\lvert u_{\theta,\omega}(x,Y,\alpha)-\frac{\beta}{\alpha}\mathbf{1}\{G(x,Y;\alpha)\leq\eta_\omega(x,\alpha)\}\right\rvert\leq C_A, u θ , ω ( x , Y , α ) − α β 1 { G ( x , Y ; α ) ≤ η ω ( x , α )} ≤ C A ,
and Assumption 3 gives
∥ ∇ θ log π θ ( Y ∣ x , α ) ∥ ≤ ℓ π . \left\lVert\nabla_\theta\log\pi_\theta(Y\mid x,\alpha)\right\rVert\leq\ell_\pi. ∥ ∇ θ log π θ ( Y ∣ x , α ) ∥ ≤ ℓ π .
Therefore,
∥ ∇ θ J ( θ , ω ) ∥ ≤ E α , x , Y ∼ π θ [ C A ℓ π ] = C A ℓ π . \lVert\nabla_{\theta}\mathcal{J}(\theta,\omega)\rVert\leq\mathbb{E}_{\alpha,x,Y\sim\pi_{\theta}}[C_A\ell_{\pi}] = C_A\ell_{\pi}. ∥ ∇ θ J ( θ , ω )∥ ≤ E α , x , Y ∼ π θ [ C A ℓ π ] = C A ℓ π .
In particular, at iteration t t t ,
∥ ∇ θ J ( θ t , ω t ) ∥ ≤ C A ℓ π . \lVert\nabla_{\theta}\mathcal{J}(\theta_t,\omega_t)\rVert\leq C_A\ell_{\pi}. ∥ ∇ θ J ( θ t , ω t )∥ ≤ C A ℓ π .
Similarly, for the threshold-network gradient, since the indicator is binary, we have
∣ 1 − 1 α 1 { G ( x , Y ; α ) ≤ η ω ( x , α ) } ∣ ≤ max { 1 , 1 − α min α min } . \left|1-\frac{1}{\alpha}\mathbf{1}\{G(x,Y;\alpha)\leq\eta_{\omega}(x,\alpha)\}\right|
\leq\max\left\{1,\frac{1-\alpha_{\min}}{\alpha_{\min}}\right\}. 1 − α 1 1 { G ( x , Y ; α ) ≤ η ω ( x , α )} ≤ max { 1 , α m i n 1 − α m i n } .
Together with Assumption 1, which gives
∥ ∇ ω η ω ( x , α ) ∥ ≤ ℓ η , \lVert\nabla_{\omega}\eta_{\omega}(x,\alpha)\rVert\leq\ell_{\eta}, ∥ ∇ ω η ω ( x , α )∥ ≤ ℓ η ,
we obtain
∥ ∇ ω J ( θ t , ω t ) ∥ ≤ ℓ η max { 1 , 1 − α min α min } . \lVert\nabla_{\omega}\mathcal{J}(\theta_t,\omega_t)\rVert
\leq\ell_{\eta}\max\left\{1,\frac{1-\alpha_{\min}}{\alpha_{\min}}\right\}. ∥ ∇ ω J ( θ t , ω t )∥ ≤ ℓ η max { 1 , α m i n 1 − α m i n } .
Therefore, defining
G 0 2 : = C A 2 ℓ π 2 + ℓ η 2 max { 1 , 1 − α min α min } 2 , G_0^2 := C_A^2\ell_{\pi}^2+\ell_{\eta}^2\max\left\{1,\frac{1-\alpha_{\min}}{\alpha_{\min}}\right\}^2, G 0 2 := C A 2 ℓ π 2 + ℓ η 2 max { 1 , α m i n 1 − α m i n } 2 ,
we have
∥ g θ , t ∥ 2 + ∥ ∇ ω J ( θ t , ω t ) ∥ 2 ≤ G 0 2 . \lVert g_{\theta,t}\rVert^2+\lVert\nabla_{\omega}\mathcal{J}(\theta_t,\omega_t)\rVert^2\leq G_0^2. ∥ g θ , t ∥ 2 + ∥ ∇ ω J ( θ t , ω t ) ∥ 2 ≤ G 0 2 .
Putting everything together,
E t ∥ ξ t ∥ 2 = E t ∥ g ^ θ , t ∥ 2 + E t ∥ g ^ ω , t ∥ 2 = ∥ ∇ θ J ( θ t , ω t ) ∥ 2 + ∥ ∇ ω J ( θ t , ω t ) ∥ 2 + E t ∥ g ^ θ , t − ∇ θ J ( θ t , ω t ) ∥ 2 + E t ∥ g ^ ω , t − ∇ ω J ( θ t , ω t ) ∥ 2 ≤ G 0 2 + σ θ 2 + σ ω 2 . \begin{aligned}
\mathbb{E}_t\lVert\xi_t\rVert^2
&=\mathbb{E}_t\lVert\widehat{g}_{\theta,t}\rVert^2+\mathbb{E}_t\lVert\widehat{g}_{\omega,t}\rVert^2\\
&=\lVert\nabla_{\theta}\mathcal{J}(\theta_t,\omega_t)\rVert^2+\lVert\nabla_{\omega}\mathcal{J}(\theta_t,\omega_t)\rVert^2\\
&\quad+\mathbb{E}_t\lVert\widehat{g}_{\theta,t}-\nabla_{\theta}\mathcal{J}(\theta_t,\omega_t)\rVert^2\\
&\quad+\mathbb{E}_t\lVert\widehat{g}_{\omega,t}-\nabla_{\omega}\mathcal{J}(\theta_t,\omega_t)\rVert^2\\
&\leq G_0^2+\sigma_{\theta}^2+\sigma_{\omega}^2.
\end{aligned} E t ∥ ξ t ∥ 2 = E t ∥ g θ , t ∥ 2 + E t ∥ g ω , t ∥ 2 = ∥ ∇ θ J ( θ t , ω t ) ∥ 2 + ∥ ∇ ω J ( θ t , ω t ) ∥ 2 + E t ∥ g θ , t − ∇ θ J ( θ t , ω t ) ∥ 2 + E t ∥ g ω , t − ∇ ω J ( θ t , ω t ) ∥ 2 ≤ G 0 2 + σ θ 2 + σ ω 2 .
Finally, we derive our main convergence theorem. For clarity, the theorem is stated for a shared learning rate across the policy and threshold blocks and we will justify that the same argument extends to specific learning rates later.
Theorem 4. Under Assumptions 1, 2, 3, 4, 5, 6 and 7, For a shared learning rate γ t \gamma_t γ t used for the policy and threshold blocks:
θ t + 1 = θ t + γ t g ^ θ , t , ω t + 1 = ω t + γ t g ^ ω , t . \theta_{t+1}=\theta_t+\gamma_t\widehat{g}_{\theta,t},\qquad\omega_{t+1}=\omega_t+\gamma_t\widehat{g}_{\omega,t}. θ t + 1 = θ t + γ t g θ , t , ω t + 1 = ω t + γ t g ω , t .
Equivalently, with ξ t = − g ^ t \xi_t=-\widehat{g}_t ξ t = − g t ,
ϕ t + 1 = ϕ t − γ t ξ t . \phi_{t+1}=\phi_t-\gamma_t\xi_t. ϕ t + 1 = ϕ t − γ t ξ t .
For any λ ∈ ( 0 , ρ − 1 ) \lambda\in(0,\rho^{-1}) λ ∈ ( 0 , ρ − 1 ) , let t ˉ \bar{t} t ˉ be sampled from { 0 , … , T − 1 } \{0,\ldots,T-1\} { 0 , … , T − 1 } with probability
P ( t ˉ = t ) = γ t ∑ s = 0 T − 1 γ s . \mathbb{P}(\bar{t}=t)=\frac{\gamma_t}{\sum_{s=0}^{T-1}\gamma_s}. P ( t ˉ = t ) = ∑ s = 0 T − 1 γ s γ t .
Then
E [ ∥ ∇ F λ ( ϕ t ˉ ) ∥ 2 ] ≤ 2 ( F ( ϕ 0 ) − F ⋆ ) ( 1 − ρ λ ) ∑ t = 0 T − 1 γ t + G B , N 2 ∑ t = 0 T − 1 γ t 2 λ ( 1 − ρ λ ) ∑ t = 0 T − 1 γ t . \mathbb{E}\left[\lVert\nabla F_{\lambda}(\phi_{\bar{t}})\rVert^2\right]
\leq
\frac{2(F(\phi_0)-F_{\star})}{(1-\rho\lambda)\sum_{t=0}^{T-1}\gamma_t}
+
\frac{G_{B,N}^2\sum_{t=0}^{T-1}\gamma_t^2}{\lambda(1-\rho\lambda)\sum_{t=0}^{T-1}\gamma_t}. E [ ∥ ∇ F λ ( ϕ t ˉ ) ∥ 2 ] ≤ ( 1 − ρ λ ) ∑ t = 0 T − 1 γ t 2 ( F ( ϕ 0 ) − F ⋆ ) + λ ( 1 − ρ λ ) ∑ t = 0 T − 1 γ t G B , N 2 ∑ t = 0 T − 1 γ t 2 .
Proof. Let
z t = arg min z { F ( z ) + 1 2 λ ∥ z − ϕ t ∥ 2 } . z_t=\mathop{\arg\min}_{z}\left\{F(z)+\frac{1}{2\lambda}\lVert z-\phi_t\rVert^2\right\}. z t = arg min z { F ( z ) + 2 λ 1 ∥ z − ϕ t ∥ 2 } .
For λ < 1 / ρ \lambda<1/\rho λ < 1/ ρ , the Moreau envelope F λ F_{\lambda} F λ is differentiable and satisfies Davis and Drusvyatskiy [24 ]
∇ F λ ( ϕ t ) = 1 λ ( ϕ t − z t ) . \nabla F_{\lambda}(\phi_t)=\frac{1}{\lambda}(\phi_t-z_t). ∇ F λ ( ϕ t ) = λ 1 ( ϕ t − z t ) .
Since F F F is ρ \rho ρ -weakly convex under Assumption 6, for any v t ∈ ∂ F ( ϕ t ) v_t\in\partial F(\phi_t) v t ∈ ∂ F ( ϕ t ) ,
F ( z t ) ≥ F ( ϕ t ) + ⟨ v t , z t − ϕ t ⟩ − ρ 2 ∥ z t − ϕ t ∥ 2 . F(z_t)\geq F(\phi_t)+\langle v_t,z_t-\phi_t\rangle-\frac{\rho}{2}\lVert z_t-\phi_t\rVert^2. F ( z t ) ≥ F ( ϕ t ) + ⟨ v t , z t − ϕ t ⟩ − 2 ρ ∥ z t − ϕ t ∥ 2 .
Using the definition of z t z_t z t and rearranging gives
⟨ v t , ϕ t − z t ⟩ ≥ 1 − ρ λ 2 λ ∥ ϕ t − z t ∥ 2 = λ ( 1 − ρ λ ) 2 ∥ ∇ F λ ( ϕ t ) ∥ 2 . \langle v_t,\phi_t-z_t\rangle\geq\frac{1-\rho\lambda}{2\lambda}\lVert\phi_t-z_t\rVert^2
=\frac{\lambda(1-\rho\lambda)}{2}\lVert\nabla F_{\lambda}(\phi_t)\rVert^2. ⟨ v t , ϕ t − z t ⟩ ≥ 2 λ 1 − ρ λ ∥ ϕ t − z t ∥ 2 = 2 λ ( 1 − ρ λ ) ∥ ∇ F λ ( ϕ t ) ∥ 2 .
The update can be written as
ϕ t + 1 = ϕ t − γ t ξ t . \phi_{t+1}=\phi_t-\gamma_t\xi_t. ϕ t + 1 = ϕ t − γ t ξ t .
Therefore,
∥ ϕ t + 1 − z t ∥ 2 = ∥ ϕ t − z t ∥ 2 − 2 γ t ⟨ ξ t , ϕ t − z t ⟩ + γ t 2 ∥ ξ t ∥ 2 . \lVert\phi_{t+1}-z_t\rVert^2
=
\lVert\phi_t-z_t\rVert^2
-2\gamma_t\langle\xi_t,\phi_t-z_t\rangle
+\gamma_t^2\lVert\xi_t\rVert^2. ∥ ϕ t + 1 − z t ∥ 2 = ∥ ϕ t − z t ∥ 2 − 2 γ t ⟨ ξ t , ϕ t − z t ⟩ + γ t 2 ∥ ξ t ∥ 2 .
Taking conditional expectation, using E t [ ξ t ] ∈ ∂ F ( ϕ t ) \mathbb{E}_t[\xi_t]\in\partial F(\phi_t) E t [ ξ t ] ∈ ∂ F ( ϕ t ) (Lemma 1), and E t ∥ ξ t ∥ 2 ≤ G B , N 2 \mathbb{E}_t\lVert\xi_t\rVert^2\leq G_{B,N}^2 E t ∥ ξ t ∥ 2 ≤ G B , N 2 (Lemma 2)
E t ∥ ϕ t + 1 − z t ∥ 2 ≤ ∥ ϕ t − z t ∥ 2 − γ t λ ( 1 − ρ λ ) ∥ ∇ F λ ( ϕ t ) ∥ 2 + γ t 2 G B , N 2 . \mathbb{E}_t\lVert\phi_{t+1}-z_t\rVert^2
\leq
\lVert\phi_t-z_t\rVert^2
-\gamma_t\lambda(1-\rho\lambda)\lVert\nabla F_{\lambda}(\phi_t)\rVert^2
+\gamma_t^2G_{B,N}^2. E t ∥ ϕ t + 1 − z t ∥ 2 ≤ ∥ ϕ t − z t ∥ 2 − γ t λ ( 1 − ρ λ ) ∥ ∇ F λ ( ϕ t ) ∥ 2 + γ t 2 G B , N 2 .
By the definition of the Moreau envelope,
F λ ( ϕ t + 1 ) ≤ F ( z t ) + 1 2 λ ∥ ϕ t + 1 − z t ∥ 2 . F_\lambda(\phi_{t+1}) \leq F(z_t) + \frac{1}{2\lambda}\lVert\phi_{t+1}-z_t\rVert^2. F λ ( ϕ t + 1 ) ≤ F ( z t ) + 2 λ 1 ∥ ϕ t + 1 − z t ∥ 2 .
Taking conditional expectation and substituting the previous bound gives
E t [ F λ ( ϕ t + 1 ) ] ≤ F λ ( ϕ t ) − γ t ( 1 − ρ λ ) 2 ∥ ∇ F λ ( ϕ t ) ∥ 2 + γ t 2 G B , N 2 2 λ . \mathbb{E}_t[F_\lambda(\phi_{t+1})] \leq F_\lambda(\phi_t) - \frac{\gamma_t(1-\rho\lambda)}{2}\lVert\nabla F_\lambda(\phi_t)\rVert^2 + \frac{\gamma_t^2G_{B,N}^2}{2\lambda}. E t [ F λ ( ϕ t + 1 )] ≤ F λ ( ϕ t ) − 2 γ t ( 1 − ρ λ ) ∥ ∇ F λ ( ϕ t ) ∥ 2 + 2 λ γ t 2 G B , N 2 .
Rearranging,
γ t ∥ ∇ F λ ( ϕ t ) ∥ 2 ≤ 2 1 − ρ λ ( F λ ( ϕ t ) − E t [ F λ ( ϕ t + 1 ) ] ) + γ t 2 G B , N 2 λ ( 1 − ρ λ ) . \gamma_t\lVert\nabla F_\lambda(\phi_t)\rVert^2 \leq\frac{2}{1-\rho\lambda}\left(F_\lambda(\phi_t)-\mathbb{E}_t[F_\lambda(\phi_{t+1})]\right)+\frac{\gamma_t^2G_{B,N}^2}{\lambda(1-\rho\lambda)}. γ t ∥ ∇ F λ ( ϕ t ) ∥ 2 ≤ 1 − ρ λ 2 ( F λ ( ϕ t ) − E t [ F λ ( ϕ t + 1 )] ) + λ ( 1 − ρ λ ) γ t 2 G B , N 2 .
Taking total expectation and summing over t = 0 , … , T − 1 t=0,\ldots,T-1 t = 0 , … , T − 1 , we obtain
∑ t = 0 T − 1 γ t E ∥ ∇ F λ ( ϕ t ) ∥ 2 ≤ 2 1 − ρ λ E [ F λ ( ϕ 0 ) − F λ ( ϕ T ) ] + G B , N 2 λ ( 1 − ρ λ ) ∑ t = 0 T − 1 γ t 2 . \sum_{t=0}^{T-1}\gamma_t\mathbb{E}\lVert\nabla F_\lambda(\phi_t)\rVert^2 \leq\frac{2}{1-\rho\lambda}\mathbb{E}[F_\lambda(\phi_0)-F_\lambda(\phi_T)]+\frac{G_{B,N}^2}{\lambda(1-\rho\lambda)}\sum_{t=0}^{T-1}\gamma_t^2. t = 0 ∑ T − 1 γ t E ∥ ∇ F λ ( ϕ t ) ∥ 2 ≤ 1 − ρ λ 2 E [ F λ ( ϕ 0 ) − F λ ( ϕ T )] + λ ( 1 − ρ λ ) G B , N 2 t = 0 ∑ T − 1 γ t 2 .
Since F λ ( ϕ T ) ≥ F ⋆ F_\lambda(\phi_T)\geq F_\star F λ ( ϕ T ) ≥ F ⋆ and F λ ( ϕ 0 ) ≤ F ( ϕ 0 ) F_\lambda(\phi_0)\leq F(\phi_0) F λ ( ϕ 0 ) ≤ F ( ϕ 0 ) , this implies
∑ t = 0 T − 1 γ t E ∥ ∇ F λ ( ϕ t ) ∥ 2 ≤ 2 ( F ( ϕ 0 ) − F ⋆ ) 1 − ρ λ + G B , N 2 λ ( 1 − ρ λ ) ∑ t = 0 T − 1 γ t 2 . \sum_{t=0}^{T-1}\gamma_t\mathbb{E}\lVert\nabla F_\lambda(\phi_t)\rVert^2 \leq\frac{2(F(\phi_0)-F_\star)}{1-\rho\lambda}+\frac{G_{B,N}^2}{\lambda(1-\rho\lambda)}\sum_{t=0}^{T-1}\gamma_t^2. t = 0 ∑ T − 1 γ t E ∥ ∇ F λ ( ϕ t ) ∥ 2 ≤ 1 − ρ λ 2 ( F ( ϕ 0 ) − F ⋆ ) + λ ( 1 − ρ λ ) G B , N 2 t = 0 ∑ T − 1 γ t 2 .
Sampling t ˉ \bar{t} t ˉ with probability
P ( t ˉ = t ) = γ t ∑ s = 0 T − 1 γ s \mathbb{P}(\bar{t}=t)=\frac{\gamma_t}{\sum_{s=0}^{T-1}\gamma_s} P ( t ˉ = t ) = ∑ s = 0 T − 1 γ s γ t
gives
E [ ∥ ∇ F λ ( ϕ t ˉ ) ∥ 2 ] ≤ 2 ( F ( ϕ 0 ) − F ⋆ ) ( 1 − ρ λ ) ∑ t = 0 T − 1 γ t + G B , N 2 ∑ t = 0 T − 1 γ t 2 λ ( 1 − ρ λ ) ∑ t = 0 T − 1 γ t . \mathbb{E}\left[\lVert\nabla F_\lambda(\phi_{\bar{t}})\rVert^2\right]\leq\frac{2(F(\phi_0)-F_\star)}{(1-\rho\lambda)\sum_{t=0}^{T-1}\gamma_t}+\frac{G_{B,N}^2\sum_{t=0}^{T-1}\gamma_t^2}{\lambda(1-\rho\lambda)\sum_{t=0}^{T-1}\gamma_t}. E [ ∥ ∇ F λ ( ϕ t ˉ ) ∥ 2 ] ≤ ( 1 − ρ λ ) ∑ t = 0 T − 1 γ t 2 ( F ( ϕ 0 ) − F ⋆ ) + λ ( 1 − ρ λ ) ∑ t = 0 T − 1 γ t G B , N 2 ∑ t = 0 T − 1 γ t 2 .
This completes the proof. □
Remark: 1. The theorem is stated for a shared learning rate for notational clarity. The same proof extends to block-specific learning rates γ θ , t \gamma_{\theta,t} γ θ , t and γ ω , t \gamma_{\omega,t} γ ω , t by writing the update as
ϕ t + 1 = ϕ t − Γ t ξ t , Γ t = ( γ θ , t I θ 0 0 γ ω , t I ω ) . \phi_{t+1}=\phi_t-\Gamma_t\xi_t,\qquad\Gamma_t=\begin{pmatrix}\gamma_{\theta,t}I_\theta& 0 \\ 0 & \gamma_{\omega,t}I_\omega\end{pmatrix}. ϕ t + 1 = ϕ t − Γ t ξ t , Γ t = ( γ θ , t I θ 0 0 γ ω , t I ω ) .
Let
γ min , t = min { γ θ , t , γ ω , t } \gamma_{\min,t}=\min\{\gamma_{\theta,t},\gamma_{\omega,t}\} γ m i n , t = min { γ θ , t , γ ω , t }
γ max , t = max { γ θ , t , γ ω , t } . \gamma_{\max,t}=\max\{\gamma_{\theta,t},\gamma_{\omega,t}\}. γ m a x , t = max { γ θ , t , γ ω , t } .
A complete block-specific step size proof follows the same argument. In this case, the decrease term (first term) scales with the smallest block step size γ min , t \gamma_{\min,t} γ m i n , t , because this is the minimum amount of descent applied across the two parameter blocks. The stochastic quadratic term (second term) scales with γ max , t 2 \gamma_{\max,t}^2 γ m a x , t 2 because
E t ∥ Γ t ξ t ∥ 2 ≤ γ max , t 2 E t ∥ ξ t ∥ 2 . \mathbb{E}_t\lVert\Gamma_t\xi_t\rVert^2\leq\gamma_{\max,t}^2\mathbb{E}_t\lVert\xi_t\rVert^2. E t ∥ Γ t ξ t ∥ 2 ≤ γ m a x , t 2 E t ∥ ξ t ∥ 2 .
Thus the same convergence structure is obtained by replacing γ t \gamma_t γ t with γ min , t \gamma_{\min,t} γ m i n , t in the descent term (first term) and replacing γ t 2 \gamma_t^2 γ t 2 with γ max , t 2 \gamma_{\max,t}^2 γ m a x , t 2 in the stochastic-error term (second term).
For theoretical analysis, Algorithm 1 should return a randomly selected iterate ( θ t ˉ , ω t ˉ ) (\theta_{\bar{t}},\omega_{\bar{t}}) ( θ t ˉ , ω t ˉ ) , where
P ( t ˉ = t ) = γ t ∑ s = 0 T − 1 γ s . \mathbb{P}(\bar{t}=t)=\frac{\gamma_t}{\sum_{s=0}^{T-1}\gamma_s}. P ( t ˉ = t ) = ∑ s = 0 T − 1 γ s γ t .
This randomized output is standard in nonconvex stochastic optimization and is used only to state the stationarity guarantee. In practice, we follow the common practice of using the final checkpoint as the output.
Corollary 1. Under the conditions of Theorem 4, choose a constant step size over the T T T -iteration run, i.e., γ t = γ = Θ ( T − 1 / 2 ) \gamma_t=\gamma=\Theta(T^{-1/2}) γ t = γ = Θ ( T − 1/2 ) . Then
E [ ∥ ∇ F λ ( ϕ t ˉ ) ∥ 2 ] = O ( T − 1 / 2 ) ( 1 + 1 B N + 1 B ) . \mathbb{E}\left[\lVert\nabla F_\lambda(\phi_{\bar{t}})\rVert^2\right]=O(T^{-1/2})\left(1+\frac{1}{BN}+\frac{1}{B}\right). E [ ∥ ∇ F λ ( ϕ t ˉ ) ∥ 2 ] = O ( T − 1/2 ) ( 1 + B N 1 + B 1 ) .
Thus Algorithm 1 converges to a nonsmooth stationary point of the original hard-hinge risk-conditioned CVaR objective in the Moreau-envelope stationarity sense.
Remark. The Moreau-envelope stationarity measure should be interpreted as a nonsmooth analogue of the gradient norm. For a smooth objective, convergence to stationarity is commonly stated as E ∥ ∇ F ( ϕ t ˉ ) ∥ 2 → 0 \mathbb{E}\lVert\nabla F(\phi_{\bar{t}})\rVert^2\to0 E ∥ ∇ F ( ϕ t ˉ ) ∥ 2 → 0 . Here, F F F is nonsmooth because of the hard hinge, so ∇ F ( ϕ ) \nabla F(\phi) ∇ F ( ϕ ) may not exist everywhere. The Moreau envelope F λ F_{\lambda} F λ provides a smooth surrogate only for measuring stationarity. For any point ϕ \phi ϕ , define its proximal point as
z λ ( ϕ ) : = arg min z { F ( z ) + 1 2 λ ∥ z − ϕ ∥ 2 } . z_{\lambda}(\phi) := \mathop{\arg\min}_{z} \left\{ F(z) + \frac{1}{2\lambda}\lVert z-\phi\rVert^{2} \right\}. z λ ( ϕ ) := arg min z { F ( z ) + 2 λ 1 ∥ z − ϕ ∥ 2 } .
For λ < 1 / ρ \lambda< 1/\rho λ < 1/ ρ , the Moreau envelope is differentiable and satisfies
∇ F λ ( ϕ ) = λ − 1 ( ϕ − z λ ( ϕ ) ) . \nabla F_{\lambda}(\phi) = \lambda^{-1}(\phi-z_{\lambda}(\phi)). ∇ F λ ( ϕ ) = λ − 1 ( ϕ − z λ ( ϕ )) .
Therefore, ∥ ∇ F λ ( ϕ ) ∥ \lVert\nabla F_{\lambda}(\phi)\rVert ∥ ∇ F λ ( ϕ )∥ measures the scaled distance from ϕ \phi ϕ to its proximal point z λ ( ϕ ) z_{\lambda}(\phi) z λ ( ϕ ) under the original objective. When this quantity is small, ϕ \phi ϕ is close to a point that is nearly stationary for the nonsmooth objective F F F in the generalized subgradient sense. Hence Corollary 1 shows that the actual hard-hinge Algorithm 1 approaches nonsmooth stationarity at rate O ( T − 1 / 2 ) O(T^{-1/2}) O ( T − 1/2 ) .
Uniform approximate CVaR frontier. For a risk-conditioned policy π θ ( ⋅ ∣ x , α ) \pi_{\theta}(\cdot\mid x,\alpha) π θ ( ⋅ ∣ x , α ) , we define its CVaR value at risk level α ∈ [ α min , α max ] \alpha\in[\alpha_{\min},\alpha_{\max}] α ∈ [ α m i n , α m a x ] as
V ( θ , α ) : = E x ∼ D [ CVaR α ( G ( x , Y ; α ) ) ] , \mathcal{V}(\theta,\alpha) := \mathbb{E}_{x\sim\mathcal{D}}\left[\operatorname{CVaR}_{\alpha}(G(x,Y;\alpha))\right], V ( θ , α ) := E x ∼ D [ CVaR α ( G ( x , Y ; α )) ] ,
where Y ∼ π θ ( ⋅ ∣ x , α ) Y\sim\pi_{\theta}(\cdot\mid x,\alpha) Y ∼ π θ ( ⋅ ∣ x , α ) . The optimal CVaR frontier is then defined as
V ∗ ( α ) : = sup θ V ( θ , α ) . \mathcal{V}^{*}(\alpha) := \sup_{\theta}\mathcal{V}(\theta,\alpha). V ∗ ( α ) := θ sup V ( θ , α ) .
Next, we will show that, if the learned risk-conditioned policy using Algorithm 1 is approximately optimal on a finite training grid of CVaR risk levels, then it uniformly approximates the entire CVaR frontier. To do this, we will first prove several useful propositions. We will first show that CVaR is α \alpha α -smooth ([3 ] (Rockafellar and Uryasev 2002)).
Proposition 2. For any bounded scalar random variable with Z ∈ [ Z min , Z max ] Z\in[Z_{\min},Z_{\max}] Z ∈ [ Z m i n , Z m a x ] a.s. and any α , α ′ ∈ [ α min , α max ] \alpha,\alpha'\in[\alpha_{\min},\alpha_{\max}] α , α ′ ∈ [ α m i n , α m a x ] , we have
∣ CVaR α ( Z ) − CVaR α ′ ( Z ) ∣ ≤ Z max − Z min α min ∣ α − α ′ ∣ . \left|\operatorname{CVaR}_{\alpha}(Z)-\operatorname{CVaR}_{\alpha'}(Z)\right|
\le\frac{Z_{\max}-Z_{\min}}{\alpha_{\min}}\left|\alpha-\alpha'\right|. ∣ CVaR α ( Z ) − CVaR α ′ ( Z ) ∣ ≤ α m i n Z m a x − Z m i n ∣ α − α ′ ∣ . That is, on any interval [ α min , α max ] ⊂ ( 0 , 1 ] [\alpha_{\min},\alpha_{\max}]\subset(0,1] [ α m i n , α m a x ] ⊂ ( 0 , 1 ] , CVaR α ( Z ) \operatorname{CVaR}_{\alpha}(Z) CVaR α ( Z ) is Lipschitz in α \alpha α .
Proof. Recall that the quantile function of Z Z Z is
F Z − 1 ( u ) : = inf { z ∈ R : F Z ( z ) ≥ u } , u ∈ [ 0 , 1 ] . F_Z^{-1}(u) := \inf\{z\in\mathbb{R}:F_Z(z)\ge u\},\quad u\in[0,1]. F Z − 1 ( u ) := inf { z ∈ R : F Z ( z ) ≥ u } , u ∈ [ 0 , 1 ] .
Under this convention, the lower-tail CVaR admits the quantile representation ([4 ] (Rockafellar and Uryasev 2002))
CVaR α ( Z ) = 1 α ∫ 0 α F Z − 1 ( u ) d u . \operatorname{CVaR}_{\alpha}(Z)=\frac{1}{\alpha}\int_{0}^{\alpha}F_Z^{-1}(u)\,\mathrm{d}u. CVaR α ( Z ) = α 1 ∫ 0 α F Z − 1 ( u ) d u .
Since Z ∈ [ Z min , Z max ] Z\in[Z_{\min},Z_{\max}] Z ∈ [ Z m i n , Z m a x ] almost surely, we have F Z − 1 ( u ) ∈ [ Z min , Z max ] F_Z^{-1}(u)\in[Z_{\min},Z_{\max}] F Z − 1 ( u ) ∈ [ Z m i n , Z m a x ] for all u ∈ [ 0 , 1 ] u\in[0,1] u ∈ [ 0 , 1 ] . Therefore,
CVaR α ( Z ) ∈ [ Z min , Z max ] . \operatorname{CVaR}_{\alpha}(Z)\in[Z_{\min},Z_{\max}]. CVaR α ( Z ) ∈ [ Z m i n , Z m a x ] .
Differentiate CVaR α ( Z ) \operatorname{CVaR}_{\alpha}(Z) CVaR α ( Z ) for a.e. α \alpha α :
CVaR α ′ ( Z ) = α F Z − 1 ( u ) − ∫ 0 α F Z − 1 ( u ) d u α 2 = F Z − 1 ( u ) − CVaR α ( Z ) α . \operatorname{CVaR}_{\alpha}'(Z)
=\frac{\alpha F_Z^{-1}(u)-\int_{0}^{\alpha}F_Z^{-1}(u)\,\mathrm{d}u}{\alpha^{2}}
=\frac{F_Z^{-1}(u)-\operatorname{CVaR}_{\alpha}(Z)}{\alpha}. CVaR α ′ ( Z ) = α 2 α F Z − 1 ( u ) − ∫ 0 α F Z − 1 ( u ) d u = α F Z − 1 ( u ) − CVaR α ( Z ) .
Hence
∣ CVaR α ′ ( Z ) ∣ ≤ ∣ F Z − 1 ( u ) − CVaR α ( Z ) ∣ α ≤ Z max − Z min α . \left|\operatorname{CVaR}_{\alpha}'(Z)\right|
\le\frac{\left|F_Z^{-1}(u)-\operatorname{CVaR}_{\alpha}(Z)\right|}{\alpha}
\le\frac{Z_{\max}-Z_{\min}}{\alpha}. CVaR α ′ ( Z ) ≤ α F Z − 1 ( u ) − CVaR α ( Z ) ≤ α Z m a x − Z m i n .
Since α ≥ α min \alpha\ge\alpha_{\min} α ≥ α m i n ,
∣ CVaR α ′ ( Z ) ∣ ≤ Z max − Z min α min , \left|\operatorname{CVaR}_{\alpha}'(Z)\right|
\le\frac{Z_{\max}-Z_{\min}}{\alpha_{\min}}, CVaR α ′ ( Z ) ≤ α m i n Z m a x − Z m i n ,
for a.e. α ∈ [ α min , α max ] \alpha\in[\alpha_{\min},\alpha_{\max}] α ∈ [ α m i n , α m a x ] .
Therefore, by the fundamental theorem of calculus,
∣ CVaR α ( Z ) − CVaR α ′ ( Z ) ∣ ≤ Z max − Z min α min ∣ α − α ′ ∣ . \left|\operatorname{CVaR}_{\alpha}(Z)-\operatorname{CVaR}_{\alpha'}(Z)\right|
\le\frac{Z_{\max}-Z_{\min}}{\alpha_{\min}}\left|\alpha-\alpha'\right|. ∣ CVaR α ( Z ) − CVaR α ′ ( Z ) ∣ ≤ α m i n Z m a x − Z m i n ∣ α − α ′ ∣ .
This completes the proof. □ \square □
Next, we will show that, for fixed α \alpha α , CVaR is also Lipschitz with respect to the random variable in Wasserstein-1 distance ([10 ] (Pichler 2013)).
Proposition 3. For any integrable random variables Z , Z ′ Z,Z' Z , Z ′ and any α ∈ ( 0 , 1 ) \alpha\in(0,1) α ∈ ( 0 , 1 ) ,
∣ CVaR α ( Z ) − CVaR α ( Z ′ ) ∣ ≤ 1 α W 1 ( Z , Z ′ ) . \left|\operatorname{CVaR}_{\alpha}(Z)-\operatorname{CVaR}_{\alpha}(Z')\right|
\le\frac{1}{\alpha}W_{1}(Z,Z'). ∣ CVaR α ( Z ) − CVaR α ( Z ′ ) ∣ ≤ α 1 W 1 ( Z , Z ′ ) . Proof. Recall that:
CVaR α ( Z ) = 1 α ∫ 0 α F Z − 1 ( u ) d u . \operatorname{CVaR}_{\alpha}(Z)=\frac{1}{\alpha}\int_{0}^{\alpha}F_Z^{-1}(u)\,\mathrm{d}u. CVaR α ( Z ) = α 1 ∫ 0 α F Z − 1 ( u ) d u . CVaR α ( Z ′ ) = 1 α ∫ 0 α F Z ′ − 1 ( u ) d u . \operatorname{CVaR}_{\alpha}(Z')=\frac{1}{\alpha}\int_{0}^{\alpha}F_{Z'}^{-1}(u)\,\mathrm{d}u. CVaR α ( Z ′ ) = α 1 ∫ 0 α F Z ′ − 1 ( u ) d u .
Therefore,
∣ CVaR α ( Z ) − CVaR α ( Z ′ ) ∣ ≤ 1 α ∫ 0 α ∣ F Z − 1 ( u ) − F Z ′ − 1 ( u ) ∣ d u . \left|\operatorname{CVaR}_{\alpha}(Z)-\operatorname{CVaR}_{\alpha}(Z')\right|
\le\frac{1}{\alpha}\int_{0}^{\alpha}\left|F_Z^{-1}(u)-F_{Z'}^{-1}(u)\right|\,du. ∣ CVaR α ( Z ) − CVaR α ( Z ′ ) ∣ ≤ α 1 ∫ 0 α F Z − 1 ( u ) − F Z ′ − 1 ( u ) d u .
Since
W 1 ( Z , Z ′ ) = ∫ 0 1 ∣ F Z − 1 ( u ) − F Z ′ − 1 ( u ) ∣ d u , W_1(Z,Z')=\int_{0}^{1}\left|F_Z^{-1}(u)-F_{Z'}^{-1}(u)\right|\,du, W 1 ( Z , Z ′ ) = ∫ 0 1 F Z − 1 ( u ) − F Z ′ − 1 ( u ) d u ,
we obtain
∣ CVaR α ( Z ) − CVaR α ( Z ′ ) ∣ ≤ 1 α W 1 ( Z , Z ′ ) . \left|\operatorname{CVaR}_{\alpha}(Z)-\operatorname{CVaR}_{\alpha}(Z')\right|
\le\frac{1}{\alpha}W_1(Z,Z'). ∣ CVaR α ( Z ) − CVaR α ( Z ′ ) ∣ ≤ α 1 W 1 ( Z , Z ′ ) .
This completes the proof. □
To simplify notation, for fixed x x x , θ \theta θ , α \alpha α , we write
Z x , θ , α : = G ( x , Y ; α ) , Y ∼ π θ ( ⋅ ∣ x , α ) . Z_{x,\theta,\alpha}:=G(x,Y;\alpha),\qquad Y\sim\pi_\theta(\cdot\mid x,\alpha). Z x , θ , α := G ( x , Y ; α ) , Y ∼ π θ ( ⋅ ∣ x , α ) .
We now decompose
CVaR α ( Z x , θ , α ) − CVaR α ′ ( Z x , θ , α ′ ) = ( CVaR α ( Z x , θ , α ) − CVaR α ′ ( Z x , θ , α ) ) + ( CVaR α ′ ( Z x , θ , α ) − CVaR α ′ ( Z x , θ , α ′ ) ) . \begin{aligned}
\operatorname{CVaR}_{\alpha}(Z_{x,\theta,\alpha})-\operatorname{CVaR}_{\alpha'}(Z_{x,\theta,\alpha'})
={}&\bigl(\operatorname{CVaR}_{\alpha}(Z_{x,\theta,\alpha})-\operatorname{CVaR}_{\alpha'}(Z_{x,\theta,\alpha})\bigr)\\
&+\bigl(\operatorname{CVaR}_{\alpha'}(Z_{x,\theta,\alpha})-\operatorname{CVaR}_{\alpha'}(Z_{x,\theta,\alpha'})\bigr).
\end{aligned} CVaR α ( Z x , θ , α ) − CVaR α ′ ( Z x , θ , α ′ ) = ( CVaR α ( Z x , θ , α ) − CVaR α ′ ( Z x , θ , α ) ) + ( CVaR α ′ ( Z x , θ , α ) − CVaR α ′ ( Z x , θ , α ′ ) ) .
change in risk level
change in return distribution
Using the above propositions and Assumption 4 gives
∣ CVaR α ( Z x , θ , α ) − CVaR α ′ ( Z x , θ , α ′ ) ∣ ≤ Z max − Z min α min ∣ α − α ′ ∣ + 1 α min W 1 ( Z x , θ , α , Z x , θ , α ′ ) , \begin{aligned}
\left|\operatorname{CVaR}_{\alpha}(Z_{x,\theta,\alpha})-\operatorname{CVaR}_{\alpha'}(Z_{x,\theta,\alpha'})\right|
\le{}&\frac{Z_{\max}-Z_{\min}}{\alpha_{\min}}|\alpha-\alpha'|\\
&+\frac{1}{\alpha_{\min}}W_1(Z_{x,\theta,\alpha},Z_{x,\theta,\alpha'}),
\end{aligned} ∣ CVaR α ( Z x , θ , α ) − CVaR α ′ ( Z x , θ , α ′ ) ∣ ≤ α m i n Z m a x − Z m i n ∣ α − α ′ ∣ + α m i n 1 W 1 ( Z x , θ , α , Z x , θ , α ′ ) ,
provided Z x , θ , α ∈ [ Z min , Z max ] Z_{x,\theta,\alpha}\in[Z_{\min},Z_{\max}] Z x , θ , α ∈ [ Z m i n , Z m a x ] almost surely. Thus, the only remaining term to control is
W 1 ( Z x , θ , α , Z x , θ , α ′ ) . W_1(Z_{x,\theta,\alpha},Z_{x,\theta,\alpha'}). W 1 ( Z x , θ , α , Z x , θ , α ′ ) .
To do this, we need make some standard assumptions about our policy:
Assumption 8. For every x x x , θ \theta θ , y y y , the conditional policy is uniformly log-Lipschitz in the risk parameter α \alpha α , i.e.,
∣ log π θ ( y ∣ x , α ) − log π θ ( y ∣ x , α ′ ) ∣ ≤ L π ∣ α − α ′ ∣ . \left|\log\pi_\theta(y\mid x,\alpha)-\log\pi_\theta(y\mid x,\alpha')\right|
\le L_\pi|\alpha-\alpha'|. ∣ log π θ ( y ∣ x , α ) − log π θ ( y ∣ x , α ′ ) ∣ ≤ L π ∣ α − α ′ ∣.
Under Assumption 8, we can derive a Lipschitz bound on π θ ( ⋅ ∣ x , α ) \pi_\theta(\cdot\mid x,\alpha) π θ ( ⋅ ∣ x , α ) with respect to α \alpha α in total variation (TV) distance.
Lemma 3. Under Assumption 8, for every x x x , θ \theta θ , the conditional policy is uniformly TV-Lipschitz in the risk parameter α ∈ [ α min , α max ] \alpha\in[\alpha_{\min},\alpha_{\max}] α ∈ [ α m i n , α m a x ] , i.e.,
TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ≤ L π 2 ∣ α − α ′ ∣ . \operatorname{TV}\left(\pi_\theta(\cdot\mid x,\alpha),\pi_\theta(\cdot\mid x,\alpha')\right)
\le\frac{L_\pi}{2}|\alpha-\alpha'|. TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ≤ 2 L π ∣ α − α ′ ∣.
Proof. Assumption 8 gives
∣ log π θ ( y ∣ x , α ) − log π θ ( y ∣ x , α ′ ) ∣ ≤ L π ∣ α − α ′ ∣ . \left|\log\pi_\theta(y\mid x,\alpha)-\log\pi_\theta(y\mid x,\alpha')\right|
\le L_\pi|\alpha-\alpha'|. ∣ log π θ ( y ∣ x , α ) − log π θ ( y ∣ x , α ′ ) ∣ ≤ L π ∣ α − α ′ ∣.
Then
e − L π ∣ α − α ′ ∣ ≤ π θ ( y ∣ x , α ) π θ ( y ∣ x , α ′ ) ≤ e L π ∣ α − α ′ ∣ . e^{-L_\pi|\alpha-\alpha'|}
\le\frac{\pi_\theta(y\mid x,\alpha)}{\pi_\theta(y\mid x,\alpha')}
\le e^{L_\pi|\alpha-\alpha'|}. e − L π ∣ α − α ′ ∣ ≤ π θ ( y ∣ x , α ′ ) π θ ( y ∣ x , α ) ≤ e L π ∣ α − α ′ ∣ .
Let
r : = e L π ∣ α − α ′ ∣ . r:=e^{L_\pi|\alpha-\alpha'|}. r := e L π ∣ α − α ′ ∣ .
Then, for every y y y ,
π θ ( y ∣ x , α ) ≤ r π θ ( y ∣ x , α ′ ) , \pi_\theta(y\mid x,\alpha)\le r\pi_\theta(y\mid x,\alpha'), π θ ( y ∣ x , α ) ≤ r π θ ( y ∣ x , α ′ ) ,
π θ ( y ∣ x , α ′ ) ≤ r π θ ( y ∣ x , α ) . \pi_\theta(y\mid x,\alpha')\le r\pi_\theta(y\mid x,\alpha). π θ ( y ∣ x , α ′ ) ≤ r π θ ( y ∣ x , α ) .
Thus,
∣ π θ ( y ∣ x , α ) − π θ ( y ∣ x , α ′ ) ∣ ≤ ( r − 1 ) min { π θ ( y ∣ x , α ) , π θ ( y ∣ x , α ′ ) } . \left|\pi_\theta(y\mid x,\alpha)-\pi_\theta(y\mid x,\alpha')\right|
\le(r-1)\min\{\pi_\theta(y\mid x,\alpha),\pi_\theta(y\mid x,\alpha')\}. ∣ π θ ( y ∣ x , α ) − π θ ( y ∣ x , α ′ ) ∣ ≤ ( r − 1 ) min { π θ ( y ∣ x , α ) , π θ ( y ∣ x , α ′ )} .
Recall that, in discrete form [35 ] ,
TV ( p , q ) = 1 2 ∑ y ∣ p ( y ) − q ( y ) ∣ . \operatorname{TV}(p,q)=\frac{1}{2}\sum_y|p(y)-q(y)|. TV ( p , q ) = 2 1 y ∑ ∣ p ( y ) − q ( y ) ∣.
Using the identity
∑ y min { p ( y ) , q ( y ) } = 1 − TV ( p , q ) , \sum_y\min\{p(y),q(y)\}=1-\operatorname{TV}(p,q), y ∑ min { p ( y ) , q ( y )} = 1 − TV ( p , q ) ,
we obtain
TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ≤ 1 2 ( r − 1 ) ( 1 − TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ) . \operatorname{TV}\left(\pi_\theta(\cdot\mid x,\alpha),\pi_\theta(\cdot\mid x,\alpha')\right)
\le\frac{1}{2}(r-1)\left(1-\operatorname{TV}\left(\pi_\theta(\cdot\mid x,\alpha),\pi_\theta(\cdot\mid x,\alpha')\right)\right). TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ≤ 2 1 ( r − 1 ) ( 1 − TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ) .
Rearranging gives
TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ≤ r − 1 r + 1 . \operatorname{TV}\left(\pi_\theta(\cdot\mid x,\alpha),\pi_\theta(\cdot\mid x,\alpha')\right)
\le\frac{r-1}{r+1}. TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ≤ r + 1 r − 1 .
Substituting r = e L π ∣ α − α ′ ∣ r=e^{L_\pi|\alpha-\alpha'|} r = e L π ∣ α − α ′ ∣ , we have
r − 1 r + 1 = e L π ∣ α − α ′ ∣ − 1 e L π ∣ α − α ′ ∣ + 1 = tanh ( L π ∣ α − α ′ ∣ 2 ) . \frac{r-1}{r+1}
=\frac{e^{L_\pi|\alpha-\alpha'|}-1}{e^{L_\pi|\alpha-\alpha'|}+1}
=\tanh\left(\frac{L_\pi|\alpha-\alpha'|}{2}\right). r + 1 r − 1 = e L π ∣ α − α ′ ∣ + 1 e L π ∣ α − α ′ ∣ − 1 = tanh ( 2 L π ∣ α − α ′ ∣ ) .
Finally, since tanh ( s ) ≤ s \tanh(s)\le s tanh ( s ) ≤ s for all s ≥ 0 s\ge0 s ≥ 0 ,
TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ≤ L π 2 ∣ α − α ′ ∣ . \operatorname{TV}\left(\pi_\theta(\cdot\mid x,\alpha),\pi_\theta(\cdot\mid x,\alpha')\right)
\le\frac{L_\pi}{2}|\alpha-\alpha'|. TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ≤ 2 L π ∣ α − α ′ ∣.
This completes the proof. □
Then, we can control the W 1 ( Z x , θ , α , Z x , θ , α ′ ) W_1(Z_{x,\theta,\alpha},Z_{x,\theta,\alpha'}) W 1 ( Z x , θ , α , Z x , θ , α ′ ) .
Proposition 4. Under Assumptions 4 and 8, for all x , θ , α , α ′ , x,\theta,\alpha,\alpha', x , θ , α , α ′ ,
W 1 ( Z x , θ , α , Z x , θ , α ′ ) ≤ ( β L π + ( Z max − Z min ) L π 2 ) ∣ α − α ′ ∣ . W_1\left(Z_{x,\theta,\alpha},Z_{x,\theta,\alpha'}\right) \le\left(\beta L_\pi+(Z_{\max}-Z_{\min})\frac{L_\pi}{2}\right)|\alpha-\alpha'|. W 1 ( Z x , θ , α , Z x , θ , α ′ ) ≤ ( β L π + ( Z m a x − Z m i n ) 2 L π ) ∣ α − α ′ ∣.
Proof. Let
Y α ∼ π θ ( ⋅ ∣ x , α ) , Y α ′ ∼ π θ ( ⋅ ∣ x , α ′ ) Y_\alpha\sim\pi_\theta(\cdot\mid x,\alpha),\qquad Y_{\alpha'}\sim\pi_\theta(\cdot\mid x,\alpha') Y α ∼ π θ ( ⋅ ∣ x , α ) , Y α ′ ∼ π θ ( ⋅ ∣ x , α ′ )
be two random variables. There exists a maximal coupling such that (Lindvall, 2002)
Pr ( Y α = Y α ′ ) = ∑ y min { π θ ( y ∣ x , α ) , π θ ( y ∣ x , α ′ ) } . \Pr(Y_\alpha=Y_{\alpha'})=\sum_y\min\{\pi_\theta(y\mid x,\alpha),\pi_\theta(y\mid x,\alpha')\}. Pr ( Y α = Y α ′ ) = y ∑ min { π θ ( y ∣ x , α ) , π θ ( y ∣ x , α ′ )} .
Equivalently,
Pr ( Y α ≠ Y α ′ ) = 1 − ∑ y min { π θ ( y ∣ x , α ) , π θ ( y ∣ x , α ′ ) } . \Pr(Y_\alpha\ne Y_{\alpha'})=1-\sum_y\min\{\pi_\theta(y\mid x,\alpha),\pi_\theta(y\mid x,\alpha')\}. Pr ( Y α = Y α ′ ) = 1 − y ∑ min { π θ ( y ∣ x , α ) , π θ ( y ∣ x , α ′ )} .
Recall the definition of the total variation distance:
TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) = 1 2 ∑ y ∣ π θ ( y ∣ x , α ) − π θ ( y ∣ x , α ′ ) ∣ = 1 − ∑ y min { π θ ( y ∣ x , α ) , π θ ( y ∣ x , α ′ ) } . \begin{aligned}
\operatorname{TV}\left(\pi_\theta(\cdot\mid x,\alpha),\pi_\theta(\cdot\mid x,\alpha')\right)
=\frac{1}{2}\sum_y\left|\pi_\theta(y\mid x,\alpha)-\pi_\theta(y\mid x,\alpha')\right| \\
&=1-\sum_y\min\{\pi_\theta(y\mid x,\alpha),\pi_\theta(y\mid x,\alpha')\}.
\end{aligned} TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) = 2 1 y ∑ ∣ π θ ( y ∣ x , α ) − π θ ( y ∣ x , α ′ ) ∣ = 1 − y ∑ min { π θ ( y ∣ x , α ) , π θ ( y ∣ x , α ′ )} .
Therefore, under this maximal coupling,
Pr ( Y α ≠ Y α ′ ) = TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) . \Pr(Y_\alpha\ne Y_{\alpha'})=\operatorname{TV}\left(\pi_\theta(\cdot\mid x,\alpha),\pi_\theta(\cdot\mid x,\alpha')\right). Pr ( Y α = Y α ′ ) = TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) .
Now recall that, for two real-valued random variables U , V U,V U , V , the 1-Wasserstein distance is (Villani et al., 2009)
W 1 ( U , V ) = inf γ ∈ Γ ( U , V ) E γ ∣ U − V ∣ , W_1(U,V)=\inf_{\gamma\in\Gamma(U,V)}\mathbb{E}_\gamma|U-V|, W 1 ( U , V ) = γ ∈ Γ ( U , V ) inf E γ ∣ U − V ∣ ,
where Γ ( U , V ) \Gamma(U,V) Γ ( U , V ) is the set of all couplings of U U U and V V V . In other words, the Wasserstein distance is the smallest possible expected absolute difference over all joint constructions of U U U and V V V . In our case, once we choose a coupling of ( Y α , Y α ′ ) (Y_\alpha,Y_{\alpha'}) ( Y α , Y α ′ ) , we automatically induce a coupling of
( Z x , θ , α , Z x , θ , α ′ ) = ( G ( x , Y α ; α ) , G ( x , Y α ′ ; α ′ ) ) . (Z_{x,\theta,\alpha},Z_{x,\theta,\alpha'})=\left(G(x,Y_\alpha;\alpha),G(x,Y_{\alpha'};\alpha')\right). ( Z x , θ , α , Z x , θ , α ′ ) = ( G ( x , Y α ; α ) , G ( x , Y α ′ ; α ′ ) ) .
Since the Wasserstein distance is the infimum over all couplings, it is no larger than the expected cost under this particular coupling. Therefore,
W 1 ( Z x , θ , α , Z x , θ , α ′ ) ≤ E [ ∣ G ( x , Y α ; α ) − G ( x , Y α ′ ; α ′ ) ∣ ] . W_1\left(Z_{x,\theta,\alpha},Z_{x,\theta,\alpha'}\right)
\le\mathbb{E}\left[\left|G(x,Y_\alpha;\alpha)-G(x,Y_{\alpha'};\alpha')\right|\right]. W 1 ( Z x , θ , α , Z x , θ , α ′ ) ≤ E [ ∣ G ( x , Y α ; α ) − G ( x , Y α ′ ; α ′ ) ∣ ] .
Add and subtract G ( x , Y α ′ ; α ′ ) G(x,Y_{\alpha'};\alpha') G ( x , Y α ′ ; α ′ ) :
E [ ∣ G ( x , Y α ; α ) − G ( x , Y α ′ ; α ′ ) ∣ ] ≤ E [ ∣ G ( x , Y α ; α ) − G ( x , Y α ; α ′ ) ∣ ] + E [ ∣ G ( x , Y α ; α ′ ) − G ( x , Y α ′ ; α ′ ) ∣ ] . \mathbb{E}\left[\left|G(x,Y_\alpha;\alpha)-G(x,Y_{\alpha'};\alpha')\right|\right]
\le\mathbb{E}\left[\left|G(x,Y_\alpha;\alpha)-G(x,Y_\alpha;\alpha')\right|\right]
+\mathbb{E}\left[\left|G(x,Y_\alpha;\alpha')-G(x,Y_{\alpha'};\alpha')\right|\right]. E [ ∣ G ( x , Y α ; α ) − G ( x , Y α ′ ; α ′ ) ∣ ] ≤ E [ ∣ G ( x , Y α ; α ) − G ( x , Y α ; α ′ ) ∣ ] + E [ ∣ G ( x , Y α ; α ′ ) − G ( x , Y α ′ ; α ′ ) ∣ ] .
For the first term, only the policy-dependent log-ratio term depends explicitly on α \alpha α , so
∣ G ( x , y ; α ) − G ( x , y ; α ′ ) ∣ = β ∣ log π θ ( y ∣ x , α ) − log π θ ( y ∣ x , α ′ ) ∣ ≤ β L π ∣ α − α ′ ∣ . \left|G(x,y;\alpha)-G(x,y;\alpha')\right|
=\beta\left|\log\pi_\theta(y\mid x,\alpha)-\log\pi_\theta(y\mid x,\alpha')\right|
\le\beta L_\pi|\alpha-\alpha'|. ∣ G ( x , y ; α ) − G ( x , y ; α ′ ) ∣ = β ∣ log π θ ( y ∣ x , α ) − log π θ ( y ∣ x , α ′ ) ∣ ≤ β L π ∣ α − α ′ ∣.
Hence
E [ ∣ G ( x , Y α ; α ) − G ( x , Y α ; α ′ ) ∣ ] ≤ β L π ∣ α − α ′ ∣ . \mathbb{E}\left[\left|G(x,Y_\alpha;\alpha)-G(x,Y_\alpha;\alpha')\right|\right]\le\beta L_\pi|\alpha-\alpha'|. E [ ∣ G ( x , Y α ; α ) − G ( x , Y α ; α ′ ) ∣ ] ≤ β L π ∣ α − α ′ ∣.
For the second term, since G ( x , Y α ′ ; α ′ ) ∈ [ Z min , Z max ] G(x,Y_{\alpha'};\alpha')\in[Z_{\min},Z_{\max}] G ( x , Y α ′ ; α ′ ) ∈ [ Z m i n , Z m a x ] , we have
∣ G ( x , Y α ; α ′ ) − G ( x , Y α ′ ; α ′ ) ∣ ≤ ( Z max − Z min ) 1 { Y α ≠ Y α ′ } . \left|G(x,Y_\alpha;\alpha')-G(x,Y_{\alpha'};\alpha')\right|
\le(Z_{\max}-Z_{\min})\mathbf{1}\{Y_\alpha\ne Y_{\alpha'}\}. ∣ G ( x , Y α ; α ′ ) − G ( x , Y α ′ ; α ′ ) ∣ ≤ ( Z m a x − Z m i n ) 1 { Y α = Y α ′ } .
Therefore,
E [ ∣ G ( x , Y α ; α ′ ) − G ( x , Y α ′ ; α ′ ) ∣ ] ≤ ( Z max − Z min ) TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ≤ ( Z max − Z min ) L π 2 ∣ α − α ′ ∣ . \begin{aligned}
\mathbb{E}\left[\left|G(x,Y_\alpha;\alpha')-G(x,Y_{\alpha'};\alpha')\right|\right]
\le(Z_{\max}-Z_{\min})\operatorname{TV}\left(\pi_\theta(\cdot\mid x,\alpha),\pi_\theta(\cdot\mid x,\alpha')\right) \\
&\le(Z_{\max}-Z_{\min})\frac{L_\pi}{2}|\alpha-\alpha'|.
\end{aligned} E [ ∣ G ( x , Y α ; α ′ ) − G ( x , Y α ′ ; α ′ ) ∣ ] ≤ ( Z m a x − Z m i n ) TV ( π θ ( ⋅ ∣ x , α ) , π θ ( ⋅ ∣ x , α ′ ) ) ≤ ( Z m a x − Z m i n ) 2 L π ∣ α − α ′ ∣.
Combining the two bounds yields
W 1 ( Z x , θ , α , Z x , θ , α ′ ) ≤ ( β L π + ( Z max − Z min ) L π 2 ) ∣ α − α ′ ∣ . W_1\left(Z_{x,\theta,\alpha},Z_{x,\theta,\alpha'}\right)
\le\left(\beta L_\pi+(Z_{\max}-Z_{\min})\frac{L_\pi}{2}\right)|\alpha-\alpha'|. W 1 ( Z x , θ , α , Z x , θ , α ′ ) ≤ ( β L π + ( Z m a x − Z m i n ) 2 L π ) ∣ α − α ′ ∣.
This completes the proof. □
Finally, we can prove the Lipschitz bound for V ( θ , α ) \mathcal{V}(\theta,\alpha) V ( θ , α ) .
Theorem 5. Under Assumptions 4 and 8, for every θ \theta θ , we have
∣ V ( θ , α ) − V ( θ , α ′ ) ∣ ≤ L ∣ α − α ′ ∣ , |\mathcal{V}(\theta,\alpha)-\mathcal{V}(\theta,\alpha')|\le L|\alpha-\alpha'|, ∣ V ( θ , α ) − V ( θ , α ′ ) ∣ ≤ L ∣ α − α ′ ∣ ,
for all α , α ′ ∈ [ α min , α max ] \alpha,\alpha'\in[\alpha_{\min},\alpha_{\max}] α , α ′ ∈ [ α m i n , α m a x ] , where
L = ( Z max − Z min ) + β L π + ( Z max − Z min ) L π 2 α min . L=\frac{(Z_{\max}-Z_{\min})+\beta L_\pi+(Z_{\max}-Z_{\min})\frac{L_\pi}{2}}{\alpha_{\min}}. L = α m i n ( Z m a x − Z m i n ) + β L π + ( Z m a x − Z m i n ) 2 L π .
Proof. By the previous propositions, for each fixed x x x ,
∣ CVaR α ( Z x , θ , α ) − CVaR α ′ ( Z x , θ , α ′ ) ∣ ≤ Z max − Z min α min ∣ α − α ′ ∣ + β L π + ( Z max − Z min ) L π 2 α min ∣ α − α ′ ∣ . \left|\operatorname{CVaR}_{\alpha}(Z_{x,\theta,\alpha})-\operatorname{CVaR}_{\alpha'}(Z_{x,\theta,\alpha'})\right|
\le\frac{Z_{\max}-Z_{\min}}{\alpha_{\min}}|\alpha-\alpha'|
+\frac{\beta L_{\pi}+(Z_{\max}-Z_{\min})\frac{L_{\pi}}{2}}{\alpha_{\min}}|\alpha-\alpha'|. ∣ CVaR α ( Z x , θ , α ) − CVaR α ′ ( Z x , θ , α ′ ) ∣ ≤ α m i n Z m a x − Z m i n ∣ α − α ′ ∣ + α m i n β L π + ( Z m a x − Z m i n ) 2 L π ∣ α − α ′ ∣.
Taking expectation over x ∼ D x\sim\mathcal{D} x ∼ D gives
∣ V ( θ , α ) − V ( θ , α ′ ) ∣ ≤ L ∣ α − α ′ ∣ . \left|\mathcal{V}(\theta,\alpha)-\mathcal{V}(\theta,\alpha')\right|\le L|\alpha-\alpha'|. ∣ V ( θ , α ) − V ( θ , α ′ ) ∣ ≤ L ∣ α − α ′ ∣.
This completes the proof.
Theorem 6. Let
V ⋆ ( α ) : = sup θ V ( θ , α ) . \mathcal{V}^{\star}(\alpha):=\sup_{\theta}\mathcal{V}(\theta,\alpha). V ⋆ ( α ) := θ sup V ( θ , α ) . Under Assumptions 4 and 8 , we have
∣ V ⋆ ( α ) − V ⋆ ( α ′ ) ∣ ≤ L ∣ α − α ′ ∣ . \left|\mathcal{V}^{\star}(\alpha)-\mathcal{V}^{\star}(\alpha')\right|\le L|\alpha-\alpha'|. ∣ V ⋆ ( α ) − V ⋆ ( α ′ ) ∣ ≤ L ∣ α − α ′ ∣.
Proof. Using Theorem 5, we have
V ⋆ ( α ) − V ⋆ ( α ′ ) = sup θ V ( θ , α ) − sup θ V ( θ , α ′ ) ≤ sup θ ( V ( θ , α ) − V ( θ , α ′ ) ) ≤ L ∣ α − α ′ ∣ . \mathcal{V}^{\star}(\alpha)-\mathcal{V}^{\star}(\alpha')
=\sup_{\theta}\mathcal{V}(\theta,\alpha)-\sup_{\theta}\mathcal{V}(\theta,\alpha')
\le\sup_{\theta}\left(\mathcal{V}(\theta,\alpha)-\mathcal{V}(\theta,\alpha')\right)
\le L|\alpha-\alpha'|. V ⋆ ( α ) − V ⋆ ( α ′ ) = θ sup V ( θ , α ) − θ sup V ( θ , α ′ ) ≤ θ sup ( V ( θ , α ) − V ( θ , α ′ ) ) ≤ L ∣ α − α ′ ∣.
Swapping α \alpha α and α ′ \alpha' α ′ gives the reverse inequality. Hence
∣ V ⋆ ( α ) − V ⋆ ( α ′ ) ∣ ≤ L ∣ α − α ′ ∣ . \left|\mathcal{V}^{\star}(\alpha)-\mathcal{V}^{\star}(\alpha')\right|\le L|\alpha-\alpha'|. ∣ V ⋆ ( α ) − V ⋆ ( α ′ ) ∣ ≤ L ∣ α − α ′ ∣.
Theorem 7. Under Assumptions 4 and 8 , let
A h = { α 1 , … , α K } ⊂ [ α min , α max ] \mathcal{A}_{h}=\{\alpha_{1},\ldots,\alpha_{K}\}\subset[\alpha_{\min},\alpha_{\max}] A h = { α 1 , … , α K } ⊂ [ α m i n , α m a x ] with mesh size
h : = max i ( α i + 1 − α i ) . h:=\max_{i}(\alpha_{i+1}-\alpha_{i}). h := i max ( α i + 1 − α i ) . Suppose the learned risk-conditioned policy θ ^ \hat{\theta} θ ^ satisfies
max 1 ≤ i ≤ K ( V ⋆ ( α i ) − V ( θ ^ , α i ) ) ≤ ε . \max_{1\le i\le K}\left(\mathcal{V}^{\star}(\alpha_{i})-\mathcal{V}(\hat{\theta},\alpha_{i})\right)\le\varepsilon. 1 ≤ i ≤ K max ( V ⋆ ( α i ) − V ( θ ^ , α i ) ) ≤ ε . Then
sup α ∈ [ α min , α max ] ( V ⋆ ( α ) − V ( θ ^ , α ) ) ≤ ε + 2 L h . \sup_{\alpha\in[\alpha_{\min},\alpha_{\max}]}\left(\mathcal{V}^{\star}(\alpha)-\mathcal{V}(\hat{\theta},\alpha)\right)\le\varepsilon+2Lh. α ∈ [ α m i n , α m a x ] sup ( V ⋆ ( α ) − V ( θ ^ , α ) ) ≤ ε + 2 L h .
Proof. Take any α ∈ [ α min , α max ] \alpha\in[\alpha_{\min},\alpha_{\max}] α ∈ [ α m i n , α m a x ] . Choose a nearest grid point α i ∈ A h \alpha_i\in\mathcal{A}_h α i ∈ A h such that
∣ α − α i ∣ ≤ h . |\alpha-\alpha_i|\le h. ∣ α − α i ∣ ≤ h .
Then
V ⋆ ( α ) − V ( θ ^ , α ) = ( V ⋆ ( α ) − V ⋆ ( α i ) ) + ( V ⋆ ( α i ) − V ( θ ^ , α i ) ) + ( V ( θ ^ , α i ) − V ( θ ^ , α ) ) . \begin{aligned}
\mathcal{V}^{\star}(\alpha)-\mathcal{V}(\hat{\theta},\alpha)
={}&\left(\mathcal{V}^{\star}(\alpha)-\mathcal{V}^{\star}(\alpha_i)\right)\\
&+\left(\mathcal{V}^{\star}(\alpha_i)-\mathcal{V}(\hat{\theta},\alpha_i)\right)\\
&+\left(\mathcal{V}(\hat{\theta},\alpha_i)-\mathcal{V}(\hat{\theta},\alpha)\right).
\end{aligned} V ⋆ ( α ) − V ( θ ^ , α ) = ( V ⋆ ( α ) − V ⋆ ( α i ) ) + ( V ⋆ ( α i ) − V ( θ ^ , α i ) ) + ( V ( θ ^ , α i ) − V ( θ ^ , α ) ) .
Now bound each term:
V ⋆ ( α ) − V ⋆ ( α i ) ≤ L ∣ α − α i ∣ ≤ L h , \mathcal{V}^{\star}(\alpha)-\mathcal{V}^{\star}(\alpha_i)\le L|\alpha-\alpha_i|\le Lh, V ⋆ ( α ) − V ⋆ ( α i ) ≤ L ∣ α − α i ∣ ≤ L h ,
V ⋆ ( α i ) − V ( θ ^ , α i ) ≤ ε , \mathcal{V}^{\star}(\alpha_i)-\mathcal{V}(\hat{\theta},\alpha_i)\le\varepsilon, V ⋆ ( α i ) − V ( θ ^ , α i ) ≤ ε ,
and
V ( θ ^ , α i ) − V ( θ ^ , α ) ≤ L ∣ α − α i ∣ ≤ L h . \mathcal{V}(\hat{\theta},\alpha_i)-\mathcal{V}(\hat{\theta},\alpha)\le L|\alpha-\alpha_i|\le Lh. V ( θ ^ , α i ) − V ( θ ^ , α ) ≤ L ∣ α − α i ∣ ≤ L h .
Adding these bounds gives
V ⋆ ( α ) − V ( θ ^ , α ) ≤ ε + 2 L h . \mathcal{V}^{\star}(\alpha)-\mathcal{V}(\hat{\theta},\alpha)\le\varepsilon+2Lh. V ⋆ ( α ) − V ( θ ^ , α ) ≤ ε + 2 L h .
Taking the supremum over α \alpha α completes the proof.
Remark. Theorem 7 decomposes the uniform suboptimality of the learned risk-conditioned policy into two components. The term ε \varepsilon ε measures the gap between the learned conditioned policy and the optimal CVaR frontier on the training risk grid. This term depends on how well Algorithm 1 optimizes the risk-conditioned objective at the sampled risk levels. Our convergence result in Theorem 4 does not directly give a global optimality bound for ε \varepsilon ε , but it shows that the actual training algorithm approaches a stationary point of the original objective. Thus, as the stochastic optimization error decreases, this grid-level approximation error is expected to become smaller. The term 2 L h 2Lh 2 L h is the discretization or coverage error. It arises because the model is trained only on a finite grid of risk levels. The mesh size h h h measures the largest gap between adjacent training risk levels, and the Lipschitz constant L L L controls how quickly the CVaR value and the optimal frontier can vary with α \alpha α . Therefore, a denser risk grid reduces the off-grid interpolation error. Overall, the theorem shows that a single risk-conditioned policy can uniformly approximate the entire CVaR frontier when it is well optimized on the training grid and the grid sufficiently covers the desired risk interval.
Analysis of Logit-Mixing LM
In this section, we analyze a natural post-hoc alternative to risk-conditioned training: linearly interpolating the logits of fixed-risk policies at inference time (Liu et al., 2024b; Kangaslahti and Alvarez-Melis, 2024; Zhou et al., 2024). For a target risk level α \alpha α , let α 0 ≤ α ≤ α 1 \alpha_0 \le\alpha\le\alpha_1 α 0 ≤ α ≤ α 1 be the two nearest trained risk levels, and let π α 0 \pi_{\alpha_0} π α 0 and π α 1 \pi_{\alpha_1} π α 1 denote the corresponding fixed-risk policies. For an interpolation coefficient τ ∈ [ 0 , 1 ] \tau\in[0,1] τ ∈ [ 0 , 1 ] , the logit-mixing policy forms
ℓ m i x ( x ) = ( 1 − τ ) ℓ α 0 ( x ) + τ ℓ α 1 ( x ) . \ell_{\mathrm{mix}}(x) = (1-\tau)\ell_{\alpha_0}(x) + \tau\ell_{\alpha_1}(x). ℓ mix ( x ) = ( 1 − τ ) ℓ α 0 ( x ) + τ ℓ α 1 ( x ) .
where ℓ α 0 ( x ) \ell_{\alpha_0}(x) ℓ α 0 ( x ) and ℓ α 1 ( x ) \ell_{\alpha_1}(x) ℓ α 1 ( x ) are the next-token logits produced by the two endpoint policies. After applying the softmax, this is equivalent to
π m i x ( y ∣ x ) = π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ Z τ ( x ) . \pi_{\mathrm{mix}}(y \mid x) = \frac{\pi_{\alpha_0}(y \mid x)^{1-\tau}\pi_{\alpha_1}(y \mid x)^\tau}{Z_\tau(x)}. π mix ( y ∣ x ) = Z τ ( x ) π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ .
where
Z τ ( x ) = ∑ y ∈ Y π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ Z_\tau(x) = \sum_{y\in\mathcal{Y}} \pi_{\alpha_0}(y \mid x)^{1-\tau}\pi_{\alpha_1}(y \mid x)^\tau Z τ ( x ) = y ∈ Y ∑ π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ
is the normalization constant. This equivalence follows because linearly interpolating logits corresponds to taking a normalized mean of the endpoint probability distributions. Notice that the logit-mixing policy differs from our logit-conditioned policy. Logit-mixing policy interpolates the logits of independently trained fixed-risk models at inference time, whereas our logit-conditioned policy learns a single shared model whose output layer is directly conditioned on α \alpha α . Next, we show a limitation of such logit-mixing policy: it can only interpolate behaviors already supported by the endpoint policies. Therefore, if an intermediate risk level requires a response set that receives very small probability under both endpoints, logit-mixing policy cannot recover that behavior.
Proposition 5. Fix a prompt x x x , two endpoint policies π α 0 \pi_{\alpha_0} π α 0 and π α 1 \pi_{\alpha_1} π α 1 , and an interpolation coefficient τ ∈ [ 0 , 1 ] \tau\in[0,1] τ ∈ [ 0 , 1 ] . Let π m i x \pi_{\mathrm{mix}} π mix be the logit-mixed policy defined above. For any response set A ( x ) ⊆ Y A(x) \subseteq\mathcal{Y} A ( x ) ⊆ Y , suppose
π α 0 ( A ( x ) ∣ x ) ≤ ε 0 , π α 1 ( A ( x ) ∣ x ) ≤ ε 1 . \pi_{\alpha_0}(A(x)\mid x) \le\varepsilon_0,\qquad\pi_{\alpha_1}(A(x)\mid x) \le\varepsilon_1. π α 0 ( A ( x ) ∣ x ) ≤ ε 0 , π α 1 ( A ( x ) ∣ x ) ≤ ε 1 . Then
π m i x ( A ( x ) ∣ x ) ≤ ε 0 1 − τ ε 1 τ Z τ ( x ) . \pi_{\mathrm{mix}}(A(x)\mid x) \le\frac{\varepsilon_0^{1-\tau}\varepsilon_1^\tau}{Z_\tau(x)}. π mix ( A ( x ) ∣ x ) ≤ Z τ ( x ) ε 0 1 − τ ε 1 τ . In particular, if Z τ ( x ) ≥ ζ > 0 Z_\tau(x) \ge\zeta> 0 Z τ ( x ) ≥ ζ > 0 , then
π m i x ( A ( x ) ∣ x ) ≤ ε 0 1 − τ ε 1 τ ζ . \pi_{\mathrm{mix}}(A(x)\mid x) \le\frac{\varepsilon_0^{1-\tau}\varepsilon_1^\tau}{\zeta}. π mix ( A ( x ) ∣ x ) ≤ ζ ε 0 1 − τ ε 1 τ . Consequently, if an optimal intermediate-risk policy satisfies
π α ∗ ( A ( x ) ∣ x ) ≥ p , \pi^*_\alpha(A(x)\mid x) \ge p, π α ∗ ( A ( x ) ∣ x ) ≥ p , then
TV ( π α ∗ ( ⋅ ∣ x ) , π m i x ( ⋅ ∣ x ) ) ≥ p − ε 0 1 − τ ε 1 τ ζ . \operatorname{TV}\left(\pi^*_\alpha(\cdot\mid x),\pi_{\mathrm{mix}}(\cdot\mid x)\right) \ge p-\frac{\varepsilon_0^{1-\tau}\varepsilon_1^\tau}{\zeta}. TV ( π α ∗ ( ⋅ ∣ x ) , π mix ( ⋅ ∣ x ) ) ≥ p − ζ ε 0 1 − τ ε 1 τ .
Proof. By definition of the logit-mixed policy,
π m i x ( A ( x ) ∣ x ) = ∑ y ∈ A ( x ) π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ Z τ ( x ) . \pi_{\mathrm{mix}}(A(x)\mid x)
= \sum_{y\in A(x)} \frac{\pi_{\alpha_0}(y\mid x)^{1-\tau}\pi_{\alpha_1}(y\mid x)^\tau}{Z_\tau(x)}. π mix ( A ( x ) ∣ x ) = y ∈ A ( x ) ∑ Z τ ( x ) π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ .
Thus,
π m i x ( A ( x ) ∣ x ) = ∑ y ∈ A ( x ) π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ Z τ ( x ) . \pi_{\mathrm{mix}}(A(x)\mid x)
= \frac{\sum_{y\in A(x)}\pi_{\alpha_0}(y\mid x)^{1-\tau}\pi_{\alpha_1}(y\mid x)^\tau}{Z_\tau(x)}. π mix ( A ( x ) ∣ x ) = Z τ ( x ) ∑ y ∈ A ( x ) π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ .
For τ ∈ ( 0 , 1 ) \tau\in(0,1) τ ∈ ( 0 , 1 ) , Hölder’s inequality (Hardy et al., 1952) gives
∑ y ∈ A ( x ) π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ ≤ ( ∑ y ∈ A ( x ) π α 0 ( y ∣ x ) ) 1 − τ ( ∑ y ∈ A ( x ) π α 1 ( y ∣ x ) ) τ . \sum_{y\in A(x)}\pi_{\alpha_0}(y\mid x)^{1-\tau}\pi_{\alpha_1}(y\mid x)^\tau
\le
\left(\sum_{y\in A(x)}\pi_{\alpha_0}(y\mid x)\right)^{1-\tau}
\left(\sum_{y\in A(x)}\pi_{\alpha_1}(y\mid x)\right)^\tau. y ∈ A ( x ) ∑ π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ ≤ y ∈ A ( x ) ∑ π α 0 ( y ∣ x ) 1 − τ y ∈ A ( x ) ∑ π α 1 ( y ∣ x ) τ .
Therefore,
∑ y ∈ A ( x ) π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ ≤ π α 0 ( A ( x ) ∣ x ) 1 − τ π α 1 ( A ( x ) ∣ x ) τ ≤ ε 0 1 − τ ε 1 τ . \sum_{y\in A(x)}\pi_{\alpha_0}(y\mid x)^{1-\tau}\pi_{\alpha_1}(y\mid x)^\tau
\le\pi_{\alpha_0}(A(x)\mid x)^{1-\tau}\pi_{\alpha_1}(A(x)\mid x)^\tau
\le\varepsilon_0^{1-\tau}\varepsilon_1^\tau. y ∈ A ( x ) ∑ π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ ≤ π α 0 ( A ( x ) ∣ x ) 1 − τ π α 1 ( A ( x ) ∣ x ) τ ≤ ε 0 1 − τ ε 1 τ .
Substituting this into the expression for π m i x ( A ( x ) ∣ x ) \pi_{\mathrm{mix}}(A(x)\mid x) π mix ( A ( x ) ∣ x ) yields
π m i x ( A ( x ) ∣ x ) ≤ ε 0 1 − τ ε 1 τ Z τ ( x ) . \pi_{\mathrm{mix}}(A(x)\mid x) \le\frac{\varepsilon_0^{1-\tau}\varepsilon_1^\tau}{Z_\tau(x)}. π mix ( A ( x ) ∣ x ) ≤ Z τ ( x ) ε 0 1 − τ ε 1 τ .
The endpoint cases τ = 0 \tau= 0 τ = 0 and τ = 1 \tau= 1 τ = 1 reduce directly to π α 0 ( A ( x ) ∣ x ) ≤ ε 0 \pi_{\alpha_0}(A(x)\mid x) \le\varepsilon_0 π α 0 ( A ( x ) ∣ x ) ≤ ε 0 and π α 1 ( A ( x ) ∣ x ) ≤ ε 1 \pi_{\alpha_1}(A(x)\mid x) \le\varepsilon_1 π α 1 ( A ( x ) ∣ x ) ≤ ε 1 , respectively, so the same bound holds. Now suppose that
π α ∗ ( A ( x ) ∣ x ) ≥ p . \pi^*_\alpha(A(x)\mid x) \ge p. π α ∗ ( A ( x ) ∣ x ) ≥ p .
By the definition of total variation distance,
TV ( P , Q ) = sup B ⊆ Y ∣ P ( B ) − Q ( B ) ∣ . \operatorname{TV}(P,Q) = \sup_{B\subseteq\mathcal{Y}} \lvert P(B)-Q(B)\rvert. TV ( P , Q ) = B ⊆ Y sup ∣ P ( B ) − Q ( B )∣ .
Taking B = A ( x ) B=A(x) B = A ( x ) , we obtain
TV ( π α ∗ ( ⋅ ∣ x ) , π m i x ( ⋅ ∣ x ) ) ≥ π α ∗ ( A ( x ) ∣ x ) − π m i x ( A ( x ) ∣ x ) . \operatorname{TV}(\pi^*_\alpha(\cdot\mid x),\pi_{\mathrm{mix}}(\cdot\mid x))\geq\pi^*_\alpha(A(x)\mid x)-\pi_{\mathrm{mix}}(A(x)\mid x). TV ( π α ∗ ( ⋅ ∣ x ) , π mix ( ⋅ ∣ x )) ≥ π α ∗ ( A ( x ) ∣ x ) − π mix ( A ( x ) ∣ x ) .
Using the previous upper bound on π m i x ( A ( x ) ∣ x ) \pi_{\mathrm{mix}}(A(x)\mid x) π mix ( A ( x ) ∣ x ) , we get
TV ( π α ∗ ( ⋅ ∣ x ) , π m i x ( ⋅ ∣ x ) ) ≥ p − ε 0 1 − τ ε 1 τ Z τ ( x ) . \operatorname{TV}(\pi^*_\alpha(\cdot\mid x),\pi_{\mathrm{mix}}(\cdot\mid x))\geq p-\frac{\varepsilon_0^{1-\tau}\varepsilon_1^\tau}{Z_\tau(x)}. TV ( π α ∗ ( ⋅ ∣ x ) , π mix ( ⋅ ∣ x )) ≥ p − Z τ ( x ) ε 0 1 − τ ε 1 τ .
If Z τ ( x ) ≥ ζ > 0 Z_\tau(x)\geq\zeta>0 Z τ ( x ) ≥ ζ > 0 , the stated ζ \zeta ζ -dependent bound follows immediately. The lower bound Z τ ( x ) ≥ ζ Z_\tau(x)\geq\zeta Z τ ( x ) ≥ ζ can be justified under a mild bounded divergence condition between the two endpoint policies. Indeed,
Z τ ( x ) = ∑ y ∈ Y π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ = E Y ∼ π α 0 ( ⋅ ∣ x ) [ ( π α 1 ( Y ∣ x ) π α 0 ( Y ∣ x ) ) τ ] . \begin{aligned}
Z_\tau(x)=\sum_{y\in\mathcal{Y}}\pi_{\alpha_0}(y\mid x)^{1-\tau}\pi_{\alpha_1}(y\mid x)^\tau\\
&=\mathbb{E}_{Y\sim\pi_{\alpha_0}(\cdot\mid x)}\left[\left(\frac{\pi_{\alpha_1}(Y\mid x)}{\pi_{\alpha_0}(Y\mid x)}\right)^\tau\right].
\end{aligned} Z τ ( x ) = y ∈ Y ∑ π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ = E Y ∼ π α 0 ( ⋅ ∣ x ) [ ( π α 0 ( Y ∣ x ) π α 1 ( Y ∣ x ) ) τ ] .
By the definition of Rényi divergence of order τ ∈ ( 0 , 1 ) \tau\in(0,1) τ ∈ ( 0 , 1 ) ((Rényi, 1961; Van Erven and Harremos, 2014)),
D τ ( π α 1 ( ⋅ ∣ x ) ∥ π α 0 ( ⋅ ∣ x ) ) = 1 τ − 1 log ∑ y ∈ Y π α 1 ( y ∣ x ) τ π α 0 ( y ∣ x ) 1 − τ . D_\tau(\pi_{\alpha_1}(\cdot\mid x)\Vert\pi_{\alpha_0}(\cdot\mid x))
=\frac{1}{\tau-1}\log\sum_{y\in\mathcal{Y}}\pi_{\alpha_1}(y\mid x)^\tau\pi_{\alpha_0}(y\mid x)^{1-\tau}. D τ ( π α 1 ( ⋅ ∣ x ) ∥ π α 0 ( ⋅ ∣ x )) = τ − 1 1 log y ∈ Y ∑ π α 1 ( y ∣ x ) τ π α 0 ( y ∣ x ) 1 − τ .
Therefore,
Z τ ( x ) = exp ( ( τ − 1 ) D τ ( π α 1 ( ⋅ ∣ x ) ∥ π α 0 ( ⋅ ∣ x ) ) ) . Z_\tau(x)=\exp\left((\tau-1)D_\tau(\pi_{\alpha_1}(\cdot\mid x)\Vert\pi_{\alpha_0}(\cdot\mid x))\right). Z τ ( x ) = exp ( ( τ − 1 ) D τ ( π α 1 ( ⋅ ∣ x ) ∥ π α 0 ( ⋅ ∣ x )) ) .
If the endpoint policies have bounded Rényi divergence on the considered domain, i.e.,
D τ ( π α 1 ( ⋅ ∣ x ) ∥ π α 0 ( ⋅ ∣ x ) ) ≤ D ⋆ , D_\tau(\pi_{\alpha_1}(\cdot\mid x)\Vert\pi_{\alpha_0}(\cdot\mid x))\leq D^\star, D τ ( π α 1 ( ⋅ ∣ x ) ∥ π α 0 ( ⋅ ∣ x )) ≤ D ⋆ ,
then, since τ − 1 < 0 \tau-1<0 τ − 1 < 0 ,
Z τ ( x ) ≥ exp ( ( τ − 1 ) D ⋆ ) = e − ( 1 − τ ) D ⋆ = : ζ . Z_\tau(x)\geq\exp((\tau-1)D^\star)=e^{-(1-\tau)D^\star}=:\zeta. Z τ ( x ) ≥ exp (( τ − 1 ) D ⋆ ) = e − ( 1 − τ ) D ⋆ =: ζ .
Proposition 5 highlights a structural limitation of logit mixing. Because logit mixing linearly interpolates the endpoint logits, the resulting probability distribution is a normalized geometric mixture of the two endpoint policies. As a result, it cannot assign substantial probability to response regions that are weakly supported by both endpoints. In other words, if an intermediate risk level requires behavior that is not already represented by either fixed-risk policy, linear logit interpolation is unlikely to recover it. By contrast, our risk-conditioned policy does not interpolate between independently trained endpoint policies. Instead, the risk level α \alpha α is injected into the model parameters through a learned gating mechanism, allowing the mapping from α \alpha α to the policy distribution to be nonlinear. This gives the model greater flexibility to learn intermediate risk-sensitive behaviors during training, rather than being restricted to the support and geometry induced by endpoint logit interpolation.
To view this more clearly, consider a single prompt x x x with three possible response types: Y = { y s a f e , y b a l a n c e d , y u n s a f e } \mathcal{Y}=\{y_{\mathrm{safe}},y_{\mathrm{balanced}},y_{\mathrm{unsafe}}\} Y = { y safe , y balanced , y unsafe } . Suppose the small-risk endpoint policy assigns most probability to the safest response,
π α 0 = ( 1 − δ , δ , δ ) , \pi_{\alpha_0}=(1-\delta,\delta,\delta), π α 0 = ( 1 − δ , δ , δ ) ,
while the large-risk endpoint policy assigns most probability to the direct response,
π α 1 = ( δ , δ , 1 − δ ) , \pi_{\alpha_1}=(\delta,\delta,1-\delta), π α 1 = ( δ , δ , 1 − δ ) ,
where the coordinates correspond to the probability of ( y s a f e , y b a l a n c e d , y u n s a f e ) (y_{\mathrm{safe}},y_{\mathrm{balanced}},y_{\mathrm{unsafe}}) ( y safe , y balanced , y unsafe ) and δ > 0 \delta>0 δ > 0 is small. The balanced response y b a l a n c e d y_{\mathrm{balanced}} y balanced is the desired behavior at an intermediate risk level, but it receives only probability δ \delta δ under both endpoint policies.
For any interpolation coefficient τ ∈ [ 0 , 1 ] \tau\in[0,1] τ ∈ [ 0 , 1 ] , logit mixing gives
π m i x ( y ∣ x ) = π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ Z τ ( x ) . \pi_{\mathrm{mix}}(y\mid x)=\frac{\pi_{\alpha_0}(y\mid x)^{1-\tau}\pi_{\alpha_1}(y\mid x)^\tau}{Z_\tau(x)}. π mix ( y ∣ x ) = Z τ ( x ) π α 0 ( y ∣ x ) 1 − τ π α 1 ( y ∣ x ) τ .
Therefore,
π m i x ( y b a l a n c e d ∣ x ) = δ Z τ ( x ) . \pi_{\mathrm{mix}}(y_{\mathrm{balanced}}\mid x)=\frac{\delta}{Z_\tau(x)}. π mix ( y balanced ∣ x ) = Z τ ( x ) δ .
In contrast, the endpoint-supported responses have unnormalized masses
( 1 − δ ) 1 − τ δ τ and δ 1 − τ ( 1 − δ ) τ . (1-\delta)^{1-\tau}\delta^\tau\qquad\text{and}\qquad\delta^{1-\tau}(1-\delta)^\tau. ( 1 − δ ) 1 − τ δ τ and δ 1 − τ ( 1 − δ ) τ .
At τ = 1 / 2 \tau=1/2 τ = 1/2 , for example,
Z 1 / 2 ( x ) = 2 δ ( 1 − δ ) + δ , Z_{1/2}(x)=2\sqrt{\delta(1-\delta)}+\delta, Z 1/2 ( x ) = 2 δ ( 1 − δ ) + δ ,
and hence
π m i x ( y b a l a n c e d ∣ x ) = δ 2 δ ( 1 − δ ) + δ ≈ δ 2 . \pi_{\mathrm{mix}}(y_{\mathrm{balanced}}\mid x)=\frac{\delta}{2\sqrt{\delta(1-\delta)}+\delta}\approx\frac{\sqrt{\delta}}{2}. π mix ( y balanced ∣ x ) = 2 δ ( 1 − δ ) + δ δ ≈ 2 δ .
Thus, when δ \delta δ is small, the balanced response remains unlikely under logit mixing even though it is precisely the desired intermediate behavior. This illustrates the limitation captured by Proposition 5 : linear logit interpolation can only recombine behaviors already supported by the endpoint policies. A risk-conditioned policy trained directly over α \alpha α , by contrast, can learn to assign high probability to y b a l a n c e d y_{\mathrm{balanced}} y balanced at intermediate risk levels through its nonlinear conditioning mechanism.
Additional Implementation Details
Implementation Details for Conditioning Mechanisms
Implementation of logit-conditioned. For the logit-conditioned variant, we instantiate the conditioned subset S S S as the final language model output layer. Let h ∈ R d i n h \in\mathbb{R}^{d_{\mathrm{in}}} h ∈ R d in denote the final hidden state and let W r e f ∈ R d o u t × d i n W^{\mathrm{ref}} \in\mathbb{R}^{d_{\mathrm{out}} \times d_{\mathrm{in}}} W ref ∈ R d out × d in be the frozen output matrix of the base model. The base logits are
z r e f = W r e f h . z^{\mathrm{ref}} = W^{\mathrm{ref}}h. z ref = W ref h .
We add an α \alpha α -dependent LoRA-style correction. Specifically, for K K K basis updates, each update is parameterized as a rank-r r r product
Δ W k = B k A k , A k ∈ R r × d i n , B k ∈ R d o u t × r \Delta W^k = B^k A^k,\qquad A^k \in\mathbb{R}^{r \times d_{\mathrm{in}}},\qquad B^k \in\mathbb{R}^{d_{\mathrm{out}} \times r} Δ W k = B k A k , A k ∈ R r × d in , B k ∈ R d out × r
A gating network g g g maps the scalar risk level α \alpha α to mixture weights
m α = softmax ( g ( α ) ) . m_\alpha= \operatorname{softmax}(g(\alpha)). m α = softmax ( g ( α )) .
The final logits are
z α = W r e f h + λ r ∑ k = 1 K m α k B k A k h . z_\alpha= W^{\mathrm{ref}}h + \frac{\lambda}{r}\sum_{k=1}^{K}m_\alpha^k B^k A^k h. z α = W ref h + r λ k = 1 ∑ K m α k B k A k h .
where λ \lambda λ is the LoRA scaling coefficient. In our implementation, the gating network g g g is a two-layer MLP with a 32-dimensional hidden layer and tanh activation. Given the scalar risk level α \alpha α , it produces mixture weights through
m α = softmax ( W 2 tanh ( W 1 α + b 1 ) + b 2 ) , m_\alpha= \operatorname{softmax}(W_2 \tanh(W_1\alpha+ b_1) + b_2), m α = softmax ( W 2 tanh ( W 1 α + b 1 ) + b 2 ) ,
where m α ∈ Δ K − 1 m_\alpha\in\Delta^{K-1} m α ∈ Δ K − 1 . We initialize A k A^k A k with Kaiming uniform initialization and initialize B k B^k B k to zero, so the model initially matches the frozen base policy before learning the risk-conditioned correction. Only the LoRA matrices and the gating network are trainable. All base-model parameters are frozen. In all experiments, we use K = 5 K = 5 K = 5 , r = 8 r = 8 r = 8 , and λ = 16 \lambda= 16 λ = 16 .
Implementation of attention-conditioned. For the attention-conditioned variant, we instantiate the conditioned subset S S S as selected attention projections in the base language model. In Pythia, we apply conditioning to two attention projections in each attention block: the query-key-value projection and the attention output projection. For either projection, let h h h be the hidden state and W r e f W^{\mathrm{ref}} W ref denote its frozen base weight. We replace the original projection h ↦ W r e f h h \mapsto W^{\mathrm{ref}}h h ↦ W ref h with the risk-conditioned projection
h ↦ W r e f h + λ r ∑ k = 1 K m α k B k A k h . h \mapsto W^{\mathrm{ref}}h + \frac{\lambda}{r}\sum_{k=1}^{K}m_\alpha^k B^k A^k h. h ↦ W ref h + r λ k = 1 ∑ K m α k B k A k h .
Here A k A^k A k and B k B^k B k define the k k k -th rank-r r r LoRA basis update, λ \lambda λ is the LoRA scaling coefficient, and m α ∈ Δ K − 1 m_\alpha\in\Delta^{K-1} m α ∈ Δ K − 1 is produced by the gating network from the scalar risk level α \alpha α . Thus, unlike logit conditioning, which modifies only the final output, attention conditioning injects α \alpha α into the internal attention computation before the final token logits are produced.
The gating network is the same architecture as in the logit-conditioned case. Similarly, we initialize the A k A^k A k matrices with Kaiming uniform initialization and initialize the B k B^k B k matrices to zero. During training, only the LoRA basis updates and the gating networks are optimized. All original base-model parameters remain frozen. In all experiments, we use K = 5 K = 5 K = 5 , r = 8 r = 8 r = 8 , and λ = 16 \lambda= 16 λ = 16 .
Implementation of prompt-conditioned. For the prompt-conditioned variant, we encode the target risk level directly in the input text. Given a prompt x x x and risk level α \alpha α , we prepend x x x with a short natural language instruction that specifies both the value of α \alpha α and its interpretation. For example, when α = 0.2 \alpha= 0.2 α = 0.2 , we use the prefix: Risk control alpha: 0.2. Tail-risk objective: lower alpha means stricter safety. Minimize the average safety cost among the worst 20% of possible responses. The final model input is the concatenation of this prefix and the original prompt x x x . We include the explanatory text because the scalar value of α \alpha α alone may be difficult for the model to interpret. We found this natural language description improved the model’s ability to respond consistently to different risk levels.
Implementation Details for Algorithm 1
For Algorithm 1, we instantiate the risk-conditioned policy using the conditioning mechanisms described above. The reference policy is fixed to the corresponding base model, namely EleutherAI/pythia-70m1 or EleutherAI/pythia-2.8b2 . During training, the risk level is sampled uniformly from the grid
α ∈ { 0.1 , 0.3 , 0.5 , 0.7 , 0.9 } . \alpha\in\{0.1, 0.3, 0.5, 0.7, 0.9\}. α ∈ { 0.1 , 0.3 , 0.5 , 0.7 , 0.9 } .
This grid provides broad coverage over different risk levels while leaving intermediate values unseen during training, which allows us to evaluate the steerability and interpolation ability of the learned risk-conditioned policy. The threshold network η ω ( x , α ) \eta_{\omega}(x, \alpha) η ω ( x , α ) is a lightweight MLP. We first compute a prompt representation by mean-pooling the frozen input-token embeddings of the base policy over the prompt tokens. This pooled prompt embedding is concatenated with the scalar risk level α \alpha α , and the resulting vector is passed through a two-layer MLP with hidden size 256, tanh activations, and a scalar output. The input embedding layer used for the prompt representation is frozen and only the MLP parameters are updated. For the policy-gradient update, we use PPO (Schulman et al., 2017), a standard algorithm widely adopted in RLHF. Additional hyperparameters for Algorithm 1 and PPO are reported in Table 5 and Table 6 , respectively.
Table 5. Hyperparameters for Algorithm 1.
Table 6. Hyperparameters utilized during the PPO training process
Additional Experiment Setup
We implement all methods on three datasets: IMDB (Ramamurthy et al., 2022), RealToxicityPrompts (Gehman et al., [34 ] ), and Safe-RLHF (Ji et al., 2024). For each dataset, we finetune each method on 80% of the data and evaluate it on the remaining 20% held-out split.
For reward/cost model, we use dataset-specific scoring models. For IMDB, we use the sentiment classifier lvwerra/distilbert-imdb3 . We apply a softmax to the classifier logits and use the probability assigned to the positive sentiment class as the reward. For RealToxicityPrompts, we use the toxicity classifier unitary/toxic-bert4 . We apply a sigmoid to the classifier logits and use the probability assigned to the toxicity label as the cost, where a lower cost indicates a less toxic output. The reward is then defined as the negative cost. For Safe-RLHF, we use PKU-Alignment/beaver-7b-unified-cost5 , which directly outputs a harmfulness cost. Again, lower cost corresponds to safer generation, and we define the reward as the negative cost.
As for the fine-tuned policy, for Pythia-70M, all models are trained on a single NVIDIA RTX 4090 GPU with 24GB memory, together with a 13th Gen Intel Core i9-13900KF CPU with 32 threads. For Pythia-2.8B, all models are trained on two NVIDIA A100 GPUs with 80GB memory each. We implement all methods in Python 3.9 using PyTorch 2.7.1 (Paszke et al., 2019) and TRL 0.11.0 (von Werra et al., 2020). For the RA-RLHF baseline, we follow the official implementation6 and use its default hyperparameters. All models are trained with five different random seeds. During evaluation, we test each method at CVaR risk levels
α ∈ { 0.2 , 0.4 , 0.6 , 0.8 , } . \alpha\in\{0.2, 0.4, 0.6, 0.8, \}. α ∈ { 0.2 , 0.4 , 0.6 , 0.8 , } .
For each evaluation prompt, we sample 64 responses from the model and compute CVaRα _\alpha α as the average reward over the lowest ⌈ α × 64 ⌉ \lceil\alpha\times64 \rceil ⌈ α × 64 ⌉ samples. We report the mean and standard deviation across five random seeds.
To implement the logit-mixing LM, for a target risk level α \alpha α , we first identify the two nearest trained risk levels α i \alpha_i α i and α i + 1 \alpha_{i+1} α i + 1 such that α i ≤ α ≤ α i + 1 \alpha_i \le\alpha\le\alpha_{i+1} α i ≤ α ≤ α i + 1 . We then define the interpolation coefficient as
τ = α − α i α i + 1 − α i . \tau= \frac{\alpha- \alpha_i}{\alpha_{i+1} - \alpha_i}. τ = α i + 1 − α i α − α i .
Given logits ℓ i ( x ) \ell_i(x) ℓ i ( x ) and ℓ i + 1 ( x ) \ell_{i+1}(x) ℓ i + 1 ( x ) from the two corresponding fixed-risk policies for context x x x , the logit-mixing baseline uses
ℓ m i x ( x , α ) = ( 1 − τ ) ℓ i ( x ) + τ ℓ i + 1 ( x ) , \ell_{\mathrm{mix}}(x, \alpha) = (1-\tau)\ell_i(x) + \tau\ell_{i+1}(x), ℓ mix ( x , α ) = ( 1 − τ ) ℓ i ( x ) + τ ℓ i + 1 ( x ) ,
and samples from
π m i x ( ⋅ ∣ x , α ) = softmax ( ℓ m i x ( x , α ) ) . \pi_{\mathrm{mix}}(\cdot\mid x, \alpha) = \operatorname{softmax}(\ell_{\mathrm{mix}}(x,\alpha)). π mix ( ⋅ ∣ x , α ) = softmax ( ℓ mix ( x , α )) .
Additional Experiment Results
Additional Results with Pythia-2.8B
Figure 5 compares different conditioning mechanisms across CVaR risk levels using Pythia-2.8B as the base model. Consistent with the findings in the main paper, parameter-based conditioning generally outperforms prompt-based conditioning, indicating that explicit parameter-level modulation provides more reliable risk control than natural-language prompting. Among the parameter-based variants, the attention-conditioned policy slightly outperforms the logit-conditioned policy, further supporting our choice of attention conditioning as the default mechanism. Table 7 reports the computational overhead of different conditioning mechanisms for Pythia-2.8B. The results show that our conditioning mechanisms improve risk controllability with only modest additional parameters and without meaningfully increasing memory usage or training time. This highlights the practical advantage of risk-conditioned policies over training and storing multiple separate risk-specific models.
Figure 5. Comparison of different conditioning mechanisms across CVaR risk levels on three benchmarks using Pythia-2.8B as the base model.
Table 7. Computational overhead of different conditioning mechanisms using Pythia-2.8B as the base model.
Figure 6 evaluates the methods at the risk levels included in training, using Pythia-2.8B as the base model. The results follow the same overall pattern as in the Pythia-70M experiments. In particular, Risk-conditioned-Oracle achieves stronger performance than RA-RLHF-Oracle in most settings, indicating that the CVaR objective optimized by Algorithm 1 remains effective at the larger model scale. The full Risk-conditioned LM is slightly behind the oracle variants, which is expected because it uses one shared policy to cover all risk levels rather than training a separate policy for each α \alpha α . Nevertheless, the gap remains small, suggesting that risk-conditioned training preserves most of the fixed-risk performance while providing inference-time control over α \alpha α .
Figure 6. Performance of various methods across CVaR risk levels observed during training on three benchmarks using Pythia-2.8B as the base model.
Table 9 further evaluates steerability at unseen held-out CVaR risk levels using Pythia-2.8B as the base model. The results are consistent with the Pythia-70M setting: the risk-conditioned LM remains close to RA-RLHF-Oracle across the three benchmarks, showing that a single conditioned policy can retain strong performance while generalizing to risk levels not used during training. Compared with RA-RLHF-Mix, our method achieves better results in most settings, while avoiding the need to train, store, and select among multiple risk-specific policies. The prompt-only baseline again performs substantially worse, suggesting that simply describing the desired risk level in the input prompt is not sufficient for reliable risk control. Logit-Mixing LM also lags behind the learned risk-conditioned policy, supporting our analysis in Appendix § 7 .§ 4 .
Table 9. Steerability of different methods across unknown held-out CVaR risk levels on three benchmarks using Pythia-2.8B. The red and blue markers represent the best and second-best values, respectively.
Overall, these larger-model results reinforce the main conclusion that risk conditioning provides a practical and scalable mechanism for steering one LM across different degrees of risk aversion.
Additional Results with Llama-8B
To further evaluate scalability beyond the Pythia model family, we additionally conduct experiments on Safe-RLHF using a larger instruction-tuned model, meta-llama/Llama-3.1-8B-Instruct (Grattafiori et al., [38 ] ). The results are reported in Table 8 . These large-scale results support the same conclusion as in the main paper: our method achieves performance comparable to the oracle while avoiding the additional cost.
Table 8. Steerability results using Llama-3.1-8B-Instruct on unknown held-out CVaR risk levels on Safe-RLHF. The red and blue markers represent the best and second-best values, respectively.
Controllability Evaluation
To further show that our method ensures monotonic, smooth, and stable behavioral changes as α \alpha α varies, we vary the input risk-control level α \alpha α while fixing the evaluation tail level to 0.2. The results for Pythia-70M are reported in Table 10 . Although a few adjacent α \alpha α values show small nonmonotonic fluctuations, the overall trend across the full range is smooth and monotonic, demonstrating that the risk-conditioned policy provides stable and predictable control over worst-tail behavior.
Table 10. Fixed-window risk-control calibration on Pythia-70M. We vary the input risk-control level α \alpha α while fixing the evaluation tail level to 0.2.
To further show that our method shows reliable control over continuous α \alpha α within the coverage beyond limited interpolation, we add a dense risk-control calibration curve using additional previously unreported input risk levels for the Pythia-70M in Table 11 . The results directly show that the risk-control interface remains stable across a denser range of unseen α \alpha α values.
Table 11. Dense risk-control evaluation on Pythia-70M.
Additional Ablation Studies
In this section, we provide additional ablation studies using Pythia-70M as the base model. We first report the complete ablation results for the number of conditioned parameter sets K K K . We then examine how the coverage and mesh size h h h of the training risk grid affect the performance of the risk-conditioned policy.
Ablation on the Number of Conditioned Parameter Sets K K K
In addition to the Safe-RLHF ablation reported in the main text, we provide the complete ablation on the number of conditioned parameter sets K K K on IMDB and RealToxicityPrompts. The experimental setup is the same as in the main paper: we vary K K K while keeping all other training configurations fixed, and evaluate the attention-conditioned LM on unseen risk levels α ∈ { 0.2 , 0.4 , 0.6 , 0.8 } \alpha\in\{0.2, 0.4, 0.6, 0.8\} α ∈ { 0.2 , 0.4 , 0.6 , 0.8 } . Parameter increase and average performance gain are reported relative to the default setting K = 5 K=5 K = 5 . Table 12 and Table 13 show a similar trend to the Safe-RLHF results. Moving from K = 1 K=1 K = 1 to K = 5 K=5 K = 5 leads to clear improvements, indicating that a single conditioned parameter set is not sufficient to capture the variation across risk levels. Increasing K K K further to 16 provides only modest additional gains: the average improvement is +3.24% on IMDB and +3.48% on RealToxicityPrompts, while the number of extra parameters increases by 220.3% relative to K = 5 K=5 K = 5 . When K K K is increased to 32, performance drops on both datasets despite the much larger parameter overhead.
Table 12. Ablation on the number of conditioned parameter sets K K K for the attention-conditioned LM on IMDB.
Table 13. Ablation on the number of conditioned parameter sets K K K for the attention-conditioned LM on RealToxicityPrompts.
Overall, these results support the conclusion from the main text: increasing the number of conditioned parameter sets improves steerability up to a moderate capacity, but the benefit quickly saturates. A small number of risk-conditioned parameters is sufficient for effective risk control, while excessively large K K K brings limited benefit and may make optimization less stable.
Ablation on training grid coverage and mesh-size Theorem 3 shows that the approximation error between the learned risk-conditioned policy and the optimal CVaR frontier depends on the mesh size h h h of the training risk grid. To empirically examine how both grid coverage and mesh size affect our method, we conduct two additional ablation studies. First, we train the model on a partial-coverage grid { 0.1 , 0.3 , 0.5 } \{0.1, 0.3, 0.5\} { 0.1 , 0.3 , 0.5 } . This setting covers only the low-to-middle risk region and therefore evaluates how the learned policy behaves when tested at risk levels that are outside, or farther from, the covered training range. Second, we train the model on a sparse full-coverage grid { 0.1 , 0.5 , 0.9 } \{0.1, 0.5, 0.9\} { 0.1 , 0.5 , 0.9 } . This grid spans the full deployment interval but has a larger mesh size than our default grid, allowing us to isolate the effect of coarser risk-level coverage.
According to Table 14 , the partial grid { 0.1 , 0.3 , 0.5 } \{0.1, 0.3, 0.5\} { 0.1 , 0.3 , 0.5 } performs competitively at smaller held-out risk levels, where the evaluation points remain close to the covered training region. However, its performance drops at larger α \alpha α , especially at α = 0.8 \alpha= 0.8 α = 0.8 , where the target risk level lies far outside the covered range. This suggests that limited grid coverage can restrict off-grid steerability beyond the trained interval. The sparse full-coverage grid { 0.1 , 0.5 , 0.9 } \{0.1, 0.5, 0.9\} { 0.1 , 0.5 , 0.9 } covers the entire deployment interval and improves performance at larger α \alpha α compared with the partial grid. Nevertheless, it remains slightly below the default training grid on average, consistent with Theorem 3, which states that the off-grid approximation error decreases as the training grid provides denser coverage.
Table 14. Ablation on the training risk grid of the Risk-conditioned LM on Safe-RLHF. We compare the default training grid with two sparse grids: one with partial coverage and one with full coverage but larger mesh size.
Qualitative steerability across risk levels.
According to the CVaR objective, the behavior of a risk-conditioned policy should vary with the target risk level α \alpha α : smaller α \alpha α emphasizes lower-tail outcomes and should therefore induce more conservative responses, while larger α \alpha α places weight on a broader portion of the response distribution and may allow less conservative generations. To examine whether this risk-dependent behavior appears at the level of individual prompts, we provide several qualitative examples from our risk-conditioned policy using Pythia-2.8B as the base model. For each prompt, we generate responses from the same risk-conditioned policy at held-out risk levels α ∈ { 0.2 , 0.4 , 0.6 , 0.8 } \alpha\in\{0.2, 0.4, 0.6, 0.8\} α ∈ { 0.2 , 0.4 , 0.6 , 0.8 } and report the corresponding reward. These examples show that the risk parameter induces predictable qualitative changes.
Table 15. Warning: Harmful Language! Qualitative examples of risk-conditioned generation on Safe-RLHF. Lower α \alpha α corresponds to stronger tail-risk aversion.
Table 16. Warning: Harmful Language! Qualitative examples of risk-conditioned generation on Safe-RLHF. Lower α \alpha α corresponds to stronger tail-risk aversion.
Table 17. Warning: Harmful Language! Qualitative examples of risk-conditioned generation on Safe-RLHF. Lower α \alpha α corresponds to stronger tail-risk aversion.