Question Answering
File size: 1,865 Bytes
b238c32
 
0970523
 
 
b238c32
0970523
 
 
 
 
 
 
066a8d7
 
 
 
 
 
0970523
 
 
 
 
 
066a8d7
 
 
 
 
 
 
 
0970523
 
 
 
 
 
 
 
 
 
 
066a8d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
license: mit
datasets:
- natural_questions
pipeline_tag: question-answering
---
# AdANNS: A Framework for Adaptive Semantic Search 馃拑
_Aniket Rege*, Aditya Kusupati*, Sharan Ranjit S, Alan Fan, Qinqqing Cao, Sham Kakade, Prateek Jain, Ali Farhadi_

GitHub: https://github.com/RAIVNLab/AdANNS

Arxiv: https://arxiv.org/abs/2305.19435

<p align="center">
<img src="https://cdn-uploads.huggingface.co/production/uploads/64af72d4a609b29cc7b5919b/QYOqZ25qc9pTWlFR0D0VF.png" alt="drawing" width="600"/>
Adaptive representations can be utilized effectively in the decoupled components of clustering and
searching for a better accuracy-compute trade-off (AdANNS-IVF).
</p>

We provide four BERT-Base models finetuned on Natural Questions with [Matryoshka Representation Learning](https://github.com/RAIVNLab/MRL) (MRL).

A vanilla pretrained BERT-Base has a 768-d representation (information bottleneck). As we train with MRL, we enforce the network to learn representations at 
multiple granularities nested within a 768-d embedding. The granularities at which we finetune BERT-Base with Matroyshka Loss are specified in the folder name,
e.g. for `dpr-nq-d768_384_192_96_48`, we have d=[48, 96, 192, 384, 768]. 

You can easily load an mrl-nq model as follows:
```
from transformers import BertModel
import torch

model = BertModel.from_pretrained('dpr-nq-d768_384_192_96_48')
```

## Citation
If you find this project useful in your research, please consider citing:
```
@inproceedings{rege2023adanns,
      title={AdANNS: A Framework for Adaptive Semantic Search}, 
      author={Aniket Rege and Aditya Kusupati and Sharan Ranjit S and Alan Fan and Qingqing Cao and Sham Kakade and Prateek Jain and Ali Farhadi},
      year={2023},
      booktitle = {Advances in Neural Information Processing Systems},
      month     = {December},
      year      = {2023},
}
```