-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Hello!
I think your RoPE implementation is wrong. The get_sinusoidal_embeddings() function looks correct, but there are two problems with the apply_rotary_position_embeddings() function:
sinusoidal_embcontains sines in even indices and cosines in odd indices. Butsin, cos = sinusoidal_pos.chunk(2, dim=-1)extracts the first and second half ofsinusoidal_emb, not the even and odd indices (i.e. there is a problem with the unpacking)- I understand all the tensor manipulations you are doing, but you still never add cosines with sines (which you should do at some point in the canonical RoPE implementation)
ChatGPT seems to agree with me (detects the same two problems even when I do not hint them), but it could be a misunderstanding on my part.
ktsiam
Metadata
Metadata
Assignees
Labels
No labels