Table of Contents
2. Training
Experimental results
Synthetic data statistics
Main results
Home Technology peripherals AI No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks

No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks

Jan 30, 2024 pm 09:39 PM
Model train

Text embedding (word embedding) is a basic technology in the field of natural language processing (NLP). It can map text to semantic space and convert it into dense vector representation. This method has been widely used in various NLP tasks, including information retrieval (IR), question answering, text similarity calculation, and recommendation systems. Through text embedding, we can better understand the meaning and relationship of text, thereby improving the effectiveness of NLP tasks.

In the field of information retrieval (IR), the first stage of retrieval usually uses text embeddings for similarity calculation. It works by recalling a small set of candidate documents in a large-scale corpus and then performs fine-grained calculations. Embedding-based retrieval is also an important component of Retrieval Augmentation Generation (RAG). It enables large language models (LLMs) to access dynamic external knowledge without modifying model parameters. In this way, the IR system can better utilize text embeddings and external knowledge to improve retrieval results.

Although early text embedding learning methods such as word2vec and GloVe are widely used, their static characteristics limit the ability to capture rich contextual information in natural language. However, with the rise of pre-trained language models, some new methods such as Sentence-BERT and SimCSE have achieved significant progress on natural language inference (NLI) datasets by fine-tuning BERT to learn text embeddings. These methods leverage BERT's context-aware capabilities to better understand the semantics and context of text, thereby improving the quality and expressiveness of text embeddings. Through a combination of pre-training and fine-tuning, these methods are able to learn richer semantic information from large-scale corpora, providing natural language processing

#In order to improve text embedding performance and robustness , advanced methods such as E5 and BGE adopt multi-stage training. They are first pre-trained on billions of weakly supervised text pairs and then fine-tuned on several annotated datasets. This strategy can effectively improve the performance of text embedding.

The existing multi-stage method still has two flaws:

1. Constructing a complex multi-stage training pipeline requires a lot of Engineering work to manage large numbers of correlation pairs.

2. Fine-tuning relies on manually collected data sets, which are often limited by task diversity and language coverage.

Most methods use BERT-style encoders and ignore the training progress of better LLM and related techniques.

Microsoft’s research team recently proposed a simple and efficient text embedding training method to overcome some of the shortcomings of previous methods. This approach does not require complex pipeline designs or manually constructed datasets, but leverages LLM to synthesize diverse text data. With this approach, they were able to generate high-quality text embeddings for hundreds of thousands of text embedding tasks in nearly 100 languages, while the entire training process took less than 1,000 steps.

No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks

## Paper link: https://arxiv.org/abs/2401.00368

Specifically, the researchers used a two-step prompting strategy, first prompting the LLM to brainstorm a pool of candidate tasks, and then prompting the LLM to generate data for a given task from the pool.

In order to cover different application scenarios, the researchers designed multiple prompt templates for each task type, and combined the data generated by different templates to increase diversity. .

Experimental results prove that when fine-tuning "only synthetic data", Mistral-7B achieves very competitive performance on the BEIR and MTEB benchmarks; when synthetic and Sota performance can be achieved when the annotated data is fine-tuned.

Using large models to improve text embedding

1. Synthetic data generation

Utilize state-of-the-art large-scale models such as GPT-4 Language models (LLM) are gaining more and more attention to synthesize data, which can enhance the diversity of the model's multi-task and multi-language capabilities, and then train more robust text embeddings, which can be used in various downstream tasks (such as semantic retrieval, text Similarity calculation, clustering) can perform well.

To generate diverse synthetic data, the researchers proposed a simple taxonomy that first classifies embedding tasks and then uses different prompt templates for each type of task.

Asymmetric Tasks

Includes tasks in which the query and the document are semantically related but do not paraphrase each other.

Based on the length of the query and document, the researchers further divided the asymmetric task into four subcategories: short-long matching (short query and long document, a typical scenario in commercial search engines ), long-short matching, short-short matching and long-long matching.

For each subcategory, the researchers designed a two-step prompt template that first prompts LLM to brainstorm a task list and then generates a specific example of the task-defined conditions; from GPT The output of -4 is mostly consistent and of high quality.

No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks

#In preliminary experiments, the researchers also tried using a single prompt to generate task definition and query document pairs, but the data diversity was not as good as the above two steps. method.

Symmetry tasks

mainly include queries and documents with similar semantics but different surface forms.

This article studies two application scenarios: monolingual semantic text similarity (STS) and bi-text retrieval, and designs two different prompt templates for each scenario. , customized to its specific goals, and since the definition of the task is relatively simple, the brainstorming step can be omitted.

In order to further increase the diversity of prompt words and improve the diversity of synthetic data, the researchers added several placeholders to each prompt board and randomly sampled them at runtime. For example, "{query_length}" represents sampling from the set "{less than 5 words, 5-10 words, at least 10 words}".

In order to generate multilingual data, researchers sampled the value of "{language}" from the language list of XLM-R, giving more weight to high-resource languages; any language that does not meet the expected Any generated data defining the JSON format will be discarded during parsing; duplicates will also be removed based on exact string matching.

2. Training

Given a related query-document pair, first use the original query q to generate a new instruction q_inst, Where "{task_definition}" is a placeholder that embeds a one-sentence description of the task.

No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks

For generated synthetic data, the output of the brainstorming step is used; for other datasets, such as MS-MARCO, researchers manually create task definitions and applies it to all queries in the dataset, without modifying any directive prefixes on the file side.

This way the document index can be pre-built and the tasks to be performed can be customized by changing only the query side.

Given a pre-trained LLM, append an [EOS] token to the end of the query and document, and then feed it into the LLM by getting the last layer [EOS] vector Get query and document embeddings.

Then use the standard InfoNCE loss to calculate the loss of negatives and hard negatives within the batch.

No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks

where ℕ represents the set of all negatives, No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks is used to calculate the matching score between the query and the document, t is a temperature hyperparameter, fixed at 0.02 in the experiment

No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks

Experimental results

Synthetic data statistics

The researchers used the Azure OpenAI service to generate 500k samples, containing 150k unique instructions, of which 25% were generated by GPT-3.5-Turbo and the remainder by GPT-4, consuming a total of 180 million tokens. .

The main language is English, covering a total of 93 languages; for 75 low-resource languages, there are an average of about 1k samples per language.

No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks

In terms of data quality, the researchers found that some of the output of GPT-3.5-Turbo did not strictly follow the guidelines stated in the prompt template, but despite this, the overall quality was still acceptable Accepted, preliminary experiments also demonstrate the benefits of employing this subset of data.

Model fine-tuning and evaluation

The researchers used the above loss to fine-tune the pre-trained Mistral-7B for 1 epoch, Follow the training method of RankLLaMA and use LoRA with rank 16.

To further reduce GPU memory requirements, technologies such as gradient checkpointing, mixed precision training, and DeepSpeed ​​ZeRO-3 are used.

In terms of training data, both generated synthetic data and 13 public datasets were used, resulting in approximately 1.8 million examples after sampling.

For a fair comparison with some previous work, the researchers also report results when the only annotation supervision is the MS-MARCO chapter ranking dataset, and also on the MTEB benchmark. The model was evaluated.

Main results

As you can see in the table below, the model "E5mistral-7B full data" obtained in the article was obtained in the MTEB benchmark test achieved the highest average score, 2.4 points higher than the previous state-of-the-art model.

In the "w/ synthetic data only" setting, no annotated data is used for training, but the performance is still very competitive.

No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks

The researchers also compared several commercial text embedding models, but a lack of transparency and documentation on these models prevented a fair comparison. .

However, it can be seen from the retrieval performance comparison results on the BEIR benchmark that the trained model is superior to the current commercial model to a large extent.

No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks

Multi-language retrieval

In order to evaluate the multi-language capabilities of the model, The researchers conducted evaluations on the MIRACL dataset, which contains human-annotated queries and relevance judgments in 18 languages.

The results show that the model surpasses mE5-large in high-resource languages, especially in English. However, for low-resource languages, the model has better performance than mE5-large. Compared with mE5-base, it is still not ideal.

The researchers attribute this to Mistral-7B being pre-trained primarily on English data, a method that predictive multilingual models can use to bridge this gap.

The above is the detailed content of No manual annotation required! LLM supports text embedding learning: easily supports 100 languages ​​and adapts to hundreds of thousands of downstream tasks. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1261
29
C# Tutorial
1234
24
Open source! Beyond ZoeDepth! DepthFM: Fast and accurate monocular depth estimation! Open source! Beyond ZoeDepth! DepthFM: Fast and accurate monocular depth estimation! Apr 03, 2024 pm 12:04 PM

0.What does this article do? We propose DepthFM: a versatile and fast state-of-the-art generative monocular depth estimation model. In addition to traditional depth estimation tasks, DepthFM also demonstrates state-of-the-art capabilities in downstream tasks such as depth inpainting. DepthFM is efficient and can synthesize depth maps within a few inference steps. Let’s read about this work together ~ 1. Paper information title: DepthFM: FastMonocularDepthEstimationwithFlowMatching Author: MingGui, JohannesS.Fischer, UlrichPrestel, PingchuanMa, Dmytr

The world's most powerful open source MoE model is here, with Chinese capabilities comparable to GPT-4, and the price is only nearly one percent of GPT-4-Turbo The world's most powerful open source MoE model is here, with Chinese capabilities comparable to GPT-4, and the price is only nearly one percent of GPT-4-Turbo May 07, 2024 pm 04:13 PM

Imagine an artificial intelligence model that not only has the ability to surpass traditional computing, but also achieves more efficient performance at a lower cost. This is not science fiction, DeepSeek-V2[1], the world’s most powerful open source MoE model is here. DeepSeek-V2 is a powerful mixture of experts (MoE) language model with the characteristics of economical training and efficient inference. It consists of 236B parameters, 21B of which are used to activate each marker. Compared with DeepSeek67B, DeepSeek-V2 has stronger performance, while saving 42.5% of training costs, reducing KV cache by 93.3%, and increasing the maximum generation throughput to 5.76 times. DeepSeek is a company exploring general artificial intelligence

AI subverts mathematical research! Fields Medal winner and Chinese-American mathematician led 11 top-ranked papers | Liked by Terence Tao AI subverts mathematical research! Fields Medal winner and Chinese-American mathematician led 11 top-ranked papers | Liked by Terence Tao Apr 09, 2024 am 11:52 AM

AI is indeed changing mathematics. Recently, Tao Zhexuan, who has been paying close attention to this issue, forwarded the latest issue of "Bulletin of the American Mathematical Society" (Bulletin of the American Mathematical Society). Focusing on the topic "Will machines change mathematics?", many mathematicians expressed their opinions. The whole process was full of sparks, hardcore and exciting. The author has a strong lineup, including Fields Medal winner Akshay Venkatesh, Chinese mathematician Zheng Lejun, NYU computer scientist Ernest Davis and many other well-known scholars in the industry. The world of AI has changed dramatically. You know, many of these articles were submitted a year ago.

KAN, which replaces MLP, has been extended to convolution by open source projects KAN, which replaces MLP, has been extended to convolution by open source projects Jun 01, 2024 pm 10:03 PM

Earlier this month, researchers from MIT and other institutions proposed a very promising alternative to MLP - KAN. KAN outperforms MLP in terms of accuracy and interpretability. And it can outperform MLP running with a larger number of parameters with a very small number of parameters. For example, the authors stated that they used KAN to reproduce DeepMind's results with a smaller network and a higher degree of automation. Specifically, DeepMind's MLP has about 300,000 parameters, while KAN only has about 200 parameters. KAN has a strong mathematical foundation like MLP. MLP is based on the universal approximation theorem, while KAN is based on the Kolmogorov-Arnold representation theorem. As shown in the figure below, KAN has

Hello, electric Atlas! Boston Dynamics robot comes back to life, 180-degree weird moves scare Musk Hello, electric Atlas! Boston Dynamics robot comes back to life, 180-degree weird moves scare Musk Apr 18, 2024 pm 07:58 PM

Boston Dynamics Atlas officially enters the era of electric robots! Yesterday, the hydraulic Atlas just "tearfully" withdrew from the stage of history. Today, Boston Dynamics announced that the electric Atlas is on the job. It seems that in the field of commercial humanoid robots, Boston Dynamics is determined to compete with Tesla. After the new video was released, it had already been viewed by more than one million people in just ten hours. The old people leave and new roles appear. This is a historical necessity. There is no doubt that this year is the explosive year of humanoid robots. Netizens commented: The advancement of robots has made this year's opening ceremony look like a human, and the degree of freedom is far greater than that of humans. But is this really not a horror movie? At the beginning of the video, Atlas is lying calmly on the ground, seemingly on his back. What follows is jaw-dropping

Tesla robots work in factories, Musk: The degree of freedom of hands will reach 22 this year! Tesla robots work in factories, Musk: The degree of freedom of hands will reach 22 this year! May 06, 2024 pm 04:13 PM

The latest video of Tesla's robot Optimus is released, and it can already work in the factory. At normal speed, it sorts batteries (Tesla's 4680 batteries) like this: The official also released what it looks like at 20x speed - on a small "workstation", picking and picking and picking: This time it is released One of the highlights of the video is that Optimus completes this work in the factory, completely autonomously, without human intervention throughout the process. And from the perspective of Optimus, it can also pick up and place the crooked battery, focusing on automatic error correction: Regarding Optimus's hand, NVIDIA scientist Jim Fan gave a high evaluation: Optimus's hand is the world's five-fingered robot. One of the most dexterous. Its hands are not only tactile

Kuaishou version of Sora 'Ke Ling' is open for testing: generates over 120s video, understands physics better, and can accurately model complex movements Kuaishou version of Sora 'Ke Ling' is open for testing: generates over 120s video, understands physics better, and can accurately model complex movements Jun 11, 2024 am 09:51 AM

What? Is Zootopia brought into reality by domestic AI? Exposed together with the video is a new large-scale domestic video generation model called "Keling". Sora uses a similar technical route and combines a number of self-developed technological innovations to produce videos that not only have large and reasonable movements, but also simulate the characteristics of the physical world and have strong conceptual combination capabilities and imagination. According to the data, Keling supports the generation of ultra-long videos of up to 2 minutes at 30fps, with resolutions up to 1080p, and supports multiple aspect ratios. Another important point is that Keling is not a demo or video result demonstration released by the laboratory, but a product-level application launched by Kuaishou, a leading player in the short video field. Moreover, the main focus is to be pragmatic, not to write blank checks, and to go online as soon as it is released. The large model of Ke Ling is already available in Kuaiying.

The latest from Oxford University! Mickey: 2D image matching in 3D SOTA! (CVPR\'24) The latest from Oxford University! Mickey: 2D image matching in 3D SOTA! (CVPR\'24) Apr 23, 2024 pm 01:20 PM

Project link written in front: https://nianticlabs.github.io/mickey/ Given two pictures, the camera pose between them can be estimated by establishing the correspondence between the pictures. Typically, these correspondences are 2D to 2D, and our estimated poses are scale-indeterminate. Some applications, such as instant augmented reality anytime, anywhere, require pose estimation of scale metrics, so they rely on external depth estimators to recover scale. This paper proposes MicKey, a keypoint matching process capable of predicting metric correspondences in 3D camera space. By learning 3D coordinate matching across images, we are able to infer metric relative

See all articles