Was it really the badged model? #

What is new: an audit asks whether a live deployment's answers came from the model it claims. Ordinary-looking questions are sent to the deployment, and each answer is replayed through the badged weights with the answer forced in (teacher forcing). At every position the auditor reads the badged model's probabilities. A token is consistent when it is within δ of the badged model's own top choice, and an answer fails at two or more inconsistent tokens. Every number in the record is an integer, in milli-nats.

Why it matters: a receipt proves that a company signed an answer. It does not prove which model wrote it. An audit tests the serving path itself. In our live test, a different model and a light fine-tune of the badged model were each caught at the second question, and the honest deployment failed none of 32.

A model, and its own answers #

The model here is tiny on purpose: its next token depends only on the previous one, through a fixed table, so the greedy answers are exact. The audit code is the same one used against real deployments.

import torch
from tensorchain import audit as A

class Tiny(torch.nn.Module):
    def __init__(self, seed, vocab=17, scale=4.0):
        super().__init__()
        g = torch.Generator().manual_seed(seed)
        self.table = torch.nn.Parameter(torch.randn(vocab, vocab, generator=g) * scale)

    def forward(self, input_ids):
        return self.table[input_ids]

def greedy(model, prompt, n):
    ids = list(prompt)
    for _ in range(n):
        ids.append(int(model(torch.tensor([ids]))[0, -1].argmax()))
    return ids[len(prompt):]

badged = Tiny(1)
honest = greedy(badged, [3, 5], 24)
r = A.check_answer(badged, [3, 5], honest)
print(r["tokens"], "tokens,", r["inconsistent"], "inconsistent, worst gap", r["worst_gap_milli"], "milli-nats")
assert r["inconsistent"] == 0 and not r["fails"]
Output (captured at build)
24 tokens, 0 inconsistent, worst gap 0 milli-nats

A swapped model is caught #

The deployment quietly serves a different model. Its first answer is the honest one (it was cached), and its second is its own.

other = Tiny(2)
swapped = greedy(other, [3, 5], 24)
rep = A.audit(badged, [([3, 5], honest), ([3, 5], swapped)])
second = rep["answers"][1]
print("caught at challenge", rep["caught_at"], "; inconsistent tokens in it:", second["inconsistent"],
      "at", second["inconsistent_at"][:6])
assert rep["caught_at"] == 2 and rep["failed"] == 1
assert all(isinstance(g, int) for g in A.gaps_milli(badged, [3, 5], swapped))   # integers in the record
Output (captured at build)
caught at challenge 2 ; inconsistent tokens in it: 24 at [0, 1, 2, 3, 4, 5]

The threshold is exact #

One inconsistent token does not fail an answer; two do. Here the answer's last token is replaced by the badged model's least likely choice, and the rule is applied at the default and at stricter settings.

ans = greedy(badged, [3], 8)
gaps = A.gaps_milli(badged, [3], ans)
bad = list(ans[:4])
bad[3] = int(badged.table[ans[2]].detach().argmin())             # one token far from the model's top choice
r1 = A.check_answer(badged, [3], bad)
print("one bad token:", r1["inconsistent"], "inconsistent at", r1["inconsistent_at"], "-> fails:", r1["fails"])
assert all(g == 0 for g in gaps)
assert (r1["inconsistent"], r1["inconsistent_at"], r1["fails"]) == (1, [3], False)
assert A.check_answer(badged, [3], bad, fail_at=1)["fails"]                     # stricter: one is enough
assert not A.check_answer(badged, [3], bad, delta_milli=10 ** 9)["fails"]       # looser: nothing is inconsistent
Output (captured at build)
one bad token: 1 inconsistent at [3] -> fails: False

What it does not prove #

Next: on Sui: receipts committed once, the TNZR vault, and the compute pool's open verification.