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

Use Rotary Embeddings in SRU++ #182

Open
bratao opened this issue May 2, 2021 · 4 comments
Open

Use Rotary Embeddings in SRU++ #182

bratao opened this issue May 2, 2021 · 4 comments

Comments

@bratao
Copy link

bratao commented May 2, 2021

@taolei87 I'm way too excited with SRUpp. I already adopted in all my projects with impressive results.

Recently the great people at Eleuther.ai found a silver-bullet in transformers. The Rotary Embeddings.

The RoPE is a relative position encoding method with promise theoretical properties. The main idea is to multiply the context embeddings (q,k in the Transformer) by rotation matrices depending on the absolute position. One can prove that the inner product of the context embeddings will become only depending on the relative position.

It gave a performance increase in virtually all tasks tested.
There is more information here:
https://blog.eleuther.ai/rotary-embeddings/

From the little of I understood of SRU++ builds in self-attention, it would be possible to use in SRUppAttention to q, k. Do you think that worth the test?

@taoleicn
Copy link
Contributor

taoleicn commented May 3, 2021

Thank you @bratao. Let me take a look and get back to you.

@bratao
Copy link
Author

bratao commented May 3, 2021

Thank you @taoleicn . I did a very possibly wrong implementation here
bratao@1c614c3
However, I'm running some tests and apparently it is converging faster

@taoleicn
Copy link
Contributor

taoleicn commented May 4, 2021

Thanks for sharing @bratao. I read the paper and it is indeed very interesting.
Do you have any preliminary results? If you see consistent or significant improvement using RoE, we should find a way to incorporate it as an optional module.

@bratao
Copy link
Author

bratao commented May 5, 2021

@taoleicn I only tested on toy examples and them converged faster. Unfortunately, I'm too overwhelmed with work to test on something like enwik8

Did you had the opportunity to check if I placed on the right place on my implementation? I have a big impression that I placed on the wrong place.

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