# Has anyone measured whether 32-bit floating-point rounding in rotary position embeddings affects long-context inference?

> Source: <https://discuss.huggingface.co/t/has-anyone-measured-whether-32-bit-floating-point-rounding-in-rotary-position-embeddings-affects-long-context-inference/192564#post_2>
> Published: 2026-11-25 19:12:44+00:00

**Recommendation:** To test whether fp32 RoPE angles hurt long context, change only the angle arithmetic to float64 and cast cos/sin back to fp32, then compare needle retrieval and perplexity against position on identical prompts.
More in the playbook "Evals and testing for LLM apps": <https://wpnews.pro/playbooks/evals-testing>

The 16.8M collision is real arithmetic, but in most deployed stacks it could stay theoretical: servers cap total sequence length (prompt plus generation), so the position that reaches RoPE never gets near 2^24, whatever the window does. The exception worth watching is open-ended streaming on a rolling cache, where the position counter is absolute and keeps climbing while the window slides — there the cap is the stream’s lifetime, not the context size. The rounding that can matter sooner sits in the product, and only at the top of the frequency range: the fastest pair’s angle is roughly the position itself, so at a million tokens one fp32 step in that angle is about an eighth of a radian, while the slowest pairs’ angles are so small their rounding is unmeasurable. The clean comparison is to change nothing but the angle arithmetic — compute position × frequency in float64, cast the cosines and sines back to fp32, and run needle retrieval and perplexity against position on the same model and prompts: if the curves coincide, fp32 angles are not the long-context problem, and any gap that widens with position is the rounding, isolated from everything else.
