mlsanityData to 14 Oct 2026

Learning Natural Language Constraints for Safe Reinforcement Learning of Language Agents

arXiv 2504.03185 ↗First posted 4 Apr 2025cs.CL cs.AIcited by 2

On the map: LLM agents and tool use → Agent threats, guardrails and governance

also in 1 more
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

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2022Training language models to follow instructions with human feedbackcited by 15,971
  4. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  5. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
  6. 2014Explaining and Harnessing Adversarial Examplescited by 7,364
  7. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  8. 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,148
  9. 2019Unsupervised Cross-lingual Representation Learning at Scalecited by 3,935
  10. 2017Deep reinforcement learning from human preferencescited by 3,912
  11. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
  12. 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
38 more
  1. 2022Constitutional AI: Harmlessness from AI Feedbackcited by 3,050
  2. 2020Learning to summarize from human feedbackcited by 2,588
  3. 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,984
  4. 2019Language Models as Knowledge Bases?cited by 1,936
  5. 2020mT5: A massively multilingual pre-trained text-to-text transformercited by 1,818
  6. 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,651
  7. 2016Generative Adversarial Imitation Learningcited by 1,597
  8. 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
  9. 2021Multitask Prompted Training Enables Zero-Shot Task Generalizationcited by 1,470
  10. 2022Scaling Laws for Reward Model Overoptimizationcited by 1,095
  11. 2022Language Models as Zero-Shot Planners: Extracting Actionable Knowledge for Embodied Agentscited by 1,035
  12. 2017Constrained Policy Optimizationcited by 983
  13. 2022Atlas: Few-shot Learning with Retrieval Augmented Language Modelscited by 952
  14. 2021GLaM: Efficient Scaling of Language Models with Mixture-of-Expertscited by 897
  15. 2022Discovering Language Model Behaviors with Model-Written Evaluationscited by 836
  16. 2023Open Problems and Fundamental Limitations of Reinforcement Learning from Human Feedbackcited by 759
  17. 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 719
  18. 2019Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailmentcited by 671
  19. 2023Safe RLHF: Safe Reinforcement Learning from Human Feedbackcited by 656
  20. 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
  21. 2023Weak-to-Strong Generalization: Eliciting Strong Capabilities With Weak Supervisioncited by 467
  22. 2022The Effects of Reward Misspecification: Mapping and Mitigating Misaligned Modelscited by 328
  23. 2018A Survey of Inverse Reinforcement Learning: Challenges, Methods and Progresscited by 298
  24. 2018A Lyapunov-based Approach to Safe Reinforcement Learningcited by 297
  25. 2022Can language models learn from explanations in context?cited by 249
  26. 2015Maximum Entropy Deep Inverse Reinforcement Learningcited by 176
  27. 2017AI Safety Gridworldscited by 110
  28. 2024Robust agents learn causal world modelscited by 81
  29. 2020Graph Constrained Reinforcement Learning for Natural Language Action Spacescited by 80
  30. 2018Playing Text-Adventure Games with Graph-Based Deep Reinforcement Learningcited by 53
  31. 2020Learning Dynamic Belief Graphs to Generalize on Text-Based Gamescited by 49
  32. 2024Inverse-RLignment: Large Language Model Alignment from Demonstrations through Inverse Reinforcement Learningcited by 27
  33. 2020Safe Reinforcement Learning with Natural Language Constraintscited by 23
  34. 2021A Survey of Text Games for Reinforcement Learning informed by Natural Languagecited by 14
  35. 2022Learning to Follow Instructions in Text-Based Gamescited by 12
  36. 2021Generalization in Text-based Games via Hierarchical Reinforcement Learningcited by 11
  37. 2023Knowledge-enhanced Agents for Interactive Text Gamescited by 10
  38. 2024Enhancing Reinforcement Learning with Label-Sensitive Reward for Natural Language Understandingcited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 1.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Safe Reinforcement Learning with Free-form Natural Language Constraints and Pre-Trained Language Models
  2. 2025Reinforcement Learning from Human Feedback with High-Confidence Safety Constraints
  3. 2024From Text to Trajectory: Exploring Complex Constraint Representation and Decomposition in Safe Reinforcement Learning
  4. 2024One-Shot Safety Alignment for Large Language Models via Optimal Dualization
  5. 2024Enhancing Safety in Reinforcement Learning with Human Feedback via Rectified Policy Optimization
  6. 2025Certifiable Safe RLHF: Semantic Grounding and Fixed Penalty Constraint Optimization for Safer LLM Alignment
  7. 2024Safe Multi-agent Reinforcement Learning with Natural Language Constraints
  8. 2026Oyster-II: Reinforcement Learning for Constructive Safety Alignment in Large Language Models