Skip to content
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

Encoder paddings influence results? #45

Open
OanaMariaCamburu opened this issue Nov 20, 2018 · 0 comments
Open

Encoder paddings influence results? #45

OanaMariaCamburu opened this issue Nov 20, 2018 · 0 comments

Comments

@OanaMariaCamburu
Copy link

OanaMariaCamburu commented Nov 20, 2018

Hi,

I noticed that if I just increase n_ctx (it is 77 in https://github.com/huggingface/pytorch-openai-transformer-lm/blob/master/train.py#L214 and I tried different values larger than that) I get different results. For example, with n_ctx=200 I get:
ROCStories Valid Accuracy: 91.18
ROCStories Test Accuracy: 86.10

while without modifying it (n_ctx=77) I get:
ROCStories Valid Accuracy: 90.37
ROCStories Test Accuracy: 86.00

or with n_ctx=100:
ROCStories Valid Accuracy: 90.11
ROCStories Test Accuracy: 86.58

That is almost 1% difference on the validation set, and 0.58% on the test set. Running twice with the same n_ctx gives the same result, so the differences don't come from other sources.

I also couldn't (quickly) find the code that would set to -INF the values corresponding to paddings. I could only find here https://github.com/huggingface/pytorch-openai-transformer-lm/blob/master/model_pytorch.py#L87 for preventing the decoder from looking ahead, but nowhere for preventing the attention to go over the paddings.

As a side question, was wondering about the choice of -1e9 for -INF, couldn't that be too small and that the model still gets a tiny bit of information from ahead?

Thanks,
Oana

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

No branches or pull requests

1 participant