-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Inconsistent inference and evaluation results of the XLNET-CLM even on the training set! #761
Comments
I've reviewed the clm masking code, and I'm little confused about this line here:
I would like to know, what is the purpose of removing the last padding item if the input is padded? Should the last item be removed instead of the feature of the last padding item? |
anyway, I changed some code in
Interestingly, with this modification, the metrics of XLNet in the CLM setting have decreased compared to before, making it more reasonable. I've also noticed that this #719 and #746 mentioned a similar issue. Additionally, I observed that the outputs of the
I'm not sure if my changes are correct, and I strongly recommend that you pay attention to this issue. Thanks! |
Bug description
Hello, I followed the example and successfully trained an XLNet-CLM model on my custom dataset. However, I noticed that while the model performs well on the validation set with
trainer.evaluate()
(even achieving 90% recall@5), I encountered many errors when usingtrainer.predict()
for inference, falling far short of the expected performance.So, I conducted an experiment:
I took a portion of the training set data and input it into both functions. I used
sequence[:]
forevaluate()
andsequence[:-1]
forpredict()
:Ideally, the predictions from both functions should be similar, but it seems the inference results is significantly worse:
Please note that I conducted this experiment on the training set. The outputs from evaluation are expected, but the inference not. I'm curious to know why this is happening. Thanks!
Here is my code that generates the outputs above:
Environment details
The text was updated successfully, but these errors were encountered: