arXiv:2510.20208cs.CL2025-10被引 1

提出无需生成的采样策略,高效估算大模型对文本的全分词概率。

Decoding-Free Sampling Strategies for LLM Marginalization

  • 不依赖模型生成,仅用廉价采样实现无解码推理
  • 在少量采样下仍保持高精度边际概率估计
  • 适合需要快速评估文本概率的下游任务

现代语言模型采用子词分词以平衡模型规模、推理速度与词汇覆盖。但推理时仅评估特定分词结果的概率,忽略了同一文本可能存在的多种分词方式。近期研究主张通过边际化——即所有可能分词方式的概率总和——来评估模型。然而,因分词组合爆炸,边际化计算困难,常需采样近似。传统采样需对每条样本执行昂贵的生成过程,受限于运行时间,难以获取足够样本,影响近似精度。本文提出无解码采样策略:完全避免模型生成,仅使用极低成本、模型与分词器无关的采样方法。实验表明,该策略在多个开源模型上可实现高精度边际估计,且耗时仅为传统方法的一小部分,并成功应用于一系列下游推理任务。

原文摘要 · Abstract (English)

Modern language models operate on subword-tokenized text in order to make a trade-off between model size, inference speed, and vocabulary coverage. A side effect of this is that, during inference, models are evaluated by measuring the probability of only the specific tokenization produced as the output, despite there being many possible ways to represent the same text with a subword vocabulary. Recent studies have argued instead for evaluating LLMs by marginalization - the probability mass of all tokenizations of a given text. Marginalization is difficult due to the number of possible tokenizations of a text, so often approximate marginalization is done via sampling. However, a downside of sampling is that an expensive generation step must be performed by the LLM for each sample, which limits the number of samples that can be acquired given a runtime budget, and therefore also the accuracy of the approximation. Since computing the probability of a sequence given the tokenization is relatively cheap compared to actually generating it, we investigate sampling strategies that are decoding-free - they require no generation from the LLM, instead relying entirely on extremely cheap sampling strategies that are model and tokenizer agnostic. We investigate the approximation quality and speed of decoding-free sampling strategies for a number of open models to find that they provide sufficiently accurate marginal estimates at a small fraction of the runtime cost and demonstrate its use on a set of downstream inference tasks.

大模型推理边际化采样优化

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