This repository contains the official implementation for our SIGIR '26 paper UAR: Towards Unified Affective Reasoning via In-Context Reinforcement Learning. UAR studies unified affective reasoning across emotion recognition, sentiment analysis, stance detection, sarcasm detection.
The codebase provides reinforcement learning training scripts built on top of verl, and evaluation scripts for both in-domain and out-of-domain benchmarks.
.
├── data/ # Raw and processed datasets
├── eval/ # In-domain and OOD evaluation scripts
├── outputs/ # Evaluation outputs and logs
├── preprocess/ # Preprocessing utilities
├── scripts/ # RL training entry scripts
└── verl/ # verl training framework
We recommend using a fresh Python environment.
conda create -n uar python=3.10
conda activate uar
pip install -r requirements.txtProcessed files used by the training scripts are expected under data/processed/, for example:
data/processed/train.parquet
data/processed/test.pkl
data/processed/test_ood.pkl
Training is launched through the scripts in scripts/. Before running, update the model path, working directory, GPU settings, and logging configuration in the script or pass overrides from the command line.
Run UAR training with in-context data:
bash scripts/run.shThe evaluation pipeline supports two model backends:
vllm: start a local OpenAI-compatible vLLM server automatically.openai: call a remote OpenAI-compatible API endpoint.
For in-domain evaluation, configure the environment variables in eval/run_eval.sh, then run:
bash eval/run_eval.shFor OOD evaluation, run:
bash eval/run_eval_ood.shUse the summarization utility to aggregate evaluation outputs:
python eval/summarize_results.py outputs/evaluation/results_your_experiment.jsonIf you find our work useful in your research, please consider citing:
@inproceedings{xiong2026uar,
title = {Towards Unified Affective Reasoning via In-Context Reinforcement Learning},
author = {Xiong, Feng and Wang, Jun and Xu, Ruifeng},
booktitle = {Proceedings of the 49th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR '26)},
year = {2026},
}