Safety through feedback in Constrained RL

In safety-critical RL settings, the inclusion of an additional cost function is often favoured over the arduous task of modifying the reward function to ensure the agent's safe behaviour. However, designing or evaluating such a cost function can be prohibitively expensive. For instance, in the domain of self-driving, designing a cost function that encompasses all unsafe behaviours (e.g. aggressive lane changes) is inherently complex. In such scenarios, the cost function can be learned from feedback collected offline in between training rounds. This feedback can be system generated or elicited from a human observing the training process. Previous approaches have not been able to scale to complex environments and are constrained to receiving feedback at the state level which can be expensive to collect. To this end, we introduce an approach that scales to more complex domains and extends to beyond state-level feedback, thus, reducing the burden on the evaluator. Inferring the cost function in such settings poses challenges, particularly in assigning credit to individual states based on trajectory-level feedback. To address this, we propose a surrogate objective that transforms the problem into a state-level supervised classification task with noisy labels, which can be solved efficiently. Additionally, it is often infeasible to collect feedback on every trajectory generated by the agent, hence, two fundamental questions arise: (1) Which trajectories should be presented to the human? and (2) How many trajectories are necessary for effective learning? To address these questions, we introduce \textit{novelty-based sampling} that selectively involves the evaluator only when the the agent encounters a \textit{novel} trajectory. We showcase the efficiency of our method through experimentation on several benchmark Safety Gymnasium environments and realistic self-driving scenarios.

Paper

Similar papers

Peer review

Reviewer xFMh4/10 · confidence 3/52024-07-09

Summary

This paper studies the safe RL problem with an unknown cost function. As an on-policy approach, this work tries to learn the cost function with safety feedback from an evaluator with novelty sampling and conducts policy optimization at the same time. The authors propose that their approach can deal with feedback over longer horizons by a surrogate loss, reduce sampling queries by novelty sampling, and demonstrate the effectiveness via a set of experiments.

Strengths

1. The paper is well-written and easy to follow in general. 2. The experiment results look promising. 3. The setting of the unknown cost function in safe RL is very interesting and important.

Weaknesses

1. The novelty of this paper might not be enough. First, it is not clear to me the difficulty of inferring the cost function in RL, current existing approaches, and how the proposed approach outperforms the base approaches. Second, novelty sampling or frequency-based sampling is well-studied and leveraged in classical RL. Third, there is nothing new in policy optimization in this paper. 2. It is not clear to me that how close the learned cost function is to the ground truth cost function.

Questions

1. In section 4.2, why do you formulate the safety/cost function by a probability measure? It is confusing to me. Therefore, I cannot understand why using maximum likelihood to learn the cost function. 2. You have to show the learned cost function is close to the ground truth in the experiments. Otherwise, I cannot trust the experimental results as there are so many uncertainties/hyper-parameters in RL. 3. A suggestion for this paper is to consider LLM as an evaluator.

Rating

4

Confidence

3

Soundness

2

Presentation

3

Contribution

2

Limitations

The authors discussed their limitations in the conclusion.

Reviewer 1oHB7/10 · confidence 4/52024-07-17

Summary

This paper presents a method for using evaluator feedback as safety constraints in a constrained RL framework. The novelty comes from the nature of the feedback and the sampling scheme. It is motivated by the fact that previous approaches have various limitations: designing cost, especially comprehensively, is expensive and even seemingly impossible a priori. Offline feedback can help, but existing approaches often don't scale, and/or are constrained to receive feedback at the state level, which is also expensive. Giving feedback at the trajectory level is an option, but also a difficult state-credit assignment problem; and even getting feedback for every trajectory is expensive. This paper presents RLSF, a method in which binary feedback is given on segments or entire trajectories and a novel surrogate loss is presented to make this a useful learning signal, then a new "novelty-based sampling mechanism" is used to train efficiently. The paper takes us through the methods, including the feedback collection process (human or procedural evaluators), the policy improvement step, the nature of the feedback (1 if every state in a given segment is safe, 0 otherwise), and how the cost function is inferred from the collected data. It also presents a surrogate loss function for turning segment-level feedback into a dense signal. The paper then goes through experiments and results in the Safety Gym and Driver simulation environments. The tasks have various constraints in position and velocity. Experiments compare to three general baselines - self-imitation safe RL, safe distribution matching, and PPO where the true cost function is known (considered an upper bound). The methods are tested directly on the tasks, then learned cost functions are transferred to a new agent. The paper then goes through ablations removing the novelty-based sampling method. The results show that this RLSF algorithm shows significant improvement over baselines.

Strengths

### Originality - I am not aware of any methods that use exactly this surrogate loss or sampling method. RLSF does borrow heavily from prior work, but the loss function, sampling method, and otherwise novel (to my knowledge) mix of existing elements does constitute an original work. ### Quality - Experiments section, particularly ablation of the sampling section and cost transfer, is creative and shows lots of important aspects of the study. The cost transfer results are particularly promising. - Results speak for themselves! They show a system that works in simpler environmetns and is ready to be scaled up and tested. ### Clarity - Well written and clear. There is a fair amount of technical content in terms of defining problems and setting up notation, and the paper handles it all well. - The novelty-based sampling mechanism is particularly well-explained. ### Significance Seems good. It's good to see new ways of integrating feedback as human interaction with robots comes nearer and nearer.

Weaknesses

### Quality - "We posit that with a sufficient number of samples, the number of correct labels will outweigh the number of incorrect labels for each state" - doesn't this require sparsity of safety violations and small segments (meaning a hefty feedback load)? Questions like this would require answers to judge if this work is useful. - It would be good to see more error modes - for example, the paper cites novel states as a hotbed for potential errors, but it's only one. What are the others? - In the experiments section, it would be good to see cost transfer compared to other cost function learning methods, not just PPO vs. RLSF vs. PPOLag. ### Clarity - Tables should have bolded numbers, even if all the bolding will be in one column. The tables are incredibly dense right now and tiring to read. - Explanation of surrogate loss derivation would benefit from more justification. E.g. I see that it's true that the product term substitution makes it a state-level term instead of a segment-level term, but explain that. more clearly and why it's okay to do and still expect the optimization to work out.

Questions

- The paper cites sparse cost violation as a motivation for collecting feedback on shorter segments. Why is that? Is the idea that when cost violations are dense, it's hard to give more specialized feedback, but when they're more sparse then the evaluator can just go for it? Or is it purely a horizon issue (shorter horizons have fewer cost violations), in which case mentioning sparse cost violations at all doesn't make sense?

Rating

7

Confidence

4

Soundness

4

Presentation

3

Contribution

3

Limitations

None

Reviewer w6J65/10 · confidence 2/52024-07-30

Summary

This paper proposes a surrogate loss function, which instead of collecting a feedback over trajectory-based evaluator, it breaks long trajectories into segments and the evaluator classifies and assigns labels to segments unsafe if any individual state is unsafe during the segments. This paper also proposes a novelty sampling, which only gathers novel trajectories for feedback from evaluator based on the trajectory distance measure edit distance.

Strengths

The pseudo algorithm helps to understand the paper's idea a bit more. The experiment part seems complete with the methods tested in different tasks and environments to cover the proposed algorithms and the novelty-based sampling method.

Weaknesses

1. I found it hard to follow the paper, especially in section 4.2. Some questions are raised in the following section. 2. I understand that Eq 4 is an upper bound for Eq3, but I doubt that the difference between Eq3 and Eq4 might be too huge, and in this case, switching to Eq4 might result in a very inaccurate estimate $p_*^{\mathrm{safe}}$ for the following analysis in the paper.

Questions

1. On line 136, the probability of a state being safe is defined as $\mathbb{1}[c_{\mathrm{gt}}(s, a) = 0]$. Isn't this an indicator function instead of assigning a probability to this specific state? Or this is a typo. 2. What does the ``noisy labels`` mean on line 150? This phrase also appears somewhere else and I am not sure what it refers to. Also for the sentence following that, ``However, if it occurs in a segment labeled unsafe, it is incorrectly labelled unsafe``. Does it mean if the segment is labelled as unsafe, some of the individual states in the segment ought to be safe but they are labeled as unsafe then? 3. Why is it true that ``with a sufficient number of samples, the number of correct labels will outweigh the number of incorrect lables for each state``? 4. I can't quite follow the paper but based on my understanding, there's a human evaluator to evaluate segment, and another evaluator for state?

Rating

5

Confidence

2

Soundness

2

Presentation

2

Contribution

2

Limitations

Both limitations and societal impacts are discussed in the paper.

Reviewer E6xa7/10 · confidence 4/52024-07-31

Summary

Authors propose a new way of estimating the cost function for constrained RL through user feedback. They propose a surrogate loss that is used to train a model that estimates the probability that a state-action pair is safe. They then use the model to estimate the cost of a policy and adhere to the constraint while looking for the best reward.

Strengths

The paper is relatively easy to follow for a person that is not very familiar with the field. The motive and theoretical assumptions are explained fairly well.

Weaknesses

The experiment section lacks some details and is much harder to follow. I did not see any experiments (ablations) on the size of the feedback buffer. Also I was hoping to see some discussion around the introduced bias in estimation with differing c_max values.

Questions

Could authors explain the DNN that estimates the probability of safety for a (s, a) pair? seems like they are directly estimating the probability? I am curious, if the authors have considered estimating the d_g and d_b densities (as defined in proposition 2 for the optimal solution) instead?

Rating

7

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

How is novelty sampling (which seems naive to me) related to uncertainty sampling? The proposed novelty sampling, roughly, ignores the trajectories that have many visited sub-sequences. I think Corollary 1. is theoretically wrong, as the authors have conveniently ignored the inherent inaccuracies in user feedback. Authors mention labeling noise as the noise that is the result of expanding an unsafe label to all the pairs in the trajectory but there is also the meta noise that the user labeling(user feedback) by itself is an error-prone process.

Reviewer xFMh2024-08-10

I appreciate the feedback from the authors. BCE and MLE are fine to the reviewer because they are common and standard for a binary classification task. Unfortunately, I don't see the current Figure 1 in the paper shows any comparison between learned cost function and ground truth, which further adds to my confusion. As for the multiple differentiating factors, I don't feel they are significant. Therefore, I will keep my current score.

Authorsrebuttal2024-08-11

Please Refer Figure 1 in the attached PDF not main paper.

It appears there's been a misunderstanding regarding Figure 1. We're specifically referring to Figure 1 in the PDF attached to the common rebuttal, not the Figure 1 in the paper. This figure shows that the inferred cost function is indeed close to the ground truth cost function. Regarding the differentiating factors, we respectfully disagree with the reviewer's assessment that they are insignificant. The challenge of designing cost or reward functions for every state-action pair is substantial, as there can be unintended consequences due to interaction of the costs. Our contributions are significant because they enable the integration of qualitative feedback on safety of trajectory segments, which is otherwise difficult to quantify. For example, consider a Roomba robot cleaning a house. If the owner indicates that a certain movement around the sofa was unsafe because the robot unexpectedly emerged from behind it, our approach can incorporate this feedback to prevent similar behavior in the future. This capability is crucial in creating systems that can adapt and improve based on real-world, qualitative safety feedback.

Reviewer 1oHB2024-08-13

Thanks for the response

Hi, thanks for the detailed response. All the changes look good. They were mainly about presentation and detail, so they wouldn't move me to change my score, but I do think they make the paper a better read.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC