Know What You should not Know: Dynamic Attention Gating for Knowledge-Bounded Role-Playing

Zongsheng Wang, Bowen Wu, Qun yu, Dengzhengwei, Qin Lin, Xu Chen, Baoxun Wang


Abstract
Role-playing conversational agents (RPCAs) built on large language models often leak out-of-boundary knowledge: when asked about topics outside a character’s limits, the model’s Chain-of-Thought reasoning reveals knowledge that the character should not possess, undermining immersion. To locate the source of this leakage, we conduct heuristic experiments at three levels of granularity, and find that intervening on individual Feed-Forward Network (FFN) neurons yields the strongest and most effective suppression. Motivated by this finding, we propose the Dynamic Attention Gating (DAG) Router, a lightweight trainable network that encodes the system prompt and dynamically generates per-layer FFN gating signals at inference time. Evaluated on multiple models and benchmarks, the DAG Router improves out-of-boundary scores by up to +162% compared with the original baseline, along with better overall role-playing quality.
Anthology ID:
2026.emnlp-main.545
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
12530–12548
Language:
URL:
https://aclanthology.org/2026.emnlp-main.545/
DOI:
Bibkey:
Cite (ACL):
Zongsheng Wang, Bowen Wu, Qun yu, Dengzhengwei, Qin Lin, Xu Chen, and Baoxun Wang. 2026. Know What You should not Know: Dynamic Attention Gating for Knowledge-Bounded Role-Playing. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 12530–12548, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Know What You should not Know: Dynamic Attention Gating for Knowledge-Bounded Role-Playing (Wang et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.545.pdf