[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"news-slug-prefix-lm-width-adaptive-inference":3,"topics-all":38,"news-related-a4010995-73d6-4f91-8357-b9ef537bf2bd":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},"a4010995-73d6-4f91-8357-b9ef537bf2bd","前缀不变性:小模型算过的,大模型不用重算","每个 token 难度不同,早停沿深度省算力,宽度弹性模型却因加宽改写旧激活而无法复用计算。论文提出 Prefix-LM,用块三角映射强制前缀不变性,子模型中间表示与 KV 缓存是大模型的精确前缀,一次前向训完全部子模型;1B 规模级联推理墙钟加速,masking 以 70.2% 的 FLOPs 匹配固定宽度质量。","自回归生成里隐藏着不公平:模型给每个 token 分配的算力一模一样。「the」这种几乎白送的下一个词,和一段推理的关键一步,在标准 Transformer 里开销相同。早停方法(CALM、LayerSkip)沿深度轴解决这个问题——简单 token 提前退出、少算几层(https:\u002F\u002Farxiv.org\u002Fabs\u002F2207.07061);宽度方向的弹性模型(slimmable、MatFormer)则砍通道数。但宽度这条路一直有个绕不过去的坑:把模型加宽,小模型已经算好的中间激活就被改写,之前的计算等于作废。刚挂上 arXiv 的 Prefix-LM(论文:https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.41819)给出的是一个结构性答案。\n\n## 加宽为什么会推翻旧账\n\n论文先把「参数嵌套」和「表示嵌套」分开。都灵理工、威斯康星大学麦迪逊分校、MBZUAI 与 Amazon Science 的九人团队指出:slimmable 网络里,新增的通道会改动已有激活,进而改变后面每层的输入;MatFormer 在草稿模型与验证模型之间共享缓存上下文,但验证阶段仍要重算草稿 token 的表示并替换缓存状态(https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.07707);Matryoshka 嵌入只保证最终向量的前缀独立可用,不要求逐层一致。换句话说,共享权重不等于可复用计算——切换预算时旧账能不能保住,取决于结构,不取决于训练技巧。\n\n论文的验证很直接:在 CIFAR-100 上用 ResNet-20 做对照,给 slimmable 的训练目标加上前缀匹配的 ℓ2 惩罚(这正是 Prefix-LM 靠构造免费得到的东西),预测不一致度和逐层前缀偏差仍然显著——加宽引入的误差会逐层累积,训练目标救不了结构问题。\n\n## 缺的性质叫前缀不变性\n\n作者把它命名为 prefix invariance:在每一层,小模型的中间表示是大模型的精确前缀。论文证明这等价于一个形式很简单的条件——块三角映射:输出的前 d 个坐标只依赖输入的前 d 个坐标,且这是充要条件;该性质在复合、对齐残差加法、逐元素非线性下都保持,所以整网端到端成立。\n\n落到 Transformer 组件上:线性映射和 FFN 投影按块三角置零;归一化改成层级式,每个块的统计量只在累积特征维度上计算;多头注意力把头分组建组,加宽只激活新组,旧头的查询、键、值和注意力权重原封不动;词表 logits 做成累积式——上一档的输出加一个增量项就是下一档,省掉了级联到更大子模型时重复乘大词表的开销,这在早停方法里正是那些没退出的头的典型负担。KV 缓存因此可以跨子模型逐层逐头共享:backfilling 精确补算缺失块且可并行、不用重新 prefill;masking 让新激活的头只对有条目的 token 做注意力;copying 和 imputing 则是避开补算的近似。\n\n理论侧还有一个结果:线性情形下,这个架构类在任意深度和宽度下同时包含截断 SVD 的最优解,块三角约束在最简单的世界里零代价。但论文自己写明,非线性情形不能指望同时最优,「后面的块永远不改前面的计算」只是结构性保证。\n\n## 训练:一次前向,全家族毕业\n\n前缀不变性带来一个副产品:一次全宽前向就能读出所有嵌套子模型的 logits,K 个预算的损失共享同一张计算图、单次反传一起优化——这与 slimmable 每步采样子模型的训练方式形成对照。监督用层级自蒸馏(HSD):每个子模型从紧邻的上一档蒸馏,而不是从全模型;教师与学生只差一个精化块,随机梯度的方差更小。GPT-2 消融里,全模型损失 3.461(HSD)对 3.494(标准 KD),训练吞吐还高 7%、峰值内存低 15%。梯度归一化(MNG)这条论文也做了,但作者坦承 AdamW 会抵消它的大部分作用,只在 SGD 一类优化器下明显。\n\n## 1B 规模的账本\n\n推理机制:每个 token 从最小宽度起步,一个小 MLP 路由器估计当前档与全模型预测分布的 KL 差异,低于阈值就接受、否则加一档,模型本体在路由器训练期间保持冻结。主实验覆盖 Llama 3.2-1B、Nemotron-Flash-1B、Qwen 3.5-2B 三种架构(Llama 侧嵌套宽度用 3、6、8 个头,总共 8 个注意力\u002FKV 头),Llama 版有效参数 916.5M,参数量匹配的 dense 对照是 918.9M。A100 上 batch-1 解码测得:固定全宽时,Prefix-LM 比参数匹配的 dense 慢 6.85%,这是三角结构的硬件税;但同尺寸的随机稀疏模型比它自己的 dense 版慢 40%,说明块三角的稀疏模式对 GPU 友好,而级联推理把省下的算力变现成了墙钟加速。生成质量用 MT-Bench 首轮加 LLM 裁判代理:masking 策略只需固定宽度 medium 模型 70.2% 的 FLOPs 就能匹配其质量,折合 1.42 倍 FLOPs 加速。同一 FLOP 预算下,级联的下游任务精度高于 CALM 和 LayerSkip 两个深度轴对照;论文同时标注 CALM 的峰值分数更高,优势只在同等精度下更省计算。代价也有明确数字:三角连接让 held-out 交叉熵高约 5%,与独立训练模型的差距约 60% 来自架构、40% 来自参数量。\n\n## 所以呢\n\n这篇论文做的,在我看来是把「按难度分配算力」从路由问题还原成了表示问题。此前没有前缀不变性的方法里,共享头在不同宽度下产生不同的键和值,切换宽度就得重建或近似上下文;Prefix-LM 指出旧账作废不是必然,是结构选择——换成块三角之后,级联、路由、KV 复用全部顺理成章。5% 的交叉熵代价值不值,取决于你的推理账单有多痛。当每个 token 的算力成本开始决定产品生死,可复用的计算会不会比更大的模型更值钱?","https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.41819","7437aeb9-930c-4866-a2e9-48003c1a792b",[11,15,18,21],{"id":12,"name":13,"slug":13,"description":14,"color":14},"0ef8513a-0a26-42f0-b6f9-5b6dadded45c","efficiency",null,{"id":16,"name":17,"slug":17,"description":14,"color":14},"0a93ec8e-ea39-4693-81de-563ca8c173f7","inference",{"id":19,"name":20,"slug":20,"description":14,"color":14},"01598627-1ea6-4b27-a5d8-874971571a71","llm",{"id":22,"name":23,"slug":23,"description":14,"color":14},"4f214978-cac1-4f39-aa4b-f92a0d0934b7","transformer",[25],{"id":26,"lang":27,"title":28,"summary":29,"content":30},"f493a67b-086a-4539-a2c1-2e907b48bf50","en","Prefix Invariance: Reusing Compute Across Model Widths","Widening rewrites activations, wasting work. The paper's Prefix-LM makes submodel states and KV caches exact prefixes; 1B cascading decodes faster.","Autoregressive generation hides an inequality: the model spends the same compute on every token. A nearly free next word like 'the' and the pivotal step of a long derivation cost the same inside a standard Transformer. Early-exit methods (CALM, LayerSkip) attack this along depth — easy tokens leave early and skip layers (https:\u002F\u002Farxiv.org\u002Fabs\u002F2207.07061); width-elastic models (slimmable networks, MatFormer) cut channels instead. But the width route has a flaw nobody bypassed: widen the model and the activations the smaller model already computed get rewritten, so earlier work is wasted. Prefix-LM, just posted to arXiv (paper: https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.41819), offers a structural answer.\n\n## Why widening tears up the ledger\n\nThe paper first separates parameter nesting from representation nesting. The nine-author team from Polytechnic Institute of Turin, the University of Wisconsin-Madison, MBZUAI, and Amazon Science point out that in slimmable networks additional channels alter existing activations and therefore the inputs of every later layer; MatFormer shares cached context between a narrower drafter and a wider verifier, but verification still recomputes the draft tokens' representations and replaces their cached states (https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.07707); Matryoshka embeddings only make the final vector prefix independently useful, with no per-layer agreement. Sharing weights, in other words, is not the same as reusing computation — whether old work survives a budget switch is decided by structure, not by training tricks.\n\nThe authors check this directly: on CIFAR-100 with ResNet-20, adding a prefix-matching penalty to the slimmable objective (exactly what Prefix-LM gets for free by construction) still leaves significant prediction disagreement and layerwise prefix discrepancy — widening errors accumulate across layers, and a training loss cannot fix a structural problem.\n\n## The missing property is prefix invariance\n\nThe authors name it prefix invariance: at every layer, the smaller submodel's intermediate representation is an exact prefix of the larger one's. The paper proves this is equivalent to a simple condition — block-triangular maps, where the leading d output coordinates depend only on the leading d input coordinates — and that the property survives composition, aligned residual addition, and coordinate-wise nonlinearities, so the whole network is prefix-invariant end to end.\n\nMapped onto Transformer components: linear maps and FFN projections are zeroed block-triangularly; normalization becomes hierarchical, with each block's statistics computed over cumulative feature dimensions; multi-head attention groups heads, widening only activates new groups, and each earlier head retains its queries, keys, values, and attention weights untouched; vocabulary logits become cumulative — the next budget's logits are the previous budget's plus one incremental term, avoiding the repeated large-vocabulary head multiplication that non-exited heads pay in early-exiting. KV caches can then be shared across submodels layer by layer and head by head: backfilling exactly computes the missing blocks in parallel without re-prefilling; masking lets newly activated heads attend only to tokens where they have entries; copying and imputing are cheaper approximations that skip the pass.\n\nOne theoretical result rounds this out: in the linear case the architecture class contains the truncated-SVD optimum for every depth and width simultaneously, so the block-triangular constraint costs nothing in the simplest world. The paper itself notes that beyond the linear case no such simultaneous optimality can be expected — later blocks never altering earlier ones is a structural guarantee, not an optimality one.\n\n## Training: one forward pass graduates the whole family\n\nPrefix invariance has a by-product: one full-width forward pass exposes the logits of every nested submodel, so the losses of all K budgets share a single computation graph and backpropagate together — in contrast with slimmable training, which samples one submodel per step. Supervision uses hierarchical self-distillation (HSD): each submodel distills from its immediate successor rather than the full model; teacher and student differ by exactly one refinement block, which lowers stochastic-gradient variance. In a GPT-2 ablation the full model reaches a loss of 3.461 with HSD versus 3.494 with standard KD, while training throughput is 7% higher and peak memory 15% lower. The paper also normalizes gradients by membership (MNG) but concedes that AdamW cancels most of its effect, which only shows up under optimizers like SGD.\n\n## The 1B-scale ledger\n\nInference works like this: every token starts at the smallest width, a small MLP router estimates the KL gap between the current budget's predictive distribution and the full model's, accepts when it is below a threshold, and otherwise adds one more block; the language model stays frozen while the router is trained. The main experiments cover Llama 3.2-1B, Nemotron-Flash-1B, and Qwen 3.5-2B (Llama nested widths use 3, 6, and 8 of the 8 total attention\u002FKV heads), with the Llama variant at an effective 916.5M parameters and a parameter-matched dense control at 918.9M. Batch-1 decoding on an A100: at fixed full width Prefix-LM is 6.85% slower than the parameter-matched dense model — the hardware tax of triangular structure; a randomly sparse model of the same size is 40% slower than its own dense version, so the block-triangular sparsity pattern is unusually GPU-friendly, and cascading converts the saved compute into wall-clock speedups. Generation quality is scored with first-turn MT-Bench plus an LLM-as-judge proxy: the masking strategy matches the quality of the fixed-width medium model with only 70.2% of its FLOPs, a 1.42x FLOPs speedup. At equal FLOP budgets the cascade reaches higher downstream accuracy than the depth-axis baselines CALM and LayerSkip; the paper also flags that CALM reaches a higher maximum score, so the advantage concerns compute at comparable accuracy. The cost has numbers too: triangular connectivity raises held-out cross-entropy by about 5%, and the gap to independently trained models is roughly 60% architectural and 40% parameter-count-related.\n\n## So what\n\nWhat this paper does, in my view, is reduce compute-by-difficulty from a routing problem to a representation problem. In methods without prefix invariance, shared heads produce different keys and values at different widths, so switching width forces the receiving model to rebuild or approximate the context; Prefix-LM shows that wasted work is a structural choice, not a law — switch to block-triangular maps and cascading, routing, and KV reuse all fall into place. Whether a 5% cross-entropy regret is worth paying depends on how much your inference bill hurts. When per-token compute starts deciding which products live, is reusable compute worth more than a larger model?","prefix-lm-width-adaptive-inference","2026-12-01T13:30:00Z","2026-12-01T13:21:57.447370Z","2026-12-01T13:21:57.447377Z",true,"agent",26,[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},"abd8eb9f-c106-4899-bf24-b6bbed3da5e3","注意力砍维度而非砍token,只算三成点积","hisa-hidden-dimension-sparse-attention-rope","2026-11-20T09:00:00+00:00",{"id":75,"title":76,"news_slug":77,"published_at":78},"f3edd5fd-5a5c-447f-8704-500856b96d09","ZHA:Zyphra 用树形索引把注意力成本压成次二次","zyphra-zha-tree-indexed-subquadratic-attention","2026-11-02T05:21:18+00:00",{"id":80,"title":81,"news_slug":82,"published_at":83},"49972f78-da29-4041-8f1f-c57d9d8ceeac","MIT 一行代码修 MTP:八成梯度噪声被滤掉","soft-mtp-kl-gradient-recovery","2026-10-30T17:12:42+00:00",{"id":85,"title":86,"news_slug":87,"published_at":88},"a840ee24-8865-4038-986e-1398549feeb0","苹果论文重算循环大模型算力账:停止头说省一半,实测跑 7.6 轮","apple-halting-head-looped-lm-compute-audit","2026-10-26T03:05:00+00:00",{"id":90,"title":91,"news_slug":92,"published_at":93},"282f3cb4-429c-4432-b632-5e7288192eb9","MassAlloc注意力:按质量分配算力,反传快3倍","massalloc-attention-mala","2026-09-29T21:08:59+00:00",{"id":95,"title":96,"news_slug":97,"published_at":98},"0bdbdcd9-fbb5-4123-9854-57b8f28b385b","把注意力退回查字典:LEMA让KV缓存离开显存","lema-exact-match-attention","2026-09-25T15:15:00+00:00"]