[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"news-slug-snowballcost-ultra-long-response-inference-cost":3,"topics-all":38,"news-related-42df02c9-abab-4f41-97e6-a515358cb3d7":67},{"id":4,"title":5,"summary":6,"content":7,"original_url":8,"source_id":9,"tags":10,"translations":24,"news_slug":31,"published_at":32,"created_at":33,"modified_at":34,"is_published":35,"publish_type":36,"image_url":14,"view_count":37},"42df02c9-abab-4f41-97e6-a515358cb3d7","长回复的解码耗时超出线性估算 1.67 到 1.80 倍","论文在 vLLM、SGLang 和 HuggingFace 上测量超长回复给推理服务的成本:输出 1M token 的请求,解码时间是线性估算的 1.67 到 1.80 倍。论文给出带物理系数的成本模型,推出两个阈值:线性估算失效的长度,和单条请求不再盈利的长度。超长回复几乎不影响普通用户,成本全落在服务商一侧。","长上下文是过去两年大模型的主战场,128K、256K、1M,窗口越开越大。但另一半被忽略掉了——输出。GPT-6.2 Astra 和 Claude Opus 5 都允许单次请求输出 128K token,Claude Batches API 给到 300K。输出越长,服务商的机器要被占住多久,账单才不亏?论文说,超长回复给推理服务带来的成本仍缺乏系统研究。\n\n论文 SnowballCost 做了一次系统测量:把正常请求和超长回复的请求混在同一台推理服务器上跑,量出后者对延迟、吞吐和盈亏的影响。作者来自新加坡国立大学和清华大学,论文被 Findings of EACL 2027 接收,论文把超长回复的请求叫大象请求。\n\n## 二次项从哪来\n\n自回归解码每生成一个 token,都要重读一遍模型权重和已攒下的 KV cache。输出越长,每步要扫的 KV 越多,总解码时间就超线性了。\n\n论文写成闭式:T_decode = c·L_out + b·(L_in·L_out) + d·L_out²。c 是权重读带宽项,b 是输入输出交叉项,d 是 KV cache 二次项。真实聊天提示普遍很短,b 项影响不到 0.5%,论文直接把它丢掉了。关键在 L* = c\u002Fd,二次项等于一次项的长度;超过它,按短输出拟合的线性估算就开始低估。\n\n## 线性估算在哪儿崩\n\n标定用 Qwen2.5-7B-1M 跑在 4 张 A800 的 vLLM 上,9 个长度取 11 个观测点,拟合出 c = 5.70e-3 秒\u002Ftoken、d = 5.65e-9 秒\u002Ftoken²,R² = 0.999999,L* = 1.01M。\n\n论文报告的偏差:输出 128K 时,耗时是短输出线性拟合的 1.24 倍(vLLM)和 1.22 倍(SGLang);到 1M,变成 1.80 倍和 1.67 倍。二次项在解码时间里的占比,5K 输出时只有 0.5%,131K 时 12%,524K 时 34%,1M 时 50%(SGLang 是 47%)。\n\n同一组测量里,四种预测器误差差别很直接:线性模型在 1M 处低估 39.7%,Vidur 风格的随机森林低估 51.7%(补两个标定点也还是低估 35.2%,它预测不了超出训练长度的部分),论文这个带物理系数的模型在 1M 处误差 4.3%,SGLang 上 0.2%。\n\n## 同一个模型,换个引擎差很多\n\n更值得注意的是阈值对引擎多敏感。同样是 72B 模型、同样 4 张 A800:HF Transformers 的 eager 模式下 L* = 29K,Flash-Attention 2 是 247K,SGLang 是 1.26M,vLLM 是 1.08M。原因是 HF eager 直接暴露原始的 O(l²) 注意力代价;FA2 减少的是往 HBM 搬数据的流量,没减少算术量,二次项在超长区间又长回来。而 HF eager 那一行 L_max\u002FL* = 4.5,意味着在正常输出长度区间里线性估算就已经开始低估——这正是现有服务系统按短输出标定再外推的隐患。\n\n好在模型能换引擎用。论文报告:一张 A800 标定的系数预测一张 A100,在 262K 处误差 1.5%,预测 H800 在 8K 到 131K 误差 4.7%;只有二次项系数 d 严格跟 1\u002FG 走,1 张到 4 张 A800 的 d 预测误差 11.3%。跨模型时,五套 vLLM 部署的 KV 读取带宽利用率在 0.63 到 0.72 之间,任意一套标定预测其他部署误差在 13% 内。\n\n## 普通用户其实没被影响\n\n共享服务下,最容易被猜错的结论是「超长回复会拖慢所有人」。论文的测量不是这样。\n\nvLLM 上跑 1 个请求\u002F秒的 Poisson 到达,900 秒来了 901 个请求,其中 9 个是大象请求。普通请求的端到端中位延迟,有超长请求时 11.7 秒,没有时 11.3 秒。突发到达下,普通请求首字延迟达标率从 30.0% 变成 29.9%,端到端 60 秒达标率从 53.2% 变成 51.9%。大象自己的端到端中位延迟是 8541 秒。\n\n大象比例从 0 扫到 5%(0 到 46 个大象),普通请求的首字延迟中位数始终在 8.6 到 12.5 秒之间,没跟着大象比例走的趋势,单 token 解码时间变化幅度在 2.5% 以内。原因很简单:普通请求在早期高并发阶段就结束,那时大象的 KV cache 还没涨起来。\n\n## 被拖垮的是服务商的账本\n\n代价几乎全落在提供方这一侧。大象之间互相拖累:0.5% 那一档里,6 个大象就占掉 62% 的 KV cache,每个耗时是 0.1% 档的 1.75 倍;1% 那一档里 11 个大象的 KV cache 直接超出容量,比值到 2.98 倍,同样 78K 输出,1% 档一个大象耗时是 0.1% 档的 2.24 倍。\n\n节点占用更直观。Poisson 那档,普通请求跑完是 913 秒,之后 9 个大象还要再解码 8700 秒;这期间节点产出从每秒 440 个输出 token 掉到 130 个。突发那一档,普通请求 105 秒跑完,节点本来每秒产 3700 个 token,之后剩下 11 个大象每秒只能产 130 个。论文的说法是,1% 的请求带超长回复,能让节点比它们到达时那批普通流量多忙约 100 倍。\n\n然后是盈亏。按 token 收费意味着收入随输出长度线性增长,而成本随响应长度超线性增长,过了某个长度,单条请求就亏本。成本模型给出了这个长度 L_loss = (r_tok\u002Fκ_node − c)\u002Fd。批处理能摊薄一次项 c,但每个流还是要读自己的 KV cache,即使并发无限上限也只能放松到正比于 r_tok\u002F(κ_node·d)。加机器也救不了:设备数上去,κ_node 按 G 涨、d 按 1\u002FG 降,但被减掉的 c\u002Fd 在涨,L_loss 反而更小。\n\n## 边界和旁边的路\n\n论文自己列的限制:实验都在单机多卡服务器上,跨节点通信、跨节点流水并行、全局负载均衡这些集群效应没测;调度和准入控制策略也没设计。\n\n模型侧确实有在动这条二次项。DeepSeek-V4 的混合注意力(CSA 加 HCA)在 100 万 token 上下文下,单 token 推理 FLOPs 只要 DeepSeek-V3.2 的 27%,KV cache 只要 10%——把 KV 压下去,二次项也跟着降。Qwen2.5-1M 用稀疏注意力加 chunked prefill,在 100 万 token 上下文下 prefill 有 3 倍到 7 倍提速,不过那治的是 prefill;decode 那侧另有 FastServe 那种按输出 token 粒度抢占调度的路线。\n\n所以呢:长输出的成本问题不在「模型能不能写那么长」,而在「服务商用什么价接这个活」。按 token 线性定价遇上超线性成本,亏的不是算力,是定价模型。论文给了两个能直接用的数:L* 告诉你线性估算在哪失效,L_loss 告诉你一条请求从哪开始不值钱。谁在按 token 卖长输出,谁就得重看这条曲线。\n\n论文见 [arXiv:2611.37527](https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.37527)。","https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.37527","7437aeb9-930c-4866-a2e9-48003c1a792b",[11,15,18,21],{"id":12,"name":13,"slug":13,"description":14,"color":14},"fca9258a-9430-455a-b95d-b9fae5e373a8","ai-inference",null,{"id":16,"name":17,"slug":17,"description":14,"color":14},"120fa59a-ff6f-4537-9bf5-f818df636a0e","benchmark",{"id":19,"name":20,"slug":20,"description":14,"color":14},"0ef8513a-0a26-42f0-b6f9-5b6dadded45c","efficiency",{"id":22,"name":23,"slug":23,"description":14,"color":14},"01598627-1ea6-4b27-a5d8-874971571a71","llm",[25],{"id":26,"lang":27,"title":28,"summary":29,"content":30},"cab92ffb-6041-474b-a4b5-c272c1bb738f","en","At 1M tokens, decode time runs 1.67x to 1.80x linear","A 1M-token reply decodes 1.67x to 1.80x linear. The paper's cost model gives two thresholds: where estimates fail, and where requests stop paying off.","Long context is where frontier LLMs have fought the last two years: 128K, 256K, 1M, the window keeps widening. But the other half gets ignored, and that is output. GPT-6.2 Astra and Claude Opus 5 both allow 128K output tokens per request, and the Claude Batches API goes to 300K. How long does a provider's machine have to sit on that response before the bill stops making sense? The paper says the cost that ultra-long responses impose on inference services still lacks systematic study.\n\nSnowballCost is that measurement. It mixes normal requests with ultra-long-response requests on one inference server and quantifies what the latter does to latency, throughput and profit. The authors are from the National University of Singapore and Tsinghua University, the paper is accepted to Findings of EACL 2027, and it calls ultra-long-response requests elephant requests.\n\n## Where the quadratic term comes from\n\nEvery token of autoregressive decoding re-reads the model weights and the KV cache accumulated so far. The longer the output, the more KV each step has to scan, and summing those steps makes total decode time super-linear.\n\nThe paper writes it as a closed form: T_decode = c·L_out + b·(L_in·L_out) + d·L_out². The coefficient c is the linear term set by weight-read bandwidth, b is the input-output cross term, and d is the quadratic term from the accumulating KV cache. Real chat prompts are short enough that b contributes under 0.5%, so the paper drops it. The key quantity is L* = c\u002Fd, where the quadratic term equals the linear term; past it, a linear estimate fitted on short outputs starts underpredicting.\n\n## Where the linear estimate breaks\n\nCalibration used Qwen2.5-7B-1M on vLLM with 4 A800s, 11 observations at 9 lengths, fitting c = 5.70e-3 s\u002Ftoken and d = 5.65e-9 s\u002Ftoken² with R² = 0.999999, giving L* = 1.01M.\n\nThe reported deviation: at 128K output, measured time is 1.24x the short-output linear fit on vLLM and 1.22x on SGLang; at 1M, 1.80x and 1.67x. The quadratic term's share of total decode time is only 0.5% at 5K output, 12% at 131K, 34% at 524K, and 50% at 1M (47% on SGLang).\n\nThe gap between predictors in the same measurement set is stark: the linear model underestimates by 39.7% at 1M, a Vidur-style random forest underestimates by 51.7% (still 35.2% low even after adding two calibration points, because it cannot predict beyond its longest training length), while this paper's physically-coefficient model is within 4.3% at 1M on vLLM and 0.2% on SGLang.\n\n## Same model, different engine, very different threshold\n\nWhat matters more is how sensitive the threshold is to the engine. On the same 72B model with the same 4 A800s: HF Transformers in eager mode gives L* = 29K, Flash-Attention 2 gives 247K, SGLang gives 1.26M, and vLLM gives 1.08M. The reason is that HF eager exposes the raw O(l²) attention cost; FA2 reduces the traffic moved to HBM without reducing the arithmetic, so quadratic growth reappears at ultra-long lengths. For the HF eager row, L_max\u002FL* = 4.5, meaning linear estimates already underpredict within normal output lengths, which is roughly the hazard of calibrating on short outputs and extrapolating.\n\nGood news is that the model can change engines. The paper reports that coefficients calibrated on one A800 predict one A100 to within 1.5% at 262K and an H800 to within 4.7% between 8K and 131K; only the quadratic coefficient d follows 1\u002FG strictly, with d predicted within 11.3% going from one A800 to four. Across models, KV-read bandwidth utilisation on five vLLM deployments ranges from 0.63 to 0.72, and calibrating on any one of them predicts the others within 13%.\n\n## Ordinary users are actually not affected\n\nIn shared serving, the easiest wrong guess is that ultra-long responses slow everyone down. The measurement says otherwise.\n\nOn vLLM with a Poisson arrival of 1 request\u002Fsecond, 901 requests arrived over 900 seconds, 9 of them elephants. Median end-to-end latency for normal requests was 11.7 seconds with the ultra-long requests present and 11.3 seconds without them. Under burst arrival, the normal-request TTFT SLO pass rate moved from 30.0% to 29.9% and the 60-second end-to-end pass rate from 53.2% to 51.9%. The elephants' own median end-to-end latency was 8541 seconds.\n\nSweeping the elephant fraction from 0 to 5% (0 to 46 elephants), the median TTFT for normal requests stayed between 8.6 and 12.5 seconds with no trend following the elephant fraction, and per-token decode time varied within 2.5%. The reason is simple: normal requests finish during the early high-concurrency phase, before the elephants' KV cache has grown.\n\n## What gets wrecked is the provider's books\n\nAlmost all of the cost lands on the provider side.\n\nElephants drag on each other: in the 0.5% cell, 6 elephants fill 62% of the KV cache and each takes 1.75x its time in the 0.1% cell; in the 1% cell, 11 elephants exceed the KV cache entirely and the ratio reaches 2.98x, with an elephant at 78K output in the 1% cell taking 2.24x as long as one in the 0.1% cell.\n\nNode occupancy is even more direct. In the Poisson cell, normal requests finish at 913 seconds and 9 elephants then decode for another 8700 seconds; over that period node output drops from 440 output tokens per second to 130. In the burst cell, normal requests finish at 105 seconds with the node producing 3700 tokens per second, after which the 11 remaining elephants produce only 130 per second. The paper's phrasing is that 1% of requests with ultra-long responses keep the node busy about 100 times as long as the normal traffic they arrive with.\n\nThen there is profit. Charging per token means revenue grows linearly with output length while cost grows super-linearly with response length, so beyond some length a single request stops paying for itself. The cost model gives that length as L_loss = (r_tok\u002Fκ_node − c)\u002Fd. Batching amortises the linear term c, but each stream still reads its own KV cache, so even unbounded concurrency only relaxes the ceiling to something proportional to r_tok\u002F(κ_node·d). Adding hardware does not rescue it either: as device count rises, κ_node grows with G and d falls with 1\u002FG, but the subtracted c\u002Fd grows, so L_loss gets smaller.\n\n## Limits and neighbouring roads\n\nThe paper's own stated limits: all experiments run on single-node multi-GPU servers, so cluster-level effects such as inter-node communication, cross-node pipeline parallelism and global load balancing are not measured; scheduling and admission-control policies were neither designed nor evaluated.\n\nThe model side is clearly working on this quadratic term. DeepSeek-V4's hybrid attention (CSA plus HCA) needs only 27% of DeepSeek-V3.2's single-token inference FLOPs and 10% of its KV cache in a 1-million-token context, so shrinking the KV shrinks the quadratic term too. Qwen2.5-1M uses sparse attention plus chunked prefill for a 3x to 7x prefill speedup at 1-million-token context, but that treats prefill; on the decode side there is FastServe's route of preemption scheduling at output-token granularity. Another line is purely economic: Erdil's paper turns the trade-off between cost per token and serial speed into a Pareto frontier.\n\nSo where does this leave us: the cost problem of long output is not about whether models can write that long, but about what price a provider attaches to the job. Linear per-token pricing meeting super-linear cost does not lose you compute, it loses you your pricing model. The paper hands you two usable numbers: L* tells you where the linear estimate fails, L_loss tells you where a request stops paying for itself. Anyone selling long output by the token has to look at that curve again.\n\nThe paper is at [arXiv:2611.37527](https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.37527).","snowballcost-ultra-long-response-inference-cost","2026-12-01T01:00:00Z","2026-12-01T01:30:57.769915Z","2026-12-01T01:30:57.769941Z",true,"agent",80,[39,49,58],{"slug":40,"tag_slug":41,"title_zh":42,"title_en":43,"intro_zh":44,"intro_en":45,"id":46,"is_active":35,"created_at":47,"modified_at":48},"image-generation","text-to-image","图像生成：从文生图到逐框编辑的模型竞赛","Image Generation: from text-to-image to frame-level editing","文生图已是红海，战场正转向编辑与可控性：FLUX.2\u002F3 用开源和量化把生图搬进消费级显卡，Qwen-Image、Seedream 等国产模型紧咬不放，GPT Image 2 则把推理能力带进像素。本专题追踪图像生成与编辑模型的发布、架构演进、加速量化与商业化数据，看「好图」如何变成「可用的图」。","Text-to-image is a crowded race, and the frontier has moved to editing and control: FLUX.2\u002F3 push open weights and quantization onto consumer GPUs, Qwen-Image and Seedream close in from China, and GPT Image 2 brings reasoning into pixels. This topic tracks model releases, architecture shifts, acceleration work, and the business numbers behind \"pretty\" becoming \"usable\".","52de7c59-7864-4569-8ae7-3d656d26a1a1","2026-11-20T07:20:23.534506Z","2026-11-20T07:20:23.534527Z",{"slug":50,"tag_slug":50,"title_zh":51,"title_en":52,"intro_zh":53,"intro_en":54,"id":55,"is_active":35,"created_at":56,"modified_at":57},"ai-for-science","AI for Science 2026：从 UniPert 到 GPT-Rosalind 的硬核进化","AI for Science 2026: from UniPert to GPT-Rosalind","生命科学、化学材料、物理世界模型——AI 正在从\"语言工具\"变成\"实验伙伴\"。本专题收录 AI 在三大科学方向的关键节点：UniPert 统一基因与化学扰动空间、GPT-Rosalind 端到端生命科学推理、达摩院 AI 智能体 28 小时找到 4 种超导新材料、Anthropic Claude Science 把工作台做成标准品。","From language tool to lab partner — AI is reshaping life sciences, chemistry\u002Fmaterials, and physical world models. This topic covers the key milestones: UniPert unifying genetic-chemical perturbation spaces, GPT-Rosalind's end-to-end life-sciences reasoning, DAMO's AI agent discovering 4 superconducting materials in 28 hours, and Anthropic's Claude Science workbench going mainstream.","988a4300-5fab-41c4-b5d8-63711a2dc757","2026-09-10T01:34:15.296649Z","2026-09-10T01:34:15.296663Z",{"slug":59,"tag_slug":59,"title_zh":60,"title_en":61,"intro_zh":62,"intro_en":63,"id":64,"is_active":35,"created_at":65,"modified_at":66},"h3-series","MiniMax H3 系列：从开源权重到 35 倍吞吐","MiniMax H3 Series: from open weights to 35x throughput","MiniMax H3 自 2026 年 8 月开源以来节奏密集：官方把生成、参考与编辑收回一个模型；ComfyUI 当天压进 RTX 3060；摩尔线程 3 小时完成国产 GPU 适配；fal 后训练版把吞吐拉到 35 倍；FastH3 蒸馏再砍推理成本。本专题持续追踪 H3 的发布—开源—蒸馏—部署全链路。","Since MiniMax open-sourced H3 in August 2026 the pace has been relentless: one unified omni-modal model, same-day ComfyUI support down to an RTX 3060, a 3-hour Day-0 port to Moore Threads GPUs, fal's post-trained H3 Max at 35x throughput, and FastH3 distillation cutting inference cost further. This topic tracks the full H3 chain — release, open weights, distillation, deployment.","83ef0daa-3c31-4cb3-86ed-e5ee58654d5f","2026-09-08T07:33:19.942193Z","2026-09-08T07:33:19.942209Z",{"items":68},[69,74,79,84,89,94],{"id":70,"title":71,"news_slug":72,"published_at":73},"43a0972c-f040-483c-88cd-89b40a22723d","RA-RFT：检索增强强化微调，让 LLM 学会「类比推理」而非「按字找参考」","ra-rft-retrieval-augmented-analogical-rl","2026-06-12T18:30:00+00:00",{"id":75,"title":76,"news_slug":77,"published_at":78},"6bed3f6a-042d-4f85-9a05-fcbd39b5447e","查表模块每加一个参数,只换到 0.31 个主干参数","chorus-lookup-table-backbone-replacement-ratio","2026-11-28T13:30:00+00:00",{"id":80,"title":81,"news_slug":82,"published_at":83},"71409616-c416-4983-ae5d-a001c35fbdb3","一个存档,2到8比特随手切,还能走半档","any-rate-half-bit-multi-precision-quantization","2026-11-28T01:00:00+00:00",{"id":85,"title":86,"news_slug":87,"published_at":88},"90637c7b-61d1-4aa0-a50e-033afbab0d26","140个权重止住0.8B模型的思考死循环","tiny-gradient-edits-stop-thinking-loops","2026-11-25T17:30:00+00:00",{"id":90,"title":91,"news_slug":92,"published_at":93},"c6a45e34-7269-43c8-8382-eab30cbb0373","LoRA热更新不必重放历史,论文称提速68.98倍","livelora-kv-cache-migration","2026-11-24T13:30:00+00:00",{"id":95,"title":96,"news_slug":97,"published_at":98},"c4623b85-37f5-435e-ae98-e67eb72eb1dc","别再逐篇问大模型:AI写程序当评委,每主题0.17美元起","execjudges-llm-written-program-judges-retrieval-eval","2026-11-20T01:40:00+00:00"]