A trained model is usually described by its weights, as if the weights fixed its behavior. In practice the same weights are run by different programs. Training uses high-precision accumulation and fixed tensor shapes, while serving uses low-precision arithmetic, fused attention kernels, a paged key-value cache, and dynamic batching. These programs produce different next-token distributions from identical weights. We make this dependence explicit by indexing a policy by the kernel that executes it, and we propose kernel contracts, which state how far a serving kernel may drift from a reference kernel on each slice of traffic and what the serving system should do when a limit is exceeded. We prove non-asymptotic bounds that link the logit difference between two kernels to total-variation and KL divergence, to the change in expected reward, to the bias of policy gradients computed from rollouts generated by another kernel, and to whether the greedy token can change. We test the bounds and the contracts in GPU experiments on Qwen2.5-7B-Instruct with Hugging Face and vLLM. The bounds hold on every prompt we measured. Lower precision, a different serving engine, and a different batch size each change the generated token on some prompts, and these changes concentrate on prompts where the model is nearly undecided between two tokens. A kernel can therefore look fine on aggregate metrics while behaving differently on exactly these prompts. Checking a contract separately on each slice of traffic catches these cases.


翻译:暂无翻译

0
下载
关闭预览

相关内容

【斯坦福大学博士论文】个性化机器学习的理论进展
专知会员服务
26+阅读 · 2025年3月25日
机器学习的可解释性
专知会员服务
181+阅读 · 2020年8月27日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
61+阅读 · 2019年10月17日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
106+阅读 · 2019年10月9日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
深度学习中Attention Mechanism详细介绍:原理、分类及应用
深度学习与NLP
10+阅读 · 2019年2月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
BAT题库 | 机器学习面试1000题系列(第196~200题)
七月在线实验室
17+阅读 · 2017年11月16日
国家自然科学基金
21+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2013年12月31日
国家自然科学基金
11+阅读 · 2013年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
国家自然科学基金
23+阅读 · 2009年12月31日
国家自然科学基金
12+阅读 · 2008年12月31日
VIP会员
最新内容
《面向国防领域的大语言模型基准测试与适配》
专知会员服务
6+阅读 · 10月28日
世界模型入门:从序贯决策到通用智能体
专知会员服务
12+阅读 · 10月24日
军事域更好使用人工智能的实用指南
专知会员服务
11+阅读 · 10月22日
《衡量语言模型中的作战规划能力》
专知会员服务
15+阅读 · 10月20日
相关基金
国家自然科学基金
21+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2013年12月31日
国家自然科学基金
11+阅读 · 2013年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
国家自然科学基金
23+阅读 · 2009年12月31日
国家自然科学基金
12+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员