paper reading - Mistral Large 4 tech report / Ernie 5.5
列一些我觉得有意思的部分
batch size调度策略
2.3.1 Batch size ramp-up The optimal batch size increases throughout training. Early in training, a larger batch size wastes compute (and tokens) because a gradient estimate from a fraction of the batch’s tokens suffices, whereas later in training, we benefit from more precise gradients. Therefore, we ramp up the batch size in stages with a share of tokens that grows exponentially per stage: the final batch size (stage) runs for the last 50% of tokens, the penultimate batch size runs for 25% of tokens, and so on. We rescale the learning rate for each stage by a factor that is tuned empirically. Batch-size ramp-up also acts as a regularizer: noisier gradient estimates from the smaller early batches reduce overfitting, and the benefits of regularization increase with the number of data repeats. Like the batch-size compute multiplier, the choice of schedule trades off optimization efficiency against throughput. From an optimization perspective, we find that ramp-up from 0.25× to 2× the predicted batch size performs best empirically. However, larger batch sizes achieve higher MFU in our setting. Therefore, we chose to ramp up from 1× to 4× based on wall-clock performance, which produces the 40M, 80M, 160M schedule above
motivation是
-
数据不够,pretrain需要适当的重复(尤其是mistral使用了两阶段配比,第一阶段65%数据配17%code, 第二阶段35%数据配39%的code, code应该是要重复好几遍的

-
重复会overfit
-
小batch 噪声大 ,防overfit, 同时对于数据的利用较大batch更高, 所以前期用小batch更好
-
但是小batch会影响mfu,速度降低,所以 设scaling ladder算出来的最优batch size为x, 并没有采用从 0.25x -> 2x 的方案,而是采用了 x -> 4x的方案,优先保证速度(4000 GB200 45day 完成1t pretrain)
Sparse Attn 带来agentic性能下降?
3.1 Agentic penalty on architecture Initially, we used multiple optimizations to reduce the KV-cache footprint of ML4, notably: • Ragged multi-head latent attention (MLA): One in every four layers uses full attention, the remaining layers use sliding-window attention (SWA) [18–20] with a window size of 512 tokens. • Cross-layer attention sharing (CLA) [21]: Every other full-attention layer reuses the KV cache of the preceding full-attention layer. • YOCO [22]: Full-attention layers in the second half of the transformer attend to the KV cache produced by the first half instead of maintaining their own KV cache. Beyond KV-cache reduction, YOCO enables two-stage prefilling, which is 1.7× faster at 1M context on our benchmarks. The combination of these optimizations reduced the KV-cache size by a factor of 16 compared to a full-attention baseline. Early ablations suggested that impact on pretraining performance, including perplexity and other common pretraining and post-training benchmarks, was either negligible or small enough to justify the efficiency gains. However, as ML4 pretraining continued, early SFT cooldowns on intermediate checkpoints revealed poor performance. Despite expected performance on pretraining evaluations, including perplexity and knowledge-based benchmarks, the model’s post-SFT performance was lower than expected on agentic evaluations, especially those that require long-context reasoning like SWE-bench [23] and BrowseComp [24]. Parallel research efforts helped us to isolate the performance regression. Under the same training token budget, SWE-bench Verified [25] scores measured after midtraining and SFT decreased as we moved from full attention to SWA, and regressed further when applying CLA
在预训指标上,yoco,swa和fa(mla)混合并没有怎么掉点的同时,带来了16x 的kvcache减少,但当训练进行到midtrain/sft阶段时,full attn却表现出来了明显的优势

sparse attn可能会导致agentic任务掉点是一个比较广为人知的认识,想想也知道agentic实际上是相当长程的任务,window一定是有一些影响的,只是之前赞同sparse的人也观测到了相反的,某些情况下,sparse反而有助于提升性能的现象,但我觉得这只是模型的长文能力不够强,随着模型reasoning越来越长,长文能力肯定是在加强的,window的效果相对存疑,截断reasoning会比截断tool response要严重
我觉得mistral这里最有insight的反倒是明确揭示了这个pretrain bench不掉是真的 != posttrain 不掉,pretrain bench某种程度上不可信,这和大伙的认知一致,但国模真的有卡进行充分的heldout sft消融验证吗?哎.....
我觉得还是有优势的,感觉它这里的两个claim都是最近国模实际遇到的问题 一个是数据不够,导致重复次数在上升,但上升多少是崩溃的拐点这个纯靠经验,这里小batch当正则化或许是一个策略 另一个是卡太少速度不够,mistral这里somehow验证了训练后期可以放4x bs 而不崩,感觉还是有空间用到国模pretrain上的,就是大家pretrain都完全不开源,所以用了也不知道
我觉得他们最变态的是训练中间换架构
我记得我上次问 xpr 的时候被他喷了,说我是不是脑子不清醒怎么可能中间换架构,最多中间换换数据和参数
这 下见到中间换架构的了
3.2 Model surgery
- 3.2.1 Removing KV compression, adding LeRoPE and SSMax
- 3.2.2 Scaling up to the full model
- 3.3.3 DeepSeek Sparse Attention (DSA)
拆掉了swa, 换位置编码,本来想拆yoco的,发现加回去还是有收益, 由于本人对架构并没有非常了解,这里也没法评价
4.1 Agentic instance authoring

也是大家常见的思路了,只是感觉他们这个领域树有点奇怪,为什么math / cowork的sandbox是和code一起合成的,直接从github裸做有点狂野,不过现在确实有些是直接拿着github上资源文件比如lean或者一个svg之类去合任务的
相信模型能力!其实这种和直接从网页上合都不好说有啥区别(),虽然直接从网页里面合cowork应该各家也都有管线
正当我疑惑它想咋整例如法律这种边角领域的环境的时候,他来了个
- Real-world seeds: For broad coverage of terminal use, we collect millions of technical seeds from our pretraining corpus. This content includes software engineering, system administration, security, databases, optimization, and so on.
- Synthetic seeds: To supplement the real-world challenges, we generate more seeds from a taxonomy (e.g., Figure 10). Each seed is a tuple drawn from combinations of skill, domain, difficulty, verbosity, and other attributes.
直接合成!相信模型(😂)
从预训数据里面回捞是常规思路,只要没有部门墙都是可以推的
下面的github测试不行之类都是老生常谈了,参考mimo v2.6 tech report
we observe that the generated samples are higher quality, more realistic, and more diverse when conditioned on taxonomies than otherwis
4.3.3 讲了讲agent逃逸沙盒环境的事情,有点忘了是在哪个report里看到的,container的隔离性并没有那么好,如果是python用于沙箱调度,那agent有读python runtime的切面来定位测试的做法,当时的解法是上MicroVM隔离性更强一些,但我觉得更简单的做法是直接在机器层面做隔离,把测试外放到物理隔离的集群服务里面,我记得openai的swarm(是叫这个名字吗?)就是这个思路来着,感觉平台基建做得好的话是不影响rl的async的,依稀记得这方面如果可以用nix的话会干净很多
不过这个东西反正也是基建越好,优化越多(例如缓存或者prefetch或者jit etc),状态越难全局一致,agent bug hack的次数就会多,所以基建越好基建越差(bushi
4.4 RL
使用mmx的 cispo + mimo的 segment level advantage correction
然后是训推不匹配 经典路由重放,经典kl截断,经典batch invariant算子,经典tokenize问题修复
4.4.5 Finding other agents in web search task
这个倒是挺有意思的,benchmark测试的搜索越来越长尾,测试这一行为本身对公用网页的影响就越大,网站自己的SEO和搜索引擎的返回结果就会变化,最后就变成了,使用公用搜索api 这个事情(例如google search) ,本身就会受到一定的泄露影响
搜索并不是一个无状态的操作,网站和搜索引擎双方的优化改变了搜索的重放语义
感觉都快和量化一样了,再之后是不是还要有一个冲击模型衡量测量bench本身对于bench的影响(笑)
想起唐杰说智谱曾经尝试自建搜索引擎,但发现过于困难,最后放弃了,自己的search engine mirror确实是 search rl 的必需品啊,感觉为了维护良好的行为语义,llm厂商被逼的要重新发明一切了,这里面又会有多少infra bug我都不敢想
4.5.1 的长度奖励就比较简单了 简单的线性内部相对惩罚
但report有个观点是是不需要很精细的挑这个,反正不同的超参得到的 效率-性能 tradeoff 模型都可以通过MOPD蒸回去,这个还挺暴力的hhh
好像ERNIE 5.5 flash也用了一些独特的策略, 比如 https://zhouyuxuanyx.github.io/2026/11/05/one-knob-is-not-enough-softmax-temperature-vs-multimax.html ,给对数学过敏的人(比如我)省流
softmax是单峰的,但真实注意力 or 标签预测之类可能是多峰的 本质上从 logits -> 概率需要满足两个事情
- 稀疏性:垃圾choice被压低
- (sometimes)多峰性: 合理的选择都可以高峰
而传统softmax只有一个旋钮温度T, T高多峰但不稀疏,T低稀疏但不多峰
本质上理想的做法是一个阶梯函数,
- if 低logits -> 压低(稀疏)
- if 中logits -> 保持
- if 高logits -> 抬高(多峰)
,然后可以relu把if-else变得可导,再二阶化变得光滑,就得到了一些可学习的旋钮(而不只是一个T),再把这族旋钮的初始化变成softmax, 就能获取到剩下的增益
听起来相当合理,但有一个问题是,multimax在保留了多峰的同时也削弱了主峰的学习强度,对于小模型有限样本的情况下验出来效果不佳(例如在质量模型使用multimax替换softmax)
ernie-5-5-flash这篇主要是架构上的东西啊 用了好多新架构, echo之前群里也宣传过,没想到是ernie的工作. 活太多了,架构上的就暂时先不看了,我得先把管线和配比还有消融搞好(




