![]() | 1 villivateur 84 天前 你的前提就错了,大模型会用到很多随机种子,不保证同样的 input 总是相同的 output |
![]() | 2 sillydaddy OP @villivateur 这个我知道,但是伪随机总是可以确定的,只需要把种子作为消息的一部分即可。 /t/1137758 |
![]() | 3 jybox 84 天前 不用那么麻烦,模型参数里有一个 seed ,同样的 seed 理论上会产生相同的输出。 https://cookbook.openai.com/examples/reproducible_outputs_with_the_seed_parameter |
![]() | 4 neteroster 84 天前 > 相同的消息必须有相同的回复,违反了这点就意味着模型有所变化。 错误的。LLM 生成最后有采样步骤会引入随机性。即使贪婪采样,现代 LLM 推理框架在性能上的一些优化措施也会导致几乎丧失稳定的 reproducibility 。 OpenAI 是这么说的:... If specified, our system will make a *best effort* to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is *not guaranteed* Anthroic 是这么说的:...Note that even with temperature of 0.0, the results will not be fully deterministic. |
![]() | 5 neteroster 84 天前 @neteroster #4 开源推理框架的一些信息: > vLLM does not guarantee the reproducibility of the results by default, for the sake of performance. You need to do the following to achieve reproducible results: > For V1: Turn off multiprocessing to make the scheduling deterministic by setting VLLM_ENABLE_V1_MULTIPROCESSING=0. |
6 kapr1k0rn 84 天前 不如搞个 benchmark 定期测试 |
![]() | 7 greygoo 84 天前 AI 降智主要是什么地方的问题呢?如果是前端 chat 方面的问题或者是 Cursor 这类 agent 问题,我觉得是正常操作。如果 api 上面降智,就不用它们家的 API 直接平替其他供应商。可能比较关键的是,我们需要有一些第三方专门随机检测以及评测大模型。 |
![]() | 8 sillydaddy OP @neteroster 说实话,我不知道它的 "for the sake of performance" 是怎样影响到 "determinism"。从理论上说,随机性的来源似乎只有随机数这一个,还有其他步骤会引入吗? 至于 Anthroic 说的 temperature ,它本来就不是影响确定性的啊,temperature 影响的是采样概率,伪随机数才会影响确定性的。 |
![]() | 9 neteroster 84 天前 ![]() @sillydaddy 1. 当然有... 底层来说,硬件方面就引入的很多不确定性,CUDA 也有一些原语不是确定性的( https://news.ycombinator.com/item?id=37009167 有一些讨论,像是 pytorch 这些依赖 cuda 的也会因此受影响: https://github.com/pytorch/pytorch/issues/75240 ),这些不确定性在大规模推理(多 GPU 、多节点)的情况下会愈加明显。推理框架本身也会因为调度,batch inference 下的 padding 加入很多不确定性,这里也有很多讨论: https://news.ycombinator.com/item?id=44527256 2. 模型到 lm_head 这里还是纯函数,而 temp=0 等价贪婪采样,按你的说法,对相同的信息给出的 logits 不会变,最后贪婪采样也是完全确定的,整个过程没有任何随机性参与。但是实际上实践上就是因为上面各种原因做不到 |
![]() | 10 Pteromyini 84 天前 @sillydaddy #8 即使抛开算法本身,工程部署时产生随机的情况太多了,最常见的比如 cuda 引起的,跨 gpu 引起的等等都有可能 |
![]() | 12 7a98kZ6v0WQs5ZO1 80 天前 @sillydaddy 你有 adsense 号出售吗 |