{"slug": "has-anyone-measured-whether-32-bit-floating-point-rounding-in-rotary-position", "title": "Has anyone measured whether 32-bit floating-point rounding in rotary position embeddings affects long-context inference?", "summary": "No published measurement yet establishes whether 32-bit floating-point rounding in rotary position embeddings (RoPE) degrades long-context inference, according to an analysis of the arithmetic. The analysis notes that most deployed stacks cap total sequence length so positions never approach 2^24, making the 16.8M-token collision theoretical, while open-ended streaming on a rolling cache with an absolute position counter is the case where rounding could surface sooner, at the top of the frequency range where one fp32 step at a million tokens is about an eighth of a radian. The proposed test holds everything constant except angle arithmetic: compute position × frequency in float64, cast cosines and sines back to fp32, and compare needle retrieval and perplexity against position on the same model and prompts.", "body_md": "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.", "url": "https://wpnews.pro/news/has-anyone-measured-whether-32-bit-floating-point-rounding-in-rotary-position", "canonical_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_at": "2026-11-25 19:12:44+00:00", "updated_at": "2026-11-25 19:16:42.659653+00:00", "lang": "en", "topics": ["large-language-models", "ai-research", "machine-learning"], "entities": ["RoPE"], "also_reported_by": [], "takeaway": "Isolate RoPE angle rounding by computing position × frequency in float64 and casting cosines and sines back to fp32, then compare needle retrieval and perplexity against position on the same model and prompts; a gap that widens with position is the rounding, and coinciding curves mean fp32 angles ar", "recommendation": {"advice": "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.", "playbook": "evals-testing", "playbook_url": "https://wpnews.pro/playbooks/evals-testing"}, "alternates": {"html": "https://wpnews.pro/news/has-anyone-measured-whether-32-bit-floating-point-rounding-in-rotary-position", "markdown": "https://wpnews.pro/news/has-anyone-measured-whether-32-bit-floating-point-rounding-in-rotary-position.md", "text": "https://wpnews.pro/news/has-anyone-measured-whether-32-bit-floating-point-rounding-in-rotary-position.txt", "jsonld": "https://wpnews.pro/news/has-anyone-measured-whether-32-bit-floating-point-rounding-in-rotary-position.jsonld"}}