← Latest papers
🤖 AI

Auditing Pay-Per-Token in Large Language Models

This paper proposes a martingale-based auditing framework that enables a trusted third party to reliably detect and prove token misreporting by large language model providers with high statistical confidence, while minimizing false accusations against faithful providers.

Original authors: Ander Artola Velasco, Stratis Tsirtsis, Manuel Gomez-Rodriguez

Published 2026-03-24
📖 4 min read☕ Coffee break read

Original authors: Ander Artola Velasco, Stratis Tsirtsis, Manuel Gomez-Rodriguez

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are ordering a pizza from a delivery app. You pay based on the number of slices you receive. The pizza shop (the LLM Provider) bakes the pizza, cuts it into slices, and hands you the box. They tell you, "Here are 8 slices, that's $8."

But here's the catch: You can't see inside the box until you open it. The shop knows exactly how they cut the pizza. They could secretly cut one slice into two tiny, useless slivers and tell you, "That's 9 slices now, pay me $9!"

In the world of Large Language Models (LLMs), this is exactly what's happening. Companies charge you by the "token" (a chunk of text, like a word or part of a word). Because the way text is chopped into tokens isn't unique, a dishonest provider could split a single token into two to charge you more, even though the text you read looks exactly the same.

This paper introduces a "Token Police" system—a way for a trusted auditor to catch these cheaters without needing to be inside the provider's kitchen.

The Problem: The "Moral Hazard" of the Black Box

In economics, this is called Moral Hazard. The provider sees everything (the whole pizza cutting process), but you only see the final result. Since the provider wants to make more money, they have a financial incentive to "over-slice" your text.

The Solution: The "Martingale" Detective

The authors created a mathematical framework to catch these cheaters. They use a concept from probability theory called a Martingale.

Think of a Martingale as a "fairness meter" or a "suspicion score."

  • If the provider is honest: The suspicion score stays flat, hovering around zero. It's like a calm sea; the waves go up and down a little, but the water level doesn't rise.
  • If the provider is cheating: The suspicion score starts to climb. Every time the provider tries to overcharge, the meter ticks up. Eventually, the score hits a "Red Alert" threshold, and the auditor says, "Gotcha! You're cheating!"

How the Detective Works (The Magic Trick)

The auditor needs to know what the "fair" price should be to spot the difference. But the auditor doesn't have the provider's secret recipe. So, they use a clever trick:

  1. The "What-If" Simulation: The auditor takes the text the provider gave them (e.g., "The cat sat on the mat") and asks the AI model: "If you had to generate this exact sentence, how many tokens would you normally use on average?"
  2. The Estimator: The paper introduces a new, super-efficient way to calculate this average. It's like the auditor running a thousand tiny simulations in their head to figure out the "fair" token count for that specific sentence.
  3. The Comparison: The auditor compares the provider's reported count (e.g., "10 tokens") with their calculated fair count (e.g., "7 tokens").
    • If the provider says 10, but the math says 7, the "Suspicion Score" goes up.
    • If the provider is honest, the score stays low.

The Results: Catching Cheaters Fast

The researchers tested this system with real AI models (like Llama and Gemma) and fake "cheating" providers.

  • The Good News: The system is incredibly fast. It only needed to check about 70 examples to catch a cheater with high confidence.
  • The Safety Net: The system is also very careful not to accuse honest providers. The chance of falsely accusing a good guy is kept below 5% (and in practice, it was even lower).

Why This Matters

Currently, the AI market is like the Wild West. Providers can manipulate the rules to make more money, and users have no way to know. This paper provides the blueprint for a regulatory tool.

Imagine a future where a government agency or an independent watchdog uses this "Martingale Detective" to audit AI companies. If a company tries to overcharge you by splitting tokens, the system flags them immediately. This forces companies to be honest, ensuring you only pay for what you actually get.

In a Nutshell

  • The Villain: AI providers splitting words into tiny pieces to charge you more.
  • The Hero: A mathematical "Suspicion Score" that rises when cheating happens.
  • The Weapon: A clever simulation that calculates the "fair" token count for any sentence.
  • The Outcome: A system that catches cheaters in under 70 tries without punishing the honest ones.

This work is a giant step toward making the AI economy fair, transparent, and trustworthy for everyone.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →