Skip to main content
QUICK REVIEW

[论文解读] AnglE-optimized Text Embeddings

Xianming Li, Jing Li|arXiv (Cornell University)|Sep 22, 2023
Topic ModelingComputer Science被引用 21
一句话总结

AnglE 在复空间中引入角度优化以缓解文本嵌入学习中的余弦饱和,并引入新的 GitHub Issues 长文本 STS 数据集,在转移与非转移 STS 任务上达到最先进的结果,并提升下游检索性能。

ABSTRACT

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 对于大型语言模型应用中的高质量文本嵌入的需求。
  • 识别余弦饱和作为监督 STS 训练中的关键梯度问题。
  • 提出 AnglE,一种在复空间优化角度以缓解饱和效应的模型。
  • 通过来自 GitHub Issues 的新型长文本 STS 数据集扩展评估。
  • 探索用 LLM 监督学习来应对领域数据稀缺并评估检索影响。

提出的方法

  • 输入句子被填充到固定长度,并通过骨干网络(BERT/ RoBERTa/ LLaMA)编码以获得上下文表示。
  • 优化常规的余弦目标,通过带温度 tau 的跨熵风格损失最大化相似性排序。
  • 批内否定目标利用批内负样本并将批内重复项识别为正样本以降低噪声。
  • 通过在复空间中计算成对表示的绝对归一化角度差引入角度目标,以缓解余弦饱和。
  • 将三种目标整合为最终损失:L = w1*L_cos + w2*L_ibn + w3*L_angle,带有可调权重和温度。
  • 使用既定的 STS 基准(短文本和长文本)以及新提出的 GitHub Issues 相似度数据集进行评估。
Figure 1: The saturation zones of the cosine function. The gradient at saturation zones is close to zero. During backpropagation, if the gradient is very small, it could kill the gradient and make the network difficult to learn.
Figure 1: The saturation zones of the cosine function. The gradient at saturation zones is close to zero. During backpropagation, if the gradient is very small, it could kill the gradient and make the network difficult to learn.

实验结果

研究问题

  • RQ1角度优化在复空间能否超越仅使用余弦的目标来提升 STS 嵌入?
  • RQ2AnglE 在转移与非转移 STS 设置中是否提供稳健的增益,特别是对长文本数据?
  • RQ3在有限监督数据下,结合通过 LLM 进行监督标注时,AnglE 的表现如何?
  • RQ4角度优化对检索及下游任务有何影响?

主要发现

  • AnglE 在忽略余弦饱和的最先进 STS 模型中实现了超越,在转移和非转移设置中均表现出色。
  • 在转移 STS 中,AnglE-BERT 与 AnglE-LLaMA2-7B 相较 SimCSE 基线平均提升分别为 0.80% 与 0.72%。
  • 在非转移 STS 中,AnglE 在 STS 任务上的平均 Spearman 相关性分别为 73.55%(AnglE-BERT)和 85.96%(AnglE-LLaMA2-7B),超越 SBERT 与 C/S 基线。
  • 新收集的 GitHub Issues 长文本 STS 数据集显示有相当比例的长文本(超过 512 个标记)适用于评估长文本 STS。
  • 消融结果表明角度目标对性能有显著贡献,且往往比批内负样本成分更具影响力。
  • LLM 监督的 AnglE(如使用 ChatGPT/LLaMA/ChatGLM)进一步提升 STS 性能,且集成结果超过无监督基线。
(a)
(a)

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。