CoIn: Counting the Invisible Reasoning Tokens in Commercial Opaque LLM APIs

Guoheng Sun, Ziyao Wang, Bowei Tian, Meng Liu, Zheyu Shen +5 more
5/19/2025
cs.AI

Official code: CASE-Lab-UMD/LLM-Auditing-CoIn (5 stars, MIT, last commit 2026-03-10).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT
50Shell, PythonMay 16, 20257 months agoMIT

Similar Papers

Cite this paper

@article{sun2025coin,
  title  = {CoIn: Counting the Invisible Reasoning Tokens in Commercial Opaque LLM APIs},
  author = {Guoheng Sun and Ziyao Wang and Bowei Tian and Meng Liu and Zheyu Shen and Shwai He and Yexiao He and Wanghao Ye and Yiting Wang and Ang Li},
  year   = {2025},
  eprint = {2505.13778},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.13778v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.13778.svg)](https://codeofpaper.com/paper/2505.13778)

Discussion