huggingface / huggingface/transfer-learning-conv-ai

Model uses label to generate predictions during training?

Open
#69 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.8k
Forks
430
PR merge metrics
No merged PRs in 30d

Description

The ```input_ids``` tensor that is provided as input for the language modeling task contains the ground-truth label. Doesn't this mean the model uses the label (in addition to the other information in the ```input_ids``` tensor) to make predictions during training? I know the label is also given to the model in the ```lm_labels``` tensor and this is the tensor that the model checks its prediction against in order to calculate loss but if the model is making its prediction based on ```input_ids``` then it is making predictions with knowledge of what the correct label is. Is this correct? Or am I missing something.
The only other way I can see that this might work is if the model somehow uses the -1 (mask) values in ```lm_labels``` to see which part of ```input_ids``` it should use to make the prediction (which presumably would make the model only consider elements in ```input_ids``` that correspond to elements in ```lm_labels``` that are equal to -1 since these elements are not part of the label).

Also, its not clear how the multiple-choice prediction task is done. I know each data instance contains multiple versions of the ```input_ids``` tensor and one of them contains the true label while the others contain distractor labels. Does the model look at each of these ```input_ids``` tensors and try to select the one that contains the true label out of all the options?
If this is the case, since the ```input_ids``` tensor that contains the correct option is always the last one in the list of options, wouldn't the model just learn to always select the last option (similar to always predicting the same class for each instance) instead of actually learning anything useful?

I would really like to understand how the model works in these respects so I can create a custom dataset to train on so thank you for taking the time to read these questions.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names the input_ids and lm_labels tensors and the multiple-choice input batches, but no source files or tests. Start by tracing where those tensors enter training and multiple-choice evaluation, then verify how labels are masked and options are scored. Done means documenting the data flow and resolving whether option ordering can create label leakage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.