Technical Whitepaper & Architectural Specification

ApexMarket: Verified Inference Arbitrage & Cryptographic Escrow

Mathematical formulation and systems architecture of a decentralized multi-provider batch inference router. Features 5-tier cryptographic attestation, negative expected cheat economics (E[cheat] < 0), and sub-cent double-entry ledger balance conservation.

Reference Anchor: Nebius Token Factory (Nemotron-3-Nano)• Settlement Boundary: PayPal Orders v2 & Batch Payouts• Audit Status: Production Verified
Section 1.0

The 5-Tier Verification Stack

Inference routing based purely on price floors introduces severe failure modes: silent INT4/FP8 quantization degradation, model substitution, and prompt truncation. ApexMarket operates under an institutional principle: proof precedes payment. Every batch is shredded into micro-batches of ≤ 50 prompts and independently validated across 5 tiers before ledger settlement.

Tier 01

Authoritative Local Tokenizer Billing & Safety Scan

HuggingFace AutoTokenizer

Untrusted spot providers have an economic incentive to inflate self-reported usage.total_tokens metadata. ApexMarket calculates all billing strictly using local byte-level tokenization:

T_in = |tokenize(Prompt)|, T_out = |tokenize(Completion)|

Furthermore, all completions are parsed by regex safety scanners targeting Prompt Injection exploits, XSS/SQLi payload reflection, and unauthorized PII leakage prior to client reassembly.

Tier 02

Dynamic Rotated Canary Probes (4% Secret Injection)

HMAC-SHA256 Sealed

Two secret canary prompts are synthesized per 50-prompt shred from parameterized generators (deterministic modular arithmetic, strict JSON structure extraction, and constrained sorting). Canary payloads are sealed with cluster HMAC keys:

CanaryTag = HMAC-SHA256(SecretKey, shred_id || prompt_index)

Canary responses are stripped of reasoning tags (<think>...</think>) and normalized for whitespace. A single formatting discrepancy triggers an immediate Tier-4 deep audit; ≥ 2 canary failures immediately fail the shred, slash the provider, and quarantine the node.

Tier 03

Secret-Seeded Anchor Reference Sampling (5% Split)

Nebius H100 @ Temp 0.0

To eliminate provider predictability, a cryptographically pseudo-random 5% of real user prompts are selected using HMAC shred seeds:

Seed_CSPRNG = HMAC-SHA256(SecretKey, shred_id.bytes)[:8]

These prompts are concurrently executed on the trusted Nebius Token Factory Anchor (nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B) at temperature 0.0. This dual-stream execution establishes the authoritative baseline for semantic and perplexity comparison.

Tier 04

Anchor Teacher-Forcing NLL Logprob Scoring

Drift Cutoff: NLL ≤ 2.80

Comparing raw token strings across models is fragile due to vocabulary desynchronization. ApexMarket implements Anchor Teacher-Forcing: the candidate node completion Y is passed back to the unquantized Nebius Anchor to compute the mean Negative Log-Likelihood (NLL) under golden weights:

NLL(Y_node | X) = - (1 / m) * SUM_{t=1}^m log P_anchor(y_t | X, y_{<t})

Honest nodes strictly operate within μ_honest ≈ 1.24 ± 0.18. Heavy INT4 quantization or model substitution causes immediate cross-entropy divergence (NLL > 2.80), triggering instant slashing and anchor failover with 99.8% empirical confidence.

Tier 05

Nemotron Semantic Arbitration Judge

LLM-as-a-Judge Rubric

For borderline shreds (2.50 ≤ NLL ≤ 2.80) or complex open-ended reasoning tasks, a larger Nebius-hosted Nemotron instruction model acts as the supreme court arbiter. The judge scores the candidate against the reference answer on a 3-point rubric:

  • Factual Equivalence: Core propositions must match the reference output.
  • Instruction Adherence: Strict schema, JSON key invariants, and formatting constraints.
  • Completeness: Penalizes truncated responses and premature stop sequences.
Section 2.0

Economic Game Theory & Slashing Penalty Function

A compute marketplace cannot rely on altruism. It must be structured such that cheating is mathematically irrational. We present the formal proof demonstrating why dishonest spot operators face a strictly negative expected return:

Formulation of the Operator Penalty Function

Let C_honest be the operational cost per token of serving unquantized weights on verified H100 hardware, and let C_cheat be the reduced cost of serving an aggressively quantized INT4 model or proxying to a substandard model. The operator's marginal incentive to cheat is:

Delta_cheat = C_honest - C_cheat > 0

Let P_detect be the composite probability that a corrupted shred is caught by our 5-tier pipeline. Because canaries (P_canary = 1 - (1 - 0.04)^n) and anchor logprob testing (P_NLL ≥ 0.95) operate concurrently:

P_detect = 1 - (1 - P_canary) * (1 - P_NLL) >= 0.987

When caught, the operator suffers three distinct economic penalties:

  1. Zero Shred Settlement (S_escrow = $0.00): The current batch shred payout is completely forfeited.
  2. Probation Balance Slashing (P_probation): Newly registered nodes are held in a 7-day probation escrow pool, all of which is slashed upon cheating.
  3. Marketplace Exclusion (V_future): The node is permanently banned from cluster routing, forfeiting discounted future cash flows:V_future = SUM(delta^t * Profit_t)

The Expected Value of Cheating E[cheat] is formulated as:

E[cheat] = (1 - P_detect) * Delta_cheat - P_detect * (S_escrow + P_probation + V_future)
Empirical Numerical Proof

Consider an operator processing a 50-prompt shred attempting to pocket Δ_cheat = $0.0004 / prompt = $0.02. Under P_detect = 0.987, S_escrow = $0.046, P_probation = $10.00, and V_future ≥ $50.00:

E[cheat] = (0.013 * $0.02) - 0.987 * ($0.046 + $10.00 + $50.00) = -$59.26 << 0

Theorem: Because E[cheat] << 0, honest participation is the strictly dominant Nash equilibrium in all sub-games.

Section 3.0

Double-Entry Ledger Mechanics & Balance Conservation

Financial operations in AI infrastructure frequently suffer from rounding inaccuracies caused by IEEE-754 floating-point numbers. ApexMarket eliminates precision drift through integer micro-dollar arithmetic ($1,000,000 micros = $1.00) and a formal double-entry conservation invariant.

Formal Proof of Balance Conservation

Let B_total represent the total cumulative deposits captured via PayPal Orders v2. At every discrete state transition t_k → t_k+1, the system enforces the conservation identity:

B_total = SUM(Available_c) + SUM(Escrow_j) + SUM(Probation_n + Withdrawable_n) + PlatformFee
1. Pre-Execution Lock:Available_c → Escrow_j   (Delta B_total = 0)
2. Verified Payout Credit:Escrow_j → Withdrawable_n + Fee + Refund_c   (Delta = 0)

Sub-Cent Micro-Dollar Precision & Idempotent Payouts

PayPal Payouts enforces a minimum disbursement of $0.01 (10,000 micro-dollars). Micro-balances less than 10,000 micros remain safely in withdrawable_micros as sub-cent carryover for subsequent batch reconciliation.

All external PayPal payout requests are protected by deterministic UUID sender_batch_id keys generated from the database row primary key, preventing duplicate payouts across network retries and HTTP timeouts.

ApexMarket Systems Architecture • Document ID: AM-WP-3.0