arXiv:2511.20621cs.LGcs.AI2025-11被引 3

让大模型推理结果可验证,即使有随机性也不怕。

DiFR: Inference Verification Despite Nondeterminism

  • 用参考模型对比输出令牌,锁定合法结果范围。
  • 4位量化检测AUC超0.999,300令牌内完成。
  • 适合需要高效验证的部署场景,零成本审计。

随着大语言模型推理需求增长,确保推理过程正确无误变得愈发重要。但因数值噪声导致相同输入两次运行结果不同,难以区分正常波动与真实错误。为此,我们提出Token-DiFR:通过将生成令牌与同随机种子下可信参考模型的预测进行比对,实现推理验证。采样种子同步严格约束有效输出,使提供方几乎无法偏离正确推理路径,从而让输出令牌本身成为可审计的正确性证据,且对提供方无额外成本。Token-DiFR可可靠检测采样错误、模拟漏洞及模型量化问题,在300个输出令牌内对4位量化检测的AUC > 0.999。针对需低开销正向验证的应用,我们进一步提出Activation-DiFR,利用随机正交投影将激活压缩为紧凑指纹进行验证。该方法仅用2个输出令牌即实现4位量化检测,AUC > 0.999,通信开销相比现有方法降低25%-75%。我们开源了与vLLM集成的实现,加速可验证推理的实际部署。

原文摘要 · Abstract (English)

As demand for LLM inference grows, it is becoming increasingly important that providers and their customers can verify that inference processes are performed correctly, without errors or tampering. However, re-running the same inference process twice often leads to different results due to benign numerical noise, making it difficult to distinguish legitimate variation from actual problems. To address this problem, we introduce Token-DiFR (Token-Divergence-From-Reference), a method for verifying inference outputs by comparing generated tokens against predictions made by a trusted reference implementation conditioned on the same random seed. Sampling seed synchronization tightly constrains valid outputs, leaving providers minimal room to deviate from correct inference, which allows output tokens themselves to serve as auditable evidence of correctness at zero additional cost to the provider. Token-DiFR reliably identifies sampling errors, simulated bugs, and model quantization, detecting 4-bit quantization with AUC $>$ 0.999 within 300 output tokens. For applications requiring sample-efficient forward-pass verification, we additionally introduce Activation-DiFR, a scheme that uses random orthogonal projections to compress activations into compact fingerprints for subsequent verification. Activation-DiFR detects 4-bit quantization with AUC $>$ 0.999 using just 2 output tokens, while reducing communication overhead by 25-75% relative to existing methods. We release an open-source integration with vLLM to accelerate practical deployment of verifiable inference.

模型验证大模型可审计性量化检测

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。