Skip to main content
QUICK REVIEW

[Paper Review] AnglE-optimized Text Embeddings

Xianming Li, Jing Li|arXiv (Cornell University)|Sep 22, 2023
Topic ModelingComputer Science21 citations
TL;DR

AnglE introduces angle optimization in complex space to mitigate cosine saturation in text embedding learning, with a new GitHub Issues long-text STS dataset, achieving state-of-the-art results on transfer and non-transfer STS tasks and improving downstream retrieval performance.

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.

Motivation & Objective

  • Motivate the need for high-quality text embeddings in STS for LLM applications.
  • Identify cosine saturation as a key gradient issue in supervised STS training.
  • Propose AnglE, a model that optimizes angle in complex space to alleviate saturation effects.
  • Extend evaluation with a new long-text STS dataset from GitHub Issues.
  • Explore LLM-supervised learning to cope with domain data scarcity and assess retrieval impact.

Proposed method

  • Input sentences are padded to a fixed length and encoded via a backbone (BERT/ RoBERTa/ LLaMA) to obtain contextual representations.
  • Optimize the standard cosine objective to maximize similarity rankings via a cross-entropy style loss with temperature tau.
  • In-batch negative objective exploits in-batch negatives and identifies duplicates in a batch as positives to reduce noise.
  • Introduce an angle objective by computing an absolute normalized angle difference in complex space between pair representations, mitigating cosine saturation.
  • Combine the three objectives into a final loss: L = w1*L_cos + w2*L_ibn + w3*L_angle with tunable weights and temperatures.
  • Evaluate using established STS benchmarks (short and long text) and the newly proposed GitHub Issues Similarity Dataset.
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.

Experimental results

Research questions

  • RQ1Can angle optimization in complex space improve STS embeddings beyond cosine-only objectives?
  • RQ2Does AnglE provide robust gains in both transfer and non-transfer STS settings, especially for long-text data?
  • RQ3How does AnglE perform with limited supervised data and when augmented by LLM-supervised labeling?
  • RQ4What is the impact of angle optimization on retrieval and downstream tasks?

Key findings

  • AnglE outperforms state-of-the-art STS models that ignore cosine saturation in both transfer and non-transfer settings.
  • In transfer STS, AnglE-BERT and AnglE-LLaMA2-7B achieve average gains of 0.80% and 0.72% over SimCSE baselines, respectively.
  • In non-transfer STS, AnglE achieves an average Spearman correlation of 73.55% (AnglE-BERT) and 85.96% (AnglE-LLaMA2-7B) on STS tasks, outperforming SBERT and C/S baselines.
  • A newly collected GitHub Issues long-text STS dataset shows a substantial portion of long texts (over 512 tokens) suitable for evaluating long-text STS.
  • Ablation indicates the angle objective significantly contributes to performance and is often more impactful than the in-batch negative component.
  • LLM-supervised AnglE (e.g., with ChatGPT/LLaMA/ChatGLM) further improves STS performance, with ensemble results surpassing unsupervised baselines.
(a)
(a)

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.