rope_rotate — LLMCORE prepare op

• Data kinds: tokens → tokens

• Call: import fullseye as fs; fs.ledger.rope_rotate(tokens, positions=None, base: 'float' = 10000.0) -> 'np.ndarray' (to call the implementation directly, import llmcore; llmcore.rope_rotate(tokens, positions=None, base: 'float' = 10000.0) -> 'np.ndarray'; from the registry, opsllmcore.get("rope_rotate"))

Usage

> This operator's description has not been translated yet. The original text follows as it is.

回転による位置符号(RoPE)→ tokens。回転なのでノルムを保つ。

Su ら 2021。偶奇の対 (x₂ᵢ, x₂ᵢ₊₁) を角度 `pos · base**(−2i/d)` だけ回す。

平面回転の直和なので `‖RoPE(x)‖ == ‖x‖` が厳密に成り立ち(実測 8.9e-16)、

しかも回した 2 本の内積は位置の差だけで決まる(絶対位置を 40 通り動かして幅 8.9e-15)

—— 「相対位置を内積に埋める」という主張が、そのまま検算になる。

Args:

tokens: (T, d) float。d は偶数(対にして回すため)。

positions: (T,) の位置。None なら 0..T−1。飛び飛びの位置(切り出した窓)も渡せる。

base: 角度の底。大きいほど低い軸がゆっくり回る(長い文脈向け)。

Returns:

tokens (T, d) float: 対ごとに回したもの。行ごとのノルムは入力と同じ。

Detailed usage guide

• llmcore family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_attention_identities — py -3.11 examples/poc_attention_identities.py

Ops the type connects to (they accept tokens as input)

rms_norm · attention_scores · attention_apply · attention_softmax · attention_tiled · attention_linear · attention_grouped · kv_cache_decode

Same category (prepare)

rms_norm


*Provenance: llmcore.py — LLMCORE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.