NumPy allowed · plain Python earns 10 bonus points
Cosine-like similarity scores ranked before context assembly
Implement Rotary Position Embeddings (RoPE) to inject relative position information into attention query and key vectors.
Implement rope(x, position, base=10000.0). Rotate consecutive 2D pairs (x[2i], x[2i+1]) by angle theta_i = position * base^(-2i / d).
rope(x: list[float], position: int, base: float = 10000.0) -> list[float]