- Rating
- 5
- Clarity
- 3
- Confidence
- 3
- Originality
- 3
- Quality
- 3
- Significance
- 3
Read review
Summary
The paper proposes Q-Barrier, a deployment-time shielding method for safe in-context reinforcement learning. The setting is safe ICRL, where a pretrained policy must adapt to new tasks through interaction history, without test-time parameter updates, while keeping episodic costs within a budget. The method uses a shared encoder, and separate policy and world latent projection heads. The policy projection is used by the base policy, while the world projection is used by a latent dynamics model and an ensemble cost critic. At deployment, the policy proposes candidate actions, and the shield reweights these candidates according to the remaining budget and a pessimistic learned cost-to-go estimate. Actions predicted to exceed the remaining budget are downweighted by a soft barrier; a hard filtering variant is also studied in the appendix.
Experimentally, the method improves reward-cost tradeoffs over SCARED and other safe adaptation baselines in most evaluated environments, though SafetyHalfCheetah shows a conservative lower-cost/lower-return tradeoff. The appendix includes useful ablations and diagnostics, including comparisons of soft vs. hard shielding and sensitivity to the number of sampled candidate actions.
Strengths and weaknesses
Strengths - The paper is well motivated: frozen safe ICRL policies may still choose actions that are inconsistent with the remaining cost budget, so an explicit action-level safety filter is natural. The proposed method is technically interesting and modular: it adds a latent cost-to-go based shield without requiring test-time parameter updates. The empirical results are strong across the evaluated safe ICRL benchmarks, especially relative to the SCARED base policy. The theoretical analysis is helpful and the appendix is extensive and includes useful diagnostics, ablations, and implementation details.
Weaknesses - The training procedure is not sufficiently clear. Given the number of components, a diagram of the architecture and gradient flow would be very helpful. It should be explicit which losses update the shared encoder, policy projection, world projection, dynamics model, and critics. The policy loss is underexplained. Algorithm 1 uses terms such as , , and , apparently inherited from SCARED, but these are not defined or motivated sufficiently. The paper should be more self-contained, especially because safe ICRL/SCARED is still a recent framework. The auxiliary losses, especially , need more explanation. The mathematical definition is present, but the motivation and effect on representation learning are not clear. The data-collection/training loop is ambiguous. Algorithm 1 requires a batch of history-conditioned trajectories, but it is not clear how these are collected during training, whether the shield is active during training interaction, and how this differs across discrete and continuous action settings. The method depends heavily on the learned cost critic and latent dynamics quality. The SafetyHalfCheetah result illustrates that an inaccurate hurts performance. However, its affect largely makes the shield overly conservative, which is positive.
Questions
- Could the authors add a diagram showing the full architecture, including encoder, projections, policy, dynamics model, cost critic ensemble, and gradient flow from each loss?
- Are shielded actions used during training data collection, or is the Q-barrier used only at deployment? Please clarify the training loop.
- Please define and motivate , , and without requiring the reader to consult SCARED.
- What is the intuition behind the conjugacy loss , and how important is it empirically?
- How sensitive is the method to cost-critic miscalibration beyond the reported HalfCheetah case?
Limitations
yes
Paper formatting concerns
No formatting issues detected.
Final justification
My concerns have been addressed and the authors have committed to incorporate my comments and their responses in the final revision.
1. Architecture and Component Contributions
We thank the reviewer for this suggestion. In the revision, we will add a complete architecture diagram showing the encoder, policy and world projections, policy, latent dynamics model, cost-critic ensemble, and Q-Barrier. The diagram will also indicate which modules are updated by each training loss and make clear that the latent dynamics model is used during training but not explicitly by the deployed barrier.
In addition, we conducted ablations to separately study the contributions of latent dynamics learning, the Q-Barrier, and the cost-critic ensemble. The table reports the average return and cost over 50 in-context episodes and 100 evaluation rollouts in SafeDarkRoom. Here, M denotes the number of cost critics.
The results show that dynamics learning, Q-Barrier, and the critic ensemble provide complementary benefits. The full Q-Barrier with four critics achieves both the highest return 0.898 and the lowest cost 0.92. Reducing the ensemble to two or one critic lowers return and increases cost overall, although the cost is not strictly monotonic with ensemble size.
Removing dynamics learning further increases cost to 1.747 and decreases return to 0.77, indicating that the barrier becomes less reliable when the latent representation does not capture temporal dynamics well. Conversely, dynamics learning without the barrier achieves relatively high return 0.808 but produces the highest cost 2.002. These results show that dynamics learning alone does not ensure safety, while the barrier benefits from an informative latent representation and a better QC(Zt) estimate. Combining dynamics learning with Q-Barrier and an ensemble of critics shows the best performance.
Why Dynamics Learning Helps. The effect of dynamics learning can be understood from how the barrier uses the latent state. At time step t, the barrier filters candidate actions At using the remaining budget Bt and the estimated cost QC(Zt,At). The budget Bt is directly observed, but the cost estimate depends on the learned latent state Zt. Therefore, Zt must keep the information needed for accurate cumulative cost prediction.
The original in-context state is (Stk,Htk), where Htk contains past trajectories before episode k and the current parital trajectories in episode k. The next in-context state adds the new action, reward, cost, and state to the history. Since Zt+1 is a compressed form of this updated history, we use the dynamics loss to make consecutive latent states consistent over time t. This helps Zt keep useful information for the cost critic, even though the transition model is not used at deployment explicitly.
2. Training versus Deployment
We thank the reviewer for requesting this clarification. The treatment differs by action space. In discrete environments, evaluating all actions is inexpensive, so the soft Q-barrier is active during training. In continuous environments, we use N=1 during training. Because the only candidate is the base-policy action, the shield cannot change the collected action and is effectively inactive for action selection. However, the encoder, representation losses, latent dynamics, and cost critics are still trained from these trajectories to active the barrier at deployment.
At deployment, all parameters are frozen. For continuous actions, the shield samples N=8 candidates by default and reweights them using the learned barrier. This avoids the cost of evaluating multiple candidates at every training step while preserving representation and critic learning. We will clarify this distinction in the training algorithm and implementation details. We vary N in the candidate-size ablation. reported in Figure 5 and Appendix D.
3. Policy objectives
We thank the reviewer and agree that these terms need clearer definitions. Let Ztk be the shared latent state, Ztp,k and Ztw,k its policy and world projections, Atk the replay-buffer action, and A~tk∼πθ(⋅∣Ztp,k) an action sampled from the current policy. We define $\bar Q_R(Z,A)= \frac{1}{M}\sum_{i=1}^M \hat Q_{R,i}(Z,A)$ and $V_R^\pi(Z_t^k)=\mathbb E_{\tilde A\sim\pi_\theta(\cdot\mid Z_t^{p,k})} \left[ \bar Q_R(Z_t^k,\tilde A) \right],$ and the advantage of the replay action as Adv=QˉR(Ztk,Atk)−VRπ(Ztk).
$\mathcal L_{\mathrm{DPG}} = -\mathbb E_{k,t} \left[ \min_i \hat Q_{R,i}(Z_t^k,\tilde A_t^k) \right].$
LAWBC=−Ek,t[1(Adv>0)logπθ(Atk∣Ztp,k)].
$\mathcal L_C^\pi=\mathbb E_{k,t}\left[\max_i \hat Q_{C,i}(Z_t^{w,k},\tilde A_t^k) \right] = \mathbb E_{k,t} \left[ \hat Q_C^+(Z_t^{w,k},\tilde A_t^k) \right].$
The terms serve different roles. LDPG improves reward using a conservative reward estimate. LAWBC stabilizes off-policy learning by copying only replay actions estimated to be better than the current policy. LCπ discourages actions with high predicted cost. We will clarify these definitions and their distinct roles after Algorithm 1 in the revision.
4. Conjugacy loss
We thank the reviewer for asking this question.
The world projection learns transition structure through the dynamics, reward, and cost losses, while the policy projection may learn a different latent representation. Lconj aligns their temporal changes:
gp(Zt+1)−γgp(Zt) and sg[gw(Zt+1)−γgw(Zt)].
This encourages the policy and world projections to represent transitions consistently.
Empirically, removing the conjugacy loss causes only a small decrease in return, although the cost increases. This may be because Ldistill still provides an additional alignment signal without the conjugacy term.
5. Sensitivity to Cost-Critic Miscalibration
In Q-Barrier, miscalibration can cause all sampled actions to be marked infeasible, bQ<0, even when some budget left. We therefore measured how often the candidate set contains at least one feasible action as the remaining budget and candidate-set size vary. We used 15,000 executed steps for all environments.
At least 75% of the episode's initial budget remaining case
When at least 75% of the initial budget left, a feasible action is almost always available: 100% for Point and Car, 99% for Ant, and about 88% for HalfCheetah. These rates change little across N.
At most 25% of the episode's initial budget remaining case
When the budget becomes tight, the rates decrease, especially on HalfCheetah. Increasing the candidate-set size from N=1 to N=32 does not consistently improve feasibility on any benchmark, even though on Ant and HafCheetah case, N≥4 has always better feasibility than N=1. The changes are small and have no clear direction. Thus, the loss of feasible actions is mainly caused by the cost estimate, not by too few candidates.
Across all steps with positive remaining budget, the Barrier fails to find a feasible action on 0.2% of Point steps, 0.3% of Car steps, 0.8% of SafeDarkRoom steps, 2.6% of Ant steps, and 20.7% of HalfCheetah steps. HalfCheetah is a clear outlier. On the other four benchmarks, this failure is rare. Even on HalfCheetah, it mainly occurs when the remaining budget is small, where a fixed error in QC is more likely to change the sign of bQ=B−QC+.
One limitation is that directly measuring critic bias requires comparing predicted cost-to-go with realized Monte Carlo cost-to-go on the same scale. Because our cost critics are trained with normalized targets, we do not report this value here. We will add this calibration analysis in the revision.
We sincerely thank the reviewer for the constructive feedback. We hope the additional experiments and clarifications above address the main concerns. We would also be happy to provide further clarification or run additional experiments during the discussion.