High-quality text embedding is pivotal in improving semantic textual similarity (STS) tasks, which are crucial components in Large Language Model (LLM) applications. However, a common challenge existing text embedding models face is the problem of vanishing gradients, primarily due to their reliance on the cosine function in the optimization objective, which has saturation zones. To address this issue, this paper proposes a novel angle-optimized text embedding model called AnglE. The core idea of AnglE is to introduce angle optimization in a complex space. This novel approach effectively mitigates the adverse effects of the saturation zone in the cosine function, which can impede gradient and hinder optimization processes. To set up a comprehensive STS evaluation, we experimented on existing short-text STS datasets and a newly collected long-text STS dataset from GitHub Issues. Furthermore, we examine domain-specific STS scenarios with limited labeled data and explore how AnglE works with LLM-annotated data. Extensive experiments were conducted on various tasks including short-text STS, long-text STS, and domain-specific STS tasks. The results show that AnglE outperforms the state-of-the-art (SOTA) STS models that ignore the cosine saturation zone. These findings demonstrate the ability of AnglE to generate high-quality text embeddings and the usefulness of angle optimization in STS.
翻译:高质量文本嵌入对于提升语义文本相似度(STS)任务至关重要,而这些任务是大语言模型(LLM)应用中的关键组成部分。然而,现有文本嵌入模型普遍面临梯度消失问题,这主要源于其优化目标中依赖的余弦函数存在饱和区域。为解决这一问题,本文提出一种名为AnglE的新型角度优化文本嵌入模型。其核心思想是在复数空间中引入角度优化。该方法能有效缓解余弦函数饱和区域对梯度传播的阻碍及优化过程的负面影响。为构建全面的STS评估体系,我们在现有的短文本STS数据集和从GitHub Issues中收集的新长文本STS数据集上进行了实验。此外,我们还研究了标注数据有限的特定领域STS场景,并探讨了AnglE如何与LLM标注数据协同工作。针对短文本STS、长文本STS和特定领域STS任务,我们开展了大量实验。结果表明,AnglE的性能优于忽略余弦饱和区域的当前最优(SOTA)STS模型。这些发现验证了AnglE生成高质量文本嵌入的能力以及角度优化在STS中的有效性。