spacemanidol's picture
Upload 9 files
537f60a verified
|
raw
history blame
5.51 kB

TREC RAG baselines using arctic-l and arctic-m-v1.5

First, download the data including documents, queries, qrels.

Generate The doc and query embeddings

bash get_data.sh

Next, go ahead and convert the qrels format into json using the script below.

python convert_qrels_to_json.py

After that, go ahead and generate the query embeddings using the command below.

python generate_query_embeddings.py

After that, go ahead and generate embeddings for each shard. This will take ~ 20m per shard on a single H100. Feel free to parallelize. Make sure you have at least 600 gbs free.

python generate_doc_embeddings.py

Retrieval Runs

Once you have query and doc embeddings go ahead and retrieve. Given the size of the vectors we do this in shards. First we retrieve the top_n from each shard for each queryset on each shard. Feel free to parrelize.

python retrieve_from_shard.py <path to embeddings> <query_embedding_prefix>  <shard> <num_retrieved> <use_faiss>

Alternatively, you can just run retrieve.sh in the background.

python merge_retrieved_shard.py <shard_retrieved_results> <output_filename> <top_n_docs> <qrel json> <metric to get per_query breakdown>

Retrieval Scores

NDCG@10

NDCG @10
Dataset BM25 GTE-Large-v1.5 Arctic-L Arctic-M-V1.5 Arctic-M-V1.5 Arctic-M-V1.5 Cohere Embed3 - Trunc 128
Dim N/A 1024 1024 768 256 128 128
Deep Learning 2021 0.5778 0.71928 0.70682 0.6936 0.69392 0.60578 0.6962
Deep Learning 2022 0.3576 0.53576 0.5444 0.55199 0.55608 0.47348 0.5396
Deep Learning 2023 0.3356 0.46423 0.47372 0.46963 0.45196 0.32789 0.4473
msmarcov2-dev N/A 0.3538 0.35844 0.346 0.34074 0.28499 N/A
msmarcov2-dev2 N/A 0.34698 0.35821 0.34518 0.34339 0.29606 N/A
Raggy Queries 0.4227 0.56782 0.57759 0.57439 0.56686 0.47555 N/A

Recall @100

Recall@100
Dataset BM25 GTE-Large-v1.5 Arctic-L Arctic-M-V1.5 Arctic-M-V1.5 Arctic-M-V1.5 Cohere Embed3 - Trunc 128
Dim N/A 1024 1024 768 256 128 128
Deep Learning 2021 0.3811 0.4156 0.41361 0.43 0.42245 0.3488 0.3914
Deep Learning 2022 0.233 0.31173 0.31351 0.32125 0.3165 0.26714 0.3019
Deep Learning 2023 0.3049 0.35236 0.34793 0.37622 0.36089 0.28314 0.3438
msmarcov2-dev 0.6683 0.85135 0.85131 0.85435 0.84985 0.76201 N/A
msmarcov2-dev2 0.6771 0.84333 0.84767 0.8576 0.8526 0.78987 N/A
Raggy Queries 0.2807 0.35125 0.36228 0.36915 0.36149 0.30272 N/A

Recall @1000

Recall@1000
Dataset BM25 GTE-Large-v1.5 Arctic-L Arctic-M-V1.5 Arctic-M-V1.5 Arctic-M-V1.5 Cohere Embed3 - Trunc 128
Dim N/A 1024 1024 768 256 128 128
Deep Learning 2021 0.7115 0.73185 0.7193 0.74895 0.73511 0.63253 0.7188
Deep Learning 2022 0.479 0.55174 0.54566 0.55413 0.54499 0.47823 0.5558
Deep Learning 2023 0.5852 0.6167 0.59577 0.62262 0.61199 0.49188 0.6025
msmarcov2-dev 0.8528 0.93549 0.93966 0.94156 0.94014 0.87705 N/A
msmarcov2-dev2 0.8577 0.93997 0.93947 0.94277 0.94047 0.91683 N/A
Raggy Queries 0.5745 0.63515 0.63092 0.64527 0.63826 0.55002 N/A