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] RoPE的实现和论文里不一致 #136

Open
5 tasks done
zehmaaa opened this issue Oct 4, 2023 · 1 comment
Open
5 tasks done

[Question] RoPE的实现和论文里不一致 #136

zehmaaa opened this issue Oct 4, 2023 · 1 comment
Labels
question Further information is requested

Comments

@zehmaaa
Copy link

zehmaaa commented Oct 4, 2023

Required prerequisites

Questions

请问这里 的实现为啥和论文里面不一样?

def rotate_half(x):
    """Rotates half the hidden dims of the input."""
    x1 = x[..., : x.shape[-1] // 2]
    x2 = x[..., x.shape[-1] // 2:]
    return torch.cat((-x2, x1), dim=-1)

论文里的计算是
image

按照这种实现最后的计算结果会是
image

我看huggingface里面也是这样,好奇为啥选择这种实现?

Checklist

  • I have provided all relevant and necessary information above.
  • I have chosen a suitable title for this issue.
@zehmaaa zehmaaa added the question Further information is requested label Oct 4, 2023
@xinge333
Copy link

xinge333 commented Jul 3, 2024

embedding 里面神经元的位置是没有顺序的,随便选一半做反转就行了;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants