Comments (4)
Hi @WenzhengZhang,
In the paper, we use
a learning rate of 5e-6 with batch size 64 for 3 epochs
The batch size 64 here is 8 queries each batch x 8 documents each query.
i.e. the 8x8 setting in the github repo.
The following command should be able to reproduce the results (on 4x GPU):
If you want to train on single GPU, remove
-m torch.distributed.launch --nproc_per_node=4
andnegatives_x_device
, and changeper_device_train_batch_size
to 8
python -m torch.distributed.launch --nproc_per_node=4 -m tevatron.driver.train \
--output_dir ./retriever_model \
--do_train \
--model_name_or_path bert-base-uncased \
--model_name_or_path bert-base-uncased \
--dataset_name Tevatron/msmarco-passage \
--save_steps 20000 \
--q_max_len 16 \
--p_max_len 128 \
--fp16 \
--per_device_train_batch_size 2 \
--train_n_passages 8 \
--learning_rate 5e-6 \
--num_train_epochs 3 \
--dataloader_num_workers 4 \
--negatives_x_device
from tevatron.
Hi @WenzhengZhang, In the paper, we use
a learning rate of 5e-6 with batch size 64 for 3 epochs
The batch size 64 here is 8 queries each batch x 8 documents each query. i.e. the 8x8 setting in the github repo.
The following command should be able to reproduce the results (on 4x GPU):
If you want to train on single GPU, remove
-m torch.distributed.launch --nproc_per_node=4
andnegatives_x_device
, and changeper_device_train_batch_size
to 8python -m torch.distributed.launch --nproc_per_node=4 -m tevatron.driver.train \ --output_dir ./retriever_model \ --do_train \ --model_name_or_path bert-base-uncased \ --model_name_or_path bert-base-uncased \ --dataset_name Tevatron/msmarco-passage \ --save_steps 20000 \ --q_max_len 16 \ --p_max_len 128 \ --fp16 \ --per_device_train_batch_size 2 \ --train_n_passages 8 \ --learning_rate 5e-6 \ --num_train_epochs 3 \ --dataloader_num_workers 4 \ --negatives_x_device
Hi @MXueguang ,
Thanks for your reply! Have you ever tried to set train_n_passages to be 2 for marco? Will only using one BM25 hard negative perform much worse than 7 BM25 hard negatives?
from tevatron.
Hi @WenzhengZhang,
If using train_n_passages=2
, it may require a larger batch size to get the level of MRR. (e,g, batch size=128)
from tevatron.
Thanks a lot!
from tevatron.
Related Issues (20)
- About hard negative mining on NQ HOT 1
- [BIG-REFACTOR] Adapter saving problem HOT 2
- Train in multi-node multi-card environment HOT 2
- Checkpoint path should be absolute HOT 4
- Rankllama: Reproducing DL19 Inference HOT 2
- NQ's mined hard negatives file hn.json contains more queries (70076) than the original NQ train set (58880)?
- lora finetuning error
- Purpose of replace_with_xformers_attention() function HOT 2
- train retriever HOT 1
- ddp traing multi gpu Expected all tensors to be on the same device, but found at least two devices HOT 2
- Loading failed when using Mistral model HOT 4
- train llm retriever lora finetune error HOT 1
- Contrastive pre-training with InfoNCE loss HOT 1
- unable to start training of example HOT 1
- unable to reproduce repllama performance HOT 17
- unable to train HOT 2
- training error
- Error Loading contriever HOT 2
- unable to train HOT 1
- How can I obtain the Wiki-ss dataset? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tevatron.