Learning Natural Language Constraints for Safe Reinforcement Learning of Language Agents
On the map: LLM agents and tool use → Agent threats, guardrails and governance
Abstract (arXiv)
Generalizable alignment is a core challenge for deploying Large Language Models (LLMs) safely in real-world NLP applications. Current alignment methods, including Reinforcement Learning from Human Feedback (RLHF), often fail to guarantee constraint satisfaction outside their training distribution due to their reliance on implicit, post-hoc preferences. Inspired by a paradigm shift to first curate data before tuning, we introduce a new framework for safe language alignment that learns natural language constraints from positive and negative demonstrations as a primary step. From inferring both a task-specific reward function and latent constraint functions, our approach fosters adaptation to novel safety requirements and robust generalization under domain shifts and adversarial inputs. We formalize the framework within a Constrained Markov Decision Process (CMDP) and validate it via a text-based navigation environment, demonstrating safe adaptation to changing danger zones. Our experiments show fewer violations upon domain shift when following a safe navigation path, and we achieve zero violations by applying learned constraints to a distilled BERT model as a fine-tuning technique. This work offers a promising path toward building safety-critical and more generalizable LLMs for practical NLP settings.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 50 of its 83 references that are in the map. First posted on arXiv 4 Apr 2025.
Builds on
50 of 83 references.
References · 50
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
- 2014Explaining and Harnessing Adversarial Examplescited by 7,364
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,148
- 2019Unsupervised Cross-lingual Representation Learning at Scalecited by 3,935
- 2017Deep reinforcement learning from human preferencescited by 3,912
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
38 more
- 2022Constitutional AI: Harmlessness from AI Feedbackcited by 3,050
- 2020Learning to summarize from human feedbackcited by 2,588
- 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,984
- 2019Language Models as Knowledge Bases?cited by 1,936
- 2020mT5: A massively multilingual pre-trained text-to-text transformercited by 1,818
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,651
- 2016Generative Adversarial Imitation Learningcited by 1,597
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
- 2021Multitask Prompted Training Enables Zero-Shot Task Generalizationcited by 1,470
- 2022Scaling Laws for Reward Model Overoptimizationcited by 1,095
- 2022Language Models as Zero-Shot Planners: Extracting Actionable Knowledge for Embodied Agentscited by 1,035
- 2017Constrained Policy Optimizationcited by 983
- 2022Atlas: Few-shot Learning with Retrieval Augmented Language Modelscited by 952
- 2021GLaM: Efficient Scaling of Language Models with Mixture-of-Expertscited by 897
- 2022Discovering Language Model Behaviors with Model-Written Evaluationscited by 836
- 2023Open Problems and Fundamental Limitations of Reinforcement Learning from Human Feedbackcited by 759
- 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 719
- 2019Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailmentcited by 671
- 2023Safe RLHF: Safe Reinforcement Learning from Human Feedbackcited by 656
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2023Weak-to-Strong Generalization: Eliciting Strong Capabilities With Weak Supervisioncited by 467
- 2022The Effects of Reward Misspecification: Mapping and Mitigating Misaligned Modelscited by 328
- 2018A Survey of Inverse Reinforcement Learning: Challenges, Methods and Progresscited by 298
- 2018A Lyapunov-based Approach to Safe Reinforcement Learningcited by 297
- 2022Can language models learn from explanations in context?cited by 249
- 2015Maximum Entropy Deep Inverse Reinforcement Learningcited by 176
- 2017AI Safety Gridworldscited by 110
- 2024Robust agents learn causal world modelscited by 81
- 2020Graph Constrained Reinforcement Learning for Natural Language Action Spacescited by 80
- 2018Playing Text-Adventure Games with Graph-Based Deep Reinforcement Learningcited by 53
- 2020Learning Dynamic Belief Graphs to Generalize on Text-Based Gamescited by 49
- 2024Inverse-RLignment: Large Language Model Alignment from Demonstrations through Inverse Reinforcement Learningcited by 27
- 2020Safe Reinforcement Learning with Natural Language Constraintscited by 23
- 2021A Survey of Text Games for Reinforcement Learning informed by Natural Languagecited by 14
- 2022Learning to Follow Instructions in Text-Based Gamescited by 12
- 2021Generalization in Text-based Games via Hierarchical Reinforcement Learningcited by 11
- 2023Knowledge-enhanced Agents for Interactive Text Gamescited by 10
- 2024Enhancing Reinforcement Learning with Label-Sensitive Reward for Natural Language Understandingcited by 2
Built on by
Citing papers per year: 2025: 1; 2026: 1.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2024Safe Reinforcement Learning with Free-form Natural Language Constraints and Pre-Trained Language Models
- 2025Reinforcement Learning from Human Feedback with High-Confidence Safety Constraints
- 2024From Text to Trajectory: Exploring Complex Constraint Representation and Decomposition in Safe Reinforcement Learning
- 2024One-Shot Safety Alignment for Large Language Models via Optimal Dualization
- 2024Enhancing Safety in Reinforcement Learning with Human Feedback via Rectified Policy Optimization
- 2025Certifiable Safe RLHF: Semantic Grounding and Fixed Penalty Constraint Optimization for Safer LLM Alignment
- 2024Safe Multi-agent Reinforcement Learning with Natural Language Constraints
- 2026Oyster-II: Reinforcement Learning for Constructive Safety Alignment in Large Language Models