NoPE

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2025 Aug 24 22:28
Editor
Edited
Edited
2025 Aug 24 22:47
Refs
Refs

No Positional Embedding

Removing some of the RoPE (Rotary Positional Embedding), which was designed to help models better analyze positional information, actually improves the understanding of global context.

Limitation of RoPE

When models are pretrained on relatively short contexts and then extended to learn longer contexts, applying the same rotation patterns to distances not seen in the initial training phase can introduce inaccurate positional signals. In longer distances that exceed the range of initial training, frequency-based rotations repeat the same state at regular intervals, causing different distances to be incorrectly perceived as having the same positional relationship. This distorts the correlations between very distant tokens and hinders the model's ability to comprehensively understand long contexts. It's like completing multiple rotations and returning to the starting position, which could be misinterpreted as not having moved at all.

NoPE

Recently released open-source models Gemma 3
Gemma 3
and Exaone-4.0 share an interesting common feature: they both support a 128K context window that most previous open-source models couldn't handle. These models alternate between layers with RoPE and layers without positional embeddings, called NoPE. Gemma-3 uses a 5:1 ratio of RoPE to NoPE layers, while Exaone-4.0 uses a 3:1 ratio. According to their technical reports, removing positional encoding in certain layers improved the models' ability to generalize across global contexts.
In NoPE layers, without explicit rotational position information, the model no longer incorporates distance-based information in token interactions. Instead, it calculates Q-K similarity based solely on the semantic information of each token. This allows the model to broadly reference tokens with high semantic relevance across long distances, giving it more flexibility to reconstruct context from a global perspective without the noise caused by distance distortion. While there is a loss in directly knowing relative order, the local positional information has already been sufficiently learned by the earlier RoPE layers, allowing NoPE layers to focus on processing context with a wider perspective.
Ultimately, alternating RoPE and NoPE layers creates a multi-scale strategy where the model interprets context at different scales at each stage. While RoPE layers capture semantic relationships between relatively adjacent tokens, NoPE layers analyze relationships across the entire range, alternating between these approaches to enhance comprehensive understanding. From this perspective, implementing NoPE goes beyond the clinical finding that "removing positional rotation improves performance" to a design intention of efficiently separating and integrating contextual signals at different scales within the model. However, as context length increases, attention scores inevitably become more dispersed, gradually reducing the accuracy of handling the entire context. To address this, complementary techniques are being used, such as making the softmax probability distribution more peaked during attention score calculation to help focus on appropriate contexts.
 
 
 
 
 
Original Post
2203.16634 | Seongjin Lee
NoPE(No positional embedding): Positional encoding을 없애면, 긴 context를 더 잘 이해한다고? - Llama를 비롯하여 사실상 LLM을 위한 표준 positional encoding 방법이라고 할 수 있는 RoPE는 Q, K 벡터에 주파수별 회전을 부여함으로써 모델이 ‘상대적 거리’를 인코딩하도록 돕습니다. 이 회전 각도들은 주파수가 높을수록 짧은 거리 내 토큰 간의 미세한 순서 차이를 구분하는 데 초점을 맞추고, 주파수가 낮을수록 더 먼 거리의 토큰 사이 관계를 완만하게 반영합니다. 사람의 시간 감각에서 초/분/시/일/월/년의 여러 주기를 활용해 순간의 변화부터 장기간의 흐름까지 포괄적으로 이해하듯이, RoPE도 다양한 주파수의 회전을 통해 토큰 간 위치 관계를 다중 스케일로 캡처하는 역할을 수행합니다. - 하지만 pretraining을 상대적으로 짧은 context에서 진행한 뒤 긴 context에서 확장하여 학습시킬 때, 초기 학습 단계에서 보지 못한 거리까지 회전 패턴을 그대로 적용하면 오히려 부정확한 위치 신호가 섞이게 됩니다. 주파수별 회전이 초기 학습 시의 범위를 넘어선 거리에서는 일정 주기마다 같은 상태가 반복되면서 서로 다른 거리가 동일한 위치 관계로 잘못 인식되고, 아주 먼 토큰들 간의 상관관계를 왜곡하여 긴 context를 종합적으로 이해하는 데 방해가 될 수 있습니다. 몇 바퀴 돌았는데 제자리로 왔다고 이동하지 않은 것 처럼 받아들여질 수 있는 거죠. - 최근 공개된 기존 대부분의 오픈소스 모델이 다루지 못했던 128K context window를 지원하는 Gemma-3와 Exaone-4.0이 가지는 재미있는 공통점이 있습니다. 바로 RoPE를 적용한 레이어와, 적용하지 않은 NoPE(No Positional Embedding) 레이어를 번갈아가며 배치한 것입니다. Gemma-3는 RoPE/NoPE 5:1, Exaone-4.0은 3:1 비율로 구성되어 있는데, 두 모델의 tech report에 따르면 positional encoding을 적용하지 않은 레이어를 통해 global context에 대한 일반화 능력을 향상시킬 수 있었다고 합니다. 어떻게 이게 가능할까요? - NoPE 레이어에서는 명시적 위치 회전 정보가 없기 때문에, 모델은 더 이상 거리 기반의 정보를 토큰 간 상호작용에 포함시키지 않습니다. 대신, 각 토큰이 갖고 있는 순수한 의미 정보만으로 Q–K 유사도를 계산하게 되죠. 이렇게 되면 모델은 원거리 토큰들 간에 의미적 연관성이 높은 것들을 폭넓게 참조할 수 있고, 거리 왜곡이 주는 노이즈 없이 global 관점에서 문맥을 재구성할 여지가 늘어납니다. 비록 상대적 순서를 직접적으로 알 수 없는 손실이 있지만, 로컬한 위치 정보는 초기 RoPE 레이어들이 이미 충분히 학습해 두었기 때문에 NoPE 레이어에서는 더 넓은 시야로 맥락을 처리하는 데 집중할 수 있습니다. - 결국 RoPE와 NoPE 레이어를 교대로 배치하는 구조는 모델이 단계마다 다른 스케일로 문맥을 해석하게 하는 일종의 멀티스케일 전략으로 볼 수 있습니다. RoPE 레이어에서 상대적으로 인접한 토큰들 사이의 의미적 연관성을 포착할 때, NoPE 레이어는 전체 범위에서 연관성을 분석하고 이를 번갈아 진행하며 종합적인 이해도를 높일 수 있습니다. 이런 관점에서 보면, NoPE를 적용한 것은 단순히 ‘위치 회전을 빼서 성능이 좋아졌다’는 임상적 발견을 넘어, 서로 다른 스케일의 문맥 신호를 모델 내부에서 효율적으로 분리·통합하려는 설계적 의도로까지 확장해 볼 수 있습니다. 다만 context 길이가 길어질수록 attention score가 분산되기 때문에 필연적으로 전체 맥락을 다루는 정확도가 점점 떨어지게 되고, attention score 계산 시 softmax 확률 분포를 더 뾰족하게 만들어 적절한 맥락에 집중할 수 있게 하는 보완책 등이 사용되고 있습니다. 위치 정보를 모델이 더 잘 분석하도록 설계된 RoPE를 일부 제거하면 오히려 global context 이해도가 높아진다니, 재미있지 않나요? 관련해서 같이 보시면 좋을 것 같은 연구 결과들도 첨부합니다: - https://lnkd.in/gg9__HJQ - https://lnkd.in/ge9VVFXU - https://lnkd.in/gX3XZ--2
2203.16634 | Seongjin Lee
 
 
 

Recommendations