arXiv(opens in a new tab)cs.CLJul 2024Cited by 7 papers on PaperVantage

Manuscript Offprint

arXiv:2407.19669

mGTE: Generalized Long-Context Text Representation and Reranking Models for Multilingual Text Retrieval

Xin Zhang, Yanzhao Zhang, Dingkun Long, Wen Xie, Ziqi Dai, Jialong Tang, Huan Lin, Baosong Yang, Pengjun Xie, Fei Huang, Meishan Zhang, Wenjie Li, Min Zhang

Abstract

We present systematic efforts in building long-context multilingual text representation model (TRM) and reranker from scratch for text retrieval. We first introduce a text encoder (base size) enhanced with RoPE and unpadding, pretrained in a native 8192-token context (longer than 512 of previous multilingual encoders). Then we construct a hybrid TRM and a cross-encoder reranker by contrastive learning. Evaluations show that our text encoder outperforms the same-sized previous state-of-the-art XLM-R. Meanwhile, our TRM and reranker match the performance of large-sized state-of-the-art BGE-M3 models and achieve better results on long-context retrieval benchmarks. Further analysis demonstrate that our proposed models exhibit higher efficiency during both training and inference. We believe their efficiency and effectiveness could benefit various researches and industrial applications.¹

1 Introduction

Text retrieval aims to find relevant passages or documents from a large corpus given a query (Manning, 2008). It is often implemented as a multi-stage process, consisting of two main components: a retriever and a reranker (Gao et al., 2021a; Zhang et al., 2022; Zhao et al., 2024). The retriever identifies a set of candidate documents that are potentially relevant to the query based on the similarity between their sparse (lexical term weights) or/and dense representations from a text representation model (TRM). While the reranker reorders these retrieved candidates to refine the results based on the relevance score generated by a more precise yet computationally demanding model that processes both the query and a candidate document together.

Recent advances in large language models (LLMs) and retrieval augmented generation (RAG)

Figure

Figure 1: Training pipeline. We first build an 8k long-context multilingual encoder. Then based on it, we train text representation and reranking models for retrieval.

(Gao et al., 2023) systems have led to an unprecedented surge in demand for versatile, plug-and-play TRMs and rerankers. These new applications heavily involve processing long and multilingual texts, which could not be addressed by conventional encoder-based models and urgently require upgraded ones. To this end, some resort to enhancing existing multilingual encoders, e.g., XLM-R (Conneau et al., 2020), with extended context window up to 8192 (Chen et al., 2024). Others turn to use multilingual LLMs which already have the required capabilities (Zhang et al., 2023a), but their models might be computationally expensive for self-hosted search services.

In the English community, it has been proven that training long-context encoders from scratch is promising for text retrieval (Günther et al., 2023; Nussbaum et al., 2024). In this work, we continue this journey, presenting systematic efforts in building the long-context multilingual text encoder, TRM, and reranker. We suggest a holistic pipeline (Figure 1) as well as several techniques in modeling and training for multilingual long-context retrieval.

Concretely, we first introduce a text encoder enhanced with Rotary Position Embedding (RoPE, Su et al., 2024) and unpadding (Portes et al., 2023), pre-trained by masked language modeling (MLM) (Devlin et al., 2019) via a two-stage curriculum for the native 8,192 tokens context. Based on our encoder, we propose a hybrid TRM capable of generating both elastic dense (Kusupati et al., 2022)

*Corresponding Author ¹Models are released at https://hf.co/Alibaba-NLP/gte-multilingual-base.

Figure

Figure 2: Our text encoder architecture.

and sparse vectors for efficient first-stage retrieval, as well as a cross-encoder reranker. We construct them via the contrastive learning objective (Wang et al., 2022; Li et al., 2023) with large-scale meticulously curated datasets, providing robust off-the-shelf retrieval models.

We conduct extensive experiments to verify our method. For the text encoder, we evaluate on two natural language understanding (NLU) benchmarks, i.e., XTREME-R (Ruder et al., 2021) and GLUE (Wang et al., 2018), and show that our encoder outperforms the same-sized previous state-of-the-art XLM-R. For the TRM and reranker, we evaluate on multiple retrieval benchmarks with multilingual and long-context settings, e.g., MIR-ACL (Zhang et al., 2023b) and MLDR (Chen et al., 2024), where our models match the performance of state-of-the-art BGE-M3 (Chen et al., 2024) and achieve better long-context performance by a smaller size. We open-source our models and code to facilitate further research and applications.

References (28)