Skip to content

feat: add reranker training#1449

Draft
adil-a wants to merge 17 commits intomainfrom
adil/retriever-feat
Draft

feat: add reranker training#1449
adil-a wants to merge 17 commits intomainfrom
adil/retriever-feat

Conversation

@adil-a
Copy link
Collaborator

@adil-a adil-a commented Mar 4, 2026

  • Add in retriever train recipe, retriever collator, retriever data loader
  • Remove lm_p
  • Change Biencoder -> Encoder

Signed-off-by: adil-a <adil.asif2000@hotmail.com>
@copy-pr-bot
Copy link

copy-pr-bot bot commented Mar 4, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

adil-a added 5 commits March 4, 2026 07:49
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
@adil-a adil-a changed the title feat: add retriever training feat: add reranker training Mar 5, 2026
adil-a added 7 commits March 5, 2026 04:42
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
@rnyak rnyak mentioned this pull request Mar 5, 2026
3 tasks
adil-a added 2 commits March 6, 2026 16:26
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Signed-off-by: adil-a <adil.asif2000@hotmail.com>
)
with train_ctx:
outputs = model(**batch, return_dict=True)
logits = outputs.logits.view(-1, self.train_n_passages)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we basically want to use same value both for train_n_passage both for training and validation? in the yaml file we have train_n_passage defined twice under dataloader and validation_dataloader. what if user put different value for each. according to line above we'd be still using train_n_passages defined under dataloader field in the yaml right?

# model_type: crossencoder
# data_dir_list: training_datasets/validation.json
# data_type: eval
# train_n_passages: 5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we better name this to val_n_passages? bcs in the current case it should be identical to train_n_passages, I wonder what happens if we set it to a different number than the training. I left a related comment about this below.


seed: 42

train_n_passages: 5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we duplicate this in three different places? isnt that risky? why not define only once.

seed: 42

train_n_passages: 5
eval_negative_size: 4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are overcomplicating the yaml. why we need the eval_neg_size?

option 1:

  • set train_n_passages only once in the yaml, use it everywhere, both for training and evaluation
    option 2:
  • set train_n_passages, and val_n_passages, and use train_n_passages for training process, the second for val process.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make the change to support the second option

q_reps = model(query)
p_reps = model(passage)

n_passages = self.eval_negative_size + 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit unnecessary, related to my comment above. if we go with option 1 then n_passages is basically same as self.train_n_passages.

Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants