# US 2025/0209100 A1 · Method and system for training retrievers and rerankers using adapters

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0209100 A1
- Document ID: US20250209100A1
- Status: Published application
- Kind: A1
- Application number: 18/417,335
- Filed: 2024-01-19
- Published: 2025-06-26
- Earliest claimed: 2023-12-22
- Applicants: Naver Corporation
- Inventors: Stéphane CLINCHANT; Carlos LASSANCE; Hervé DÉJEAN; Vaishali PAL
- Web page: https://patentgrep.com/patent/US20250209100A1

## CPC

- G06F 16/3344: {using natural language analysis}
- G06F 16/3347: {using vector based model}
- G06F 16/383: using metadata automatically derived from the content
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In a method for training a first-stage neural retriever, adapter layers are inserted into one or more transformer layers of a pretrained language model (PLM) in an encoder configured to receive one or more documents and generate a sparse representation for each of the documents. The first-stage retriever is trained on a downstream task to update one or more parameters of the inserted adapter layers.

## Claims

### Claim 1

A computer-implemented method for training a first-stage neural retriever, the method comprising:
inserting adapter layers into one or more transformer layers of a pretrained language model (PLM) in an encoder of the first-stage retriever, the encoder being configured to receive one or more documents and generate a sparse representation for each of the documents predicting term importance of the document over a vocabulary;
training the first-stage retriever on a downstream task, wherein said training updates one or more parameters of the inserted adapter layers; and
storing the updated one or more parameters of the inserted adapter layers.

### Claim 2 (depends on 1)

The method of claim 1, wherein the encoder is one of a document encoder and a query encoder.

### Claim 3 (depends on 1)

The method of claim 1, wherein: (i) the downstream task is an information retrieval task; (ii) said inserting inserts adapter layers into one or more transformer layers of the PLM in an encoder of a first-stage retriever that is trained on an information retrieval task using a first, in-domain dataset, (iii) said training uses a second-out-of-domain dataset to train the first-stage retriever on an information retrieval task, and (iv) said training updates one or more parameters of the inserted adapter layers while parameters of the PLM are frozen.

### Claim 4 (depends on 1)

The method of claim 1, wherein the first stage retriever comprises:
a document encoder comprising the pretrained language model layer including one or more transformer layers;
a query encoder configured to receive a query and generate a representation of the query; and
a comparator configured to compare the generated representation of the query to the generated representations of the one or more documents to generate a set of respective document scores and rank the one or more documents based on the generated set of document scores.

### Claim 5 (depends on 4)

The method of claim 4, wherein the document encoder and the query encoder comprise a shared encoder.

### Claim 6 (depends on 4)

The method of claim 4, wherein the document encoder and the query encoder are separate encoders.

### Claim 7 (depends on 4)

The method of claim 4, wherein the document encoder and the query encoder share the PLM but include respectively different adapter layer parameters.

### Claim 8 (depends on 1)

The method of claim 1, wherein the training updates the parameters of the one or more of the adapter layers while one or more layers of the PLM remain frozen.

### Claim 9 (depends on 1)

The method of claim 1, wherein the PLM is pretrained to determine a prediction of an importance for an input sequence over the vocabulary with respect to tokens of the input sequence.

### Claim 10 (depends on 1)

The method of claim 1, wherein the training updates a number of parameters in the adapter layers that is a fraction of trainable parameters in the PLM.

### Claim 11 (depends on 1)

The method of claim 1, wherein the downstream task comprises one of information retrieval, domain adaptation, generalization, reranking, and transfer learning.

### Claim 12 (depends on 1)

The method of claim 1, wherein the PLM is pretrained using an in-domain dataset, and wherein said training the first-stage retriever uses an out-of-domain dataset.

### Claim 13 (depends on 1)

The method of claim 1, wherein the transformer layers comprises N transformer layers, each of the N transformer layers comprising:
a fully-connected feedforward layer; and
an attention layer having trained parameters;
wherein, in between 1 and N of the transformer layers an adapter among the one or more adapters is disposed downstream of the feedforward layer.

### Claim 14 (depends on 13)

The method of claim 13, wherein in between 1 and N of the transformer layers another adapter among the one or more adapters is disposed downstream of the attention layer.

### Claim 15 (depends on 1)

The method of claim 1, wherein each of the adapter layers comprises a bottleneck layer having trainable parameters for downprojecting an input of d-dimension into a bottleneck dimension.

### Claim 16 (depends on 1)

The method of claim 1, wherein each of the adapter layers comprises:
a down-projection layer having trainable parameters for downprojecting an input of d-dimension into a bottleneck dimension; and
an up-projection layer having trainable parameters for up-projecting the downprojected input into the d-dimension.

### Claim 17 (depends on 16)

The method of claim 16, wherein each of the adapter layers further comprises a nonlinearity.

### Claim 18 (depends on 1)

The method of claim 1, wherein said training includes one or more of L1 regularization and FLOPS regularization.

### Claim 19 (depends on 1)

The method of claim 1, wherein said training includes distillation.

### Claim 20 (depends on 1)

The ranker of claim 1, wherein said training uses in-batch negative sampling (IBN).

### Claim 21 (depends on 1)

The method of claim 1, wherein the PLM is pretrained using masked language modeling (MLM).

### Claim 22 (depends on 1)

The method of claim 1, wherein said inserting inserts adapter layers with a first set of parameters into one or more layers of the PLM with a second set of parameters in an encoder of the first-stage retriever;
wherein said training updates one or more of the first set of parameters of the inserted adapter layers; and
wherein the second set of parameters is larger than the first set of parameters and the stored updated first set of parameters of the inserted adapter layers represent the larger second set of parameters in the pretrained language model.

### Claim 23 (depends on 22)

The method of claim 22, wherein the one or more layers of the pretrained language model are transformer layers.

### Claim 24 (depends on 23)

The method of claim 23, wherein the second set of parameters of the pretrained language model remain frozen while the first set of parameters of the adapter layers are trained.

### Claim 25 (depends on 22)

The method of claim 22, wherein the encoder further includes a third set of parameters in addition to the second set of parameters of the pretrained language model, and wherein the second set of parameters of the pretrained language model and the third set of parameters of the encoder remain frozen while the first set of parameters of the adapter layers are trained.

### Claim 26

A first-stage retriever for a neural information retrieval model comprising:
a document encoder including a processor comprising a pretrained language model (PLM) layer including at least N transformer layers, the document encoder being configured to receive one or more documents and generate a sparse representation for each of the documents predicting term importance of the document over a vocabulary;
a query encoder including a processor configured to receive a query and generate a representation of the query; and
a comparator including a processor configured to compare the generated representation of the query to the generated representations of the one or more documents to generate a set of respective document scores and rank the one or more documents based on the generated set of document scores;
wherein an adapter layer is inserted into each of 1 to N of the N transformer layers; and
wherein the first-stage retriever is trained on an information retrieval task to update one or more parameters of the inserted adapter layers.

### Claim 27 (depends on 26)

The first-stage retriever of claim 26, wherein the document encoder and the query encoder comprise a shared encoder.

### Claim 28 (depends on 26)

The first-stage retriever of claim 26, wherein the document encoder and the query encoder share the PLM but include respectively different adapter layer parameters.

### Claim 29 (depends on 26)

The first stage retriever of claim 26, wherein the training on the information retrieval task updates a number of parameters in the adapter layers that is fewer than 10% of trainable parameters in the PLM.

### Claim 30 (depends on 26)

The first stage retriever of claim 26, wherein the PLM is pretrained using an in-domain dataset, and wherein said training the first-stage retriever uses an out-of-domain dataset.

### Claim 31 (depends on 26)

The first stage retriever of claim 26, wherein each of the N transformer layers comprises:
a fully-connected feedforward layer; and
an attention layer having trained parameters;
wherein, in between 1 and N of the transformer layers an adapter among the one or more adapters is disposed downstream of the feedforward layer.

### Claim 32 (depends on 31)

The first stage retriever of claim 31, wherein in between 1 and N of the transformer layers another adapter among the one or more adapters is disposed downstream of the attention layer.

### Claim 33 (depends on 31)

The first stage retriever of claim 31, wherein each of the adapter layers comprises:
a down-projection layer having trainable parameters for downprojecting an input of d-dimension into a bottleneck dimension; and
an up-projection layer having trainable parameters for up-projecting the downprojected input into the d-dimension.

### Claim 34 (depends on 31)

The first stage retriever of claim 31, wherein the training on the information retrieval task includes FLOPS regularization, distillation, and/or in-batch negative sampling.

### Claim 35

A computer-implemented method for information retrieval, the method comprising:
generating, by a document encoder comprising a pretrained language model (PLM) layer including one or more transformer layers having inserted adapter layers, a sparse representation for each of one or more received documents predicting term importance of the document over a vocabulary;
generating, by a query encoder, a representation of a received query over the vocabulary;
comparing the generated representation of the query to the generated representations of the one or more documents to generate a set of respective document scores; and
ranking the one or more documents based on the generated set of document scores;
wherein the document encoder is trained on a downstream task by updating parameters of the inserted adapters while the PLM remains frozen.

### Claim 36 (depends on 35)

The method of claim 35, wherein the document encoder and the query encoder are shared.

### Claim 37 (depends on 35)

The method of claim 35, wherein the document encoder and the query encoder comprise a shared PLM with separately trainable adapter layers.

### Claim 38 (depends on 35)

The method of claim 35, wherein the document encoder is trained on a first, in-domain dataset, and wherein the document encoder is further trained on the information retrieval task using a second, out-of-domain dataset.
