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

Question regarding the pooling in QR trick #366

Open
fangleigit opened this issue Nov 24, 2023 · 1 comment
Open

Question regarding the pooling in QR trick #366

fangleigit opened this issue Nov 24, 2023 · 1 comment

Comments

@fangleigit
Copy link

When attempting to use the QR trick, I have noticed that the implementation differs from what is described in the original paper. In the paper, the embedding of a token is obtained by applying operations such as 'add', 'mult', or 'concat' to two separate embedding tables, after which sum or mean pooling is applied. However, the implementation

embed_q = F.embedding_bag(
first applies pooling to the embeddings from the separate tables and then applies 'add', 'mult', or 'concat' to obtain the embedding feature. I am unsure whether this difference is by design or if the two methods are equivalent.

@hjmshi
Copy link
Contributor

hjmshi commented Nov 28, 2023

Hi @fangleigit, good question! Since Criteo only supports one-hot encodings, we've implemented QR here this way. In this case, these two approaches are equivalent.

However, you are correct that ideally the implementation should perform the operation before the sum or mean pooling - this would require a more involved implementation that requires changing the underlying embedding bag implementation. We have not implemented this here.

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

2 participants