DySem: 揭示大语言模型的动态语义组件以计算语义文本相似度
DySem: Uncovering Dynamic Semantic Components of Large Language Models for Calculating Semantic Textual Similarity
AI总结:
提出DySem框架,通过多语言共识提取大语言模型中与语义更相关的内部组件,并构建文本相关的联合语义集实现动态维度相似度计算,无需训练且性能优于基线。
摘要:
计算语义文本相似度是自然语言处理中的基础任务。当前基于大语言模型(LLM)的方法通常依赖提取固定维度的最后一层隐藏状态来计算每对文本的相似度。我们认为这种范式存在两个局限:(i)最后一层隐藏层编码的是更通用的知识而非仅语义知识,因此对于语义相似度计算并非最优;(ii)LLM的隐藏层维度通常非常大,这引入了表示语义时的冗余和噪声。在这项工作中,我们提出DySem,一种新颖的无需训练框架,通过多语言共识探究LLM中更多与语义相关的内部组件,并摆脱静态表示空间,转而通过构建文本相关的联合语义集实现动态的、样本特定的语义维度,并在该共享维度子集上计算相似度。在各种LLM上的大量实验表明,我们的方法在保持较低相似度计算维度的同时,持续优于最近的基线。代码已发布在https://github.com/szu-tera/DySem。
英文摘要:
Calculating semantic textual similarity is a foundational task in natural language processing. Current large language models (LLMs) based methods typically rely on extracting last-layer hidden states with fixed dimensions to compute similarity for every text pairs. We argue that this paradigm is suffer from two limitations: (i) The last hidden layer encodes more general knowledge rather than just semantic knowledge, making it suboptimal for semantic similarity computation; (ii) The hidden layer dimensions of LLMs are generally very large, which introduces some redundancy and noise for representing semantics. In this work, we propose DySem, a novel training-free framework that investigates more semantic-related internal components of LLMs via multilingual consensus, and shifts away from static representation spaces in favor of dynamic, sample-specific semantic dimensions by constructing text-dependent joint semantic set and computes similarity over this shared dimensional subset. Extensive experiments across various LLMs show that our method consistently outperforms recent baselines while maintaining lower dimensions for similarity calculation. The code is released at https://github.com/szu-tera/DySem.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。