Predictive Auditing of Hidden Tokens in LLM APIs via Reasoning Length Estimation

Ziyao Wang, Guoheng Sun, Yexiao He, Zheyu Shen, Bowei Tian, Ang LiarXiv 2025 · DOI

Introduction

Commercial Large Language Models (LLMs) are increasingly adopting "reasoning" modes (e.g., OpenAI o1/o3, Gemini Thinking) that generate extensive internal chains of thought before producing a final answer. While these traces are hidden to protect intellectual property, users are billed for the tokens consumed during this process. This creates Commercial Opaque LLM Services (COLS), where a fundamental transparency gap exists: users must blindly trust provider usage reports, creating a financial conflict of interest and the risk of "token inflation."

The problem of unverifiable reasoning charges in commercial LLM APIs.

The PALACE Framework

To address this, we introduce PALACE (Predictive Auditing of LLM APIs via Reasoning Token Count Estimation), a user-side auditing framework. PALACE estimates hidden reasoning token counts based solely on the user's prompt and the model's final answer.

The framework utilizes a three-stage pipeline to ensure accuracy across diverse query types:

  1. General Fine-Tuning: A base model is trained to correlate semantic complexity with token counts using general QA pairs.
  2. Domain-Specific Adaptation: Using Group Relative Policy Optimization (GRPO), the model is fine-tuned with adapters for specific domains like math, code, and medicine, where reasoning styles vary significantly.
  3. Lightweight Routing: At inference time, a router directs queries to the most appropriate domain adapter to ensure high-precision estimation.
Overview of PALACE training and auditing workflow.

Methodology and Key Insights

A core finding of this work is that reasoning length is tied to problem complexity rather than simple input/output length heuristics. Traditional shallow models (like MLPs) fail to capture this nuance. PALACE succeeds by leveraging the auditing LLM's own reasoning capabilities to gauge the "computational effort" required for a given task.

Furthermore, the research demonstrates that regression-based prediction via GRPO outperforms discrete classification. By treating token count as a continuous variable, the model better utilizes its internal capacity to estimate exact reasoning depth. The routing mechanism is also critical; it prevents cross-domain interference, ensuring that the concise reasoning typical of coding tasks doesn't bias the more verbose reasoning found in complex mathematical proofs.

Experimental Results

PALACE was evaluated on four novel datasets: OpenR1-Math, OpenR1-Code, OpenR1-Medical, and a General Reasoning set featuring 22 million examples.

  • High Accuracy: On the Math dataset, PALACE achieved a 63.81% Pass@1 accuracy (within a 33% error margin), significantly outperforming baselines like CoIn and standard LoRA fine-tuning.
  • Sensitivity to Inflation: The model proved highly sensitive to token inflation, successfully flagging suspicious billing reports even at tight 10% deviation thresholds.
  • Aggregated Stability: PALACE maintains low aggregated error, which is essential for large-scale auditing where cumulative bias could lead to frequent false alarms.

Conclusion

PALACE provides a practical, user-side solution for ensuring transparency in the era of reasoning-heavy LLMs. By transforming auditing into a predictive modeling task, it empowers users to verify API charges without requiring provider-side cooperation. Future work will explore incorporating additional signals, such as API latency, to further harden the system against potential obfuscation strategies by providers.

Summary updated

BibTeX
@misc{wang2025predictive,
  author = {Ziyao Wang and Guoheng Sun and Yexiao He and Zheyu Shen and Bowei Tian and Ang Li},
  title = {{Predictive Auditing of Hidden Tokens in LLM APIs via Reasoning Length Estimation}},
  year = {2025},
  eprint = {2508.00912},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.00912},
}
Figure