--- base_model: - Qwen/Qwen2.5-7B-Instruct license: other license_name: license license_link: LICENSE pipeline_tag: text-generation library_name: transformers tags: - dialogue - empathy - reinforcement-learning - qwen --- # RLVER: Reinforcement Learning with Verifiable Emotion Rewards for Empathetic Agents This repository contains the `Qwen2.5-7B-Instruct` model fine-tuned using RLVER, as presented in the paper [RLVER: Reinforcement Learning with Verifiable Emotion Rewards for Empathetic Agents](https://huggingface.co/papers/2507.03112).
## Abstract Large language models (LLMs) excel at logical and algorithmic reasoning, yet their emotional intelligence (EQ) still lags far behind their cognitive prowess. While reinforcement learning from verifiable rewards (RLVR) has advanced in other domains, its application to dialogue—especially for emotional intelligence—remains underexplored. In this work, we introduce RLVER, the first end-to-end reinforcement learning framework that leverages verifiable emotion rewards from simulated users to cultivate higher-order empathetic abilities in LLMs. Within this framework, self-consistent affective simulated users engage in dialogue rollouts and produce deterministic emotion scores during conversations, serving as reward signals to guide the LLM's learning. Fine-tuning publicly available Qwen2.5-7B-Instruct model with PPO boosts its Sentient-Benchmark score from 13.3 to 79.2 while largely preserving mathematical and coding competence. Extensive experiments reveal that: (i) RLVER consistently improves multiple dialogue capabilities; (ii) Thinking and non-thinking models show distinct trends—thinking models excel in empathy and insight, while non-thinking models favor action; (iii) GRPO often yields stable gains, while PPO can push certain capabilities to a higher ceiling; (iv) More challenging environments are not always better—moderate ones can yield stronger outcomes. Our results show that RLVER is a practical route toward emotionally intelligent and broadly capable language agents. ## Overview
The overview of RLVER. In this work, we present the first end-to-end reinforcement-learning framework that equips an LLM with human-level empathetic skills by optimizing against verifiable emotion rewards.
## Usage This model can be loaded and used with the `transformers` library. Ensure you have the library installed (`pip install transformers`). ```python from transformers import AutoModelForCausalLM, AutoTokenizer import torch # Load the model and tokenizer model_name = "Tencent/RLVER-Qwen2.5-7B" # Replace with the actual model ID if a specific sub-model is desired tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained( model_name, torch_dtype=torch.bfloat16, # or torch.float16 depending on your GPU and model settings device_map="auto" ) # Example chat interaction following Qwen2.5 chat template messages = [ {"role": "system", "content": "You are a helpful and empathetic assistant."}, {"role": "user", "content": "I'm feeling really down today, I lost my job and I don't know what to do."} ] input_ids = tokenizer.apply_chat_template( messages, tokenize=True, add_generation_prompt=True, return_tensors="pt" ).to(model.device) # Generate response outputs = model.generate( input_ids, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.9, pad_token_id=tokenizer.eos_token_id # Important for Qwen2.5 ) response = tokenizer.decode(outputs[0], skip_special_tokens=True) print(response) # Expected output format will include the full conversation up to the model's response: # <|im_start|>system # You are a helpful and empathetic assistant.<|im_end|> # <|im_start|>user # I'm feeling really down today, I lost my job and I don't know what to do.<|im_end|> # <|im_start|>assistant # I'm so sorry to hear that. Losing your job can be incredibly tough, and it's completely understandable to feel down. Please know that you're not alone, and it's okay to feel this way. Take some time to process your emotions. Is there anything specific you'd like to talk about or any way I can help you right now? ``` ## Citation If you find our work helpful or inspiring, please feel free to cite it. ```bibtex @article{zhou2024learning, title={RLVER: Reinforcement Learning with Verifiable Emotion Rewards for Empathetic Agents}, author={Zhou, Zijian and Liu, Shikun and Han, Xiao and Liu, Haozhe and Ng, Kam Woh and Xie, Tian and Cong, Yuren and Li, Hang and Xu, Mengmeng and P{\'e}rez-R{\'u}a, Juan-Manuel and Patel, Aditya and Xiang, Tao and Shi, Miaojing and He, Sen}, journal={arXiv preprint arXiv:2507.03112}, year={2025}, } ```