Back to overview
Submitted — FGCS 2026Elsevier
Token-Accounting Integrity in LLM Metering
Client-Side Under-Payment in Usage-Based Billing
A reproducible testbed and formal model studying client-side under-payment in LLM metering: an authenticated, legitimate client that pays less than it owes, across three accounting architectures and two inference backends.
FastAPIPostgreSQLTLA+Python
58.3%Value leakage, controlled
69.0%Value leakage, real serving stack
40/40Formal verificationTLA+ configurations, 0 disagreements
100 msOver-serving onsetreconciliation delay, sequential arrivals
ClientMetering GatewayClient-Influenced Usage RecordServer-Authoritative RecountNet Debit
PROBLEM
Usage-based LLM pricing makes metering a security boundary: value reaches the client before accounting is finalized, and most security work on that boundary assumes the client is honest. This studies the remaining direction — an authenticated, legitimate client that under-pays.
APPROACH
Unifies known enabling mechanisms under one integrity property (delivered value must not exceed net debit), taxonomized into three dimensions — state synchronization (B0, baseline), commitment timing (M1), and usage authority (M2) — measured across three accounting architectures, three execution topologies, and two independent inference data planes, with every mechanism model-checked in TLA+.
THREAT MODEL
Honest provider; dishonest client holding valid credentials, controlling request payloads (including client-declared usage fields), concurrency, and connection lifecycle, but unable to compromise TLS, the database, or server code.
IMPLEMENTATION
FastAPI gateway fronting a deterministic mock generator and a real llama.cpp backend, with three accounting backends (mutable balance, append-only ledger, event queue) behind common interfaces so experiments compare semantics rather than unrelated code.
RESULTS
An architecture that recounts usage correctly but bills from a client-influenced representation leaks 58.3% of delivered value in the controlled setting and 69.0% against the real serving stack. Reservation and abort-safe finalization are orthogonal — both are required for solvency and integrity together, confirmed by exhaustive model checking across all four combinations (40/40 matched, 0 disagreements).
LIMITATIONS
No mechanized refinement proof from the TLA+ specification to the implementation; the formal model checks safety only, on a finite instance. One physical host, one local serving stack, one small model. Pricing tiers are synthetic. No commercial provider was tested. An earlier version of this work claimed detectability as a result — that claim was withdrawn after the project's own audit found the instrumentation restated experimenter-assigned labels rather than measuring evidence.