Large Language Models have demonstrated remarkable capabilities in generating contextually relevant and grammatically correct text. However, they fundamentally lack the ability to process and respond to emotional context in a manner analogous to human emotional cognition. Current approaches to emotion modeling in NLP systems rely primarily on discrete emotion classification or simplistic sentiment analysis, which fail to capture the continuous, multi-dimensional nature of human emotional states. In this paper, we introduce HormoneT5, a novel architecture that augments transformer language models with a biologically-inspired Hormone Emotion Block that simulates the human endocrine system's role in emotional processing. Our approach computes six continuous hormone-like values through specialized per-hormone attention heads, each with orthogonally initialized learnable queries, temperature-scaled attention mechanisms, and deep output projections. These hormone values are then transformed into an emotional embedding that modulates the encoder hidden states, enabling emotionally-appropriate response generation. We propose a multi-objective training framework combining sequence-to-sequence loss, hormone prediction loss with margin penalties, and diversity regularization to prevent attention collapse. Experimental results on our curated emotion-labeled dataset demonstrate that HormoneT5 achieves 85%+ per-hormone accuracy within a 0.15 tolerance threshold, with hormone differentiation ranges exceeding 0.85 across all six hormones between contrasting emotional tones. Human evaluation studies show significant preference (p < 0.01) for HormoneT5-generated responses in terms of emotional appropriateness and empathetic quality compared to baseline T5 outputs. Our work opens new directions for biologically-grounded affective computing and emotionally intelligent conversational agents.
翻译:大型语言模型在生成上下文相关且语法正确的文本方面展现了卓越的能力。然而,它们从根本上缺乏以类似于人类情感认知的方式处理和回应情感语境的能力。当前自然语言处理系统中情感建模的方法主要依赖于离散情感分类或简单的情感分析,未能捕捉人类情感状态的连续性和多维度特性。本文中,我们提出了HormoneT5,一种新颖的架构,通过引入生物学启发的激素情感模块来增强Transformer语言模型,模拟人类内分泌系统在情感处理中的作用。我们的方法通过专门的逐激素注意力头计算六个连续的激素样值,这些注意力头采用正交初始化的可学习查询、温度缩放注意力机制和深度输出投影。随后,这些激素值被转换为情感嵌入,调节编码器的隐藏状态,从而实现情感上恰当的反应生成。我们提出了一种多目标训练框架,结合序列到序列损失、带边际惩罚的激素预测损失以及防止注意力崩溃的多样性正则化。在我们精心策划的情感标注数据集上的实验结果表明,HormoneT5在0.15容差阈值内实现了85%以上的逐激素准确率,且在对比情感基调下所有六种激素的差异化范围超过0.85。人工评估研究显示,相较于基线T5输出,HormoneT5生成的回应在情感恰当性和共情质量方面具有显著优势(p < 0.01)。我们的工作为基于生物学的情感计算和具有情感智能的对话代理开辟了新方向。