{"slug": "base-2-vs-base-e-log-sum-exp-mismatch-silently-corrupts-attention-in-sglang", "title": "Base-2 vs. base-e log-sum-exp mismatch silently corrupts attention in SGLang", "summary": "A base-2 vs. base-e log-sum-exp mismatch in SGLang's merge v2 API silently corrupts attention outputs for models using MLA with the FlashInfer backend when radix cache hits exceed 8k, affecting DeepSeek V2/V3/R1/V3.1/V3.2, bailing, glm4moe_lite, and Sarvam. The issue arises because the merge operation assumes natural logs, but FlashInfer uses base-2 logs, leading to incorrect outputs. A fix has been proposed in a FlashInfer pull request.", "body_md": "If you serve models with mla on sglang with --attention-backend flashinfer and you get radix cache hits above 8k your outputs are wrong right now.\nDeepSeek V2/V3/R1/V3.1/V3.2, bailing, glm4moe_lite, Sarvam affected.\nFix:\n\n# Konstantin on X: \"If you serve models with mla on sglang with --attention-backend flashinfer and you get radix cache hits above 8k your outputs are wrong right now. DeepSeek V2/V3/R1/V3.1/V3.2, bailing, glm4moe_lite, Sarvam affected. Fix: https://t.co/IRxPRx9Ojf\"\n\n- flashinfer api proposal for clarity:\n[github.com/flashinfer-ai/…](https://github.com/flashinfer-ai/flashinfer/pull/4547)some context: there is merge v2 api in sglang and it does: S = log(exp(s_a) + exp(s_b)) v = v_a·exp(s_a − S) + v_b·exp(s_b − S) which is true if and only if s_a and s_b are natural logs. but this is not true for", "url": "https://wpnews.pro/news/base-2-vs-base-e-log-sum-exp-mismatch-silently-corrupts-attention-in-sglang", "canonical_source": "https://twitter.com/advprop/status/2089046843690729620", "published_at": "2026-08-16 17:52:11+00:00", "updated_at": "2026-08-16 18:10:52.246156+00:00", "lang": "en", "topics": ["machine-learning", "large-language-models", "ai-infrastructure", "ai-tools"], "entities": ["SGLang", "FlashInfer", "DeepSeek V2", "DeepSeek V3", "DeepSeek R1", "DeepSeek V3.1", "DeepSeek V3.2", "Konstantin"], "alternates": {"html": "https://wpnews.pro/news/base-2-vs-base-e-log-sum-exp-mismatch-silently-corrupts-attention-in-sglang", "markdown": "https://wpnews.pro/news/base-2-vs-base-e-log-sum-exp-mismatch-silently-corrupts-attention-in-sglang.md", "text": "https://wpnews.pro/news/base-2-vs-base-e-log-sum-exp-mismatch-silently-corrupts-attention-in-sglang.txt", "jsonld": "https://wpnews.pro/news/base-2-vs-base-e-log-sum-exp-mismatch-silently-corrupts-attention-in-sglang.jsonld"}}