分析大模型生成概率的随机性,揭示其对文本质量的影响机制。
Beyond Reproducibility: Token Probabilities Expose Large Language Model Nondeterminism
- 通过分析令牌概率变化,揭示GPU计算中非确定性的本质
- 概率在0.1~0.9区间时波动显著,接近0或1时影响小
- 单次推理即可估算非确定性影响,无需重复运行
大型语言模型(LLMs)在图形处理器(GPU)上执行时,即使配置为确定性模式,仍会产生非确定性结果。这是由于算术运算的有限精度受执行顺序影响,而该顺序又取决于GPU上并发运行的进程。以往研究多关注非确定性对生成文本的影响或如何实现确定性执行。本文转而分析令牌概率的变异,发现所有评估模型在概率趋势和实际值上表现相似:当概率处于0.1至0.9区间时,非确定性影响显著;而在接近0或1时则较小。这表明,当温度不为零时,非确定性会对生成文本产生不可忽略的影响;不同模型间的性能差异可能源于不同令牌概率或响应长度;此外,仅需一次推理并分析令牌级概率,即可估计非确定性影响,无需多次重复运行。
原文摘要 · Abstract (English)
The execution of Large Language Models (LLMs) has been shown to produce nondeterministic results when run on Graphics Processing Units (GPUs), even when they are configured to produce deterministic results. This is due to the finite precision effects of the arithmetic operations, which depend on the order in which they are executed. This order, in turn, depends on the processes that are running concurrently on the GPU. Previous studies have focused on the impact of nondeterminism on the text generated by the LLMs or on proposing mechanisms to achieve deterministic execution. This work takes a closer look at nondeterminism by analyzing the variations on the token probabilities, not on the generated text. Interestingly, all the models evaluated have similar results in both the trends and the actual values of the variations of the probabilities. In particular, the results show that the effects of nondeterminism are significant for token probabilities that are in the range of 0.1 to 0.9, while they are much smaller when the probabilities are close to 0 or 1. This has significant implications for our understanding of nondeterminism. The first is that nondeterminism will likely have a non-negligible impact on generated text when the temperature is not zero, as it introduces significant variations in the token probabilities except when they are close to 0 or 1. Secondly, it suggests that all models have similar non deterministic variations at the token probability level. Therefore, different variations in the performance of the generated text, for example, when measuring accuracy on a benchmark, seem to come from different token probabilities or response lengths. A third implication is that we may be able to estimate the impact of nondeterminism by running a single inference and analyzing the token level probabilities, instead of having to run the same inference many times.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。