CoIn: Counting the Invisible Reasoning Tokens in Commercial Opaque LLM APIs
作者: Guoheng Sun, Ziyao Wang, Bowei Tian, Meng Liu, Zheyu Shen, Shwai He, Yexiao He, Wanghao Ye, Yiting Wang, Ang Li
分类: cs.AI
发布日期: 2025-05-19
🔗 代码/项目: GITHUB
💡 一句话要点
CoIn:审计商业闭源LLM API中不可见的推理token,解决token数量欺诈问题
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 LLM审计 token数量验证 推理透明度 哈希树 嵌入相似度 账单欺诈检测
📋 核心要点
- 商业LLM API隐藏推理过程,导致用户无法验证推理token的真实性,存在token数量欺诈的风险。
- CoIn通过构建可验证的哈希树来审计token数量,并使用嵌入相关性匹配来检测伪造的推理内容。
- 实验表明,CoIn能有效检测token数量膨胀,成功率高达94.7%,显著提升了LLM API的账单透明度。
📝 摘要(中文)
随着后训练技术的进步,大型语言模型(LLM)越来越多地增强了结构化的多步推理能力,通常通过强化学习进行优化。这些推理增强模型在复杂任务上优于标准LLM,并且现在是许多商业LLM API的基础。然而,为了保护专有行为并减少冗长性,提供商通常会隐藏推理过程,而只返回最终答案。这种不透明性引入了一个关键的透明度缺口:用户为不可见的推理token付费,这些token通常占成本的大部分,但无法验证其真实性。这为token数量膨胀打开了大门,提供商可能会虚报token使用量或注入合成的、低成本的token来抬高价格。为了解决这个问题,我们提出了CoIn,一个验证框架,用于审计隐藏token的数量和语义有效性。CoIn构建了一个可验证的哈希树,从token嵌入指纹中检查token数量,并使用基于嵌入的相关性匹配来检测伪造的推理内容。实验表明,当CoIn作为受信任的第三方审计员部署时,可以有效地检测token数量膨胀,成功率高达94.7%,显示出在不透明LLM服务中恢复账单透明度的强大能力。
🔬 方法详解
问题定义:论文旨在解决商业闭源LLM API中推理token数量不透明的问题。用户在使用这些API时,无法得知实际使用的推理token数量,这使得服务提供商可能通过虚报token数量或注入低质量token来增加收费,损害用户利益。现有方法无法有效审计这些隐藏的推理token。
核心思路:CoIn的核心思路是通过构建可验证的哈希树来审计token的数量,并利用token嵌入的语义信息来检测伪造的推理内容。通过这种方式,CoIn能够在不访问LLM内部推理过程的情况下,验证token数量的真实性和推理内容的有效性。
技术框架:CoIn的整体框架包含以下几个主要模块:1) Token嵌入提取:从LLM API返回的token序列中提取token嵌入。2) 哈希树构建:基于token嵌入构建Merkle哈希树,用于验证token数量。3) Token数量验证:通过比较用户端计算的哈希根与服务提供商提供的哈希根,验证token数量是否被篡改。4) 推理内容验证:使用嵌入相似度匹配来检测推理内容是否合理,即判断推理步骤之间是否存在语义关联。
关键创新:CoIn的关键创新在于它提出了一种在不访问LLM内部信息的情况下,验证推理token数量和语义有效性的方法。传统的审计方法通常需要访问LLM的内部状态,这在商业闭源LLM API中是不可行的。CoIn通过利用token嵌入的指纹特性,实现了对隐藏推理过程的有效审计。
关键设计:CoIn的关键设计包括:1) 使用预训练语言模型的token嵌入作为token的指纹,以捕捉token的语义信息。2) 构建Merkle哈希树,确保token数量的完整性。3) 使用余弦相似度等度量方法来计算token嵌入之间的相似度,从而判断推理步骤之间的相关性。论文中没有明确提及具体的参数设置和损失函数,这部分信息未知。
🖼️ 关键图片
📊 实验亮点
实验结果表明,CoIn能够以高达94.7%的成功率检测token数量膨胀。CoIn在不同的LLM API和不同的攻击策略下都表现出良好的性能,证明了其鲁棒性和有效性。此外,CoIn的计算开销较低,可以作为一种轻量级的审计工具部署。
🎯 应用场景
CoIn可应用于各种商业LLM API的审计场景,帮助用户验证服务提供商的账单,防止token数量欺诈。该研究有助于提高LLM服务的透明度和可信度,促进LLM技术的健康发展。未来,CoIn可以扩展到支持更复杂的推理过程和更多类型的LLM API。
📄 摘要(原文)
As post-training techniques evolve, large language models (LLMs) are increasingly augmented with structured multi-step reasoning abilities, often optimized through reinforcement learning. These reasoning-enhanced models outperform standard LLMs on complex tasks and now underpin many commercial LLM APIs. However, to protect proprietary behavior and reduce verbosity, providers typically conceal the reasoning traces while returning only the final answer. This opacity introduces a critical transparency gap: users are billed for invisible reasoning tokens, which often account for the majority of the cost, yet have no means to verify their authenticity. This opens the door to token count inflation, where providers may overreport token usage or inject synthetic, low-effort tokens to inflate charges. To address this issue, we propose CoIn, a verification framework that audits both the quantity and semantic validity of hidden tokens. CoIn constructs a verifiable hash tree from token embedding fingerprints to check token counts, and uses embedding-based relevance matching to detect fabricated reasoning content. Experiments demonstrate that CoIn, when deployed as a trusted third-party auditor, can effectively detect token count inflation with a success rate reaching up to 94.7%, showing the strong ability to restore billing transparency in opaque LLM services. The dataset and code are available at https://github.com/CASE-Lab-UMD/LLM-Auditing-CoIn.