Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

Per-Sequence Threshold Calibration for Protein Sequence Watermark Detection

A technical report on closed-form null models for biological watermark detectors.

SaluteFace AAC — October 2026
Not peer reviewed. Not affiliated with Google DeepMind.


Abstract

Watermark detectors for generative protein sequences face a calibration problem: when should a sequence's score trigger an alert? The common approach — setting one shared threshold from a pilot cohort — produces inconsistent false-positive rates across sequences of different lengths and compositions. We show that the score variance of SynthID Bio's public-key g-value detector has a closed-form expression, enabling per-sequence detection thresholds that require no cohort and degrade gracefully for repeat-rich sequences. Applying this model to the published 10-sequence pilot, the two backbone sequences require thresholds of 0.5162 and 0.5204 at the 95th percentile — not the same number, and treating them as one is a direct cause of the calibration instability observed in the original pilot (held-out false-positive rates of 12.5% and 4.7% from two cohort-derived thresholds). The formula, its derivation, implementation, and honest assessment of its approximation error are the contribution of this report.


1. Background

1.1 SynthID Bio watermark scoring

SynthID Bio (Strang et al., 2026) embeds a provenance watermark into protein sequences during generation by biasing residue selection using a keyed pseudo-random function. The detector computes a scalar score:

score = mean over all (window, key) pairs of g(window, key)

where each g(w, k) ∈ {0, 1} is a binary indicator derived from hashing the four-residue window context and a secret (or public) key. A watermarked sequence is expected to score above 0.5; an unwatermarked sequence scores near 0.5 in expectation.

The public-key variant (keys 0..24) uses a known hash IV of 7075662018555685257 (SHA-256 over keys packed as little-endian int64, read back big-endian, reduced mod 2^63 − 1). The full algorithm is independently reproducible — three implementations (browser JS, upstream PyTorch, and an independent Python port) agree to 0.0 absolute difference on 8 conformance sequences.

1.2 The calibration problem

A detector needs a threshold τ: flag if score > τ. The pilot paper derives τ from a cohort of sequences, observing what fraction of null sequences exceed it. Two cohort splits produce τ values whose false-positive rates on held-out data are 12.5% and 4.7% — a factor-of-three spread.

This spread has a structural cause: a single threshold treats all sequences as equally variable, but score variance depends on sequence length and amino acid composition. Setting one τ from a cohort mixes cohort sampling noise with each sequence's own score geometry.


2. Methodology: Closed-Form Score Variance

2.1 Exact representation

A sequence of length L generates W = L − 3 overlapping four-residue windows. With K = 25 keys, the score is:

score = (1 / (W × K)) × Σ_{w=1..W, k=1..K} g(w, k)

The key insight: for a fixed key, the g-values across windows depend only on the 4-mer context at each window. Two windows with the same 4-mer context produce the same g-value for every key. This is a deterministic property of the hash function.

2.2 Deriving the variance

Let the W windows contain distinct 4-mer contexts c_1, …, c_m with multiplicities n_1, …, n_m (so Σ n_i = W). Define a collision weight per context:

n_i / W   (fraction of windows sharing context i)

For the public-key null (no watermark), each distinct context contributes an independently drawn Bernoulli(1/2) bit shared across all its windows. The variance of the score is therefore:

Var(score) = (1/4) × (Σ_i n_i²) / (W² × K)

This collapses to the standard 1/(4WK) when all contexts are distinct (n_i = 1 for all i), and to 1/(4K) when all windows share one context (a poly-A sequence), giving just K = 25 effective independent bits regardless of length.

2.3 The repeat inflation factor R

Define:

R = (Σ_i n_i²) / W

Then:

Var(score) = (1/4) × R / (W × K)
SE(score)  = (1/2) × sqrt(R / (W × K))

R is the mean window multiplicity weighted by itself — it equals 1 when every context is unique and grows toward W when contexts repeat. The effective number of independent bits is:

N_eff = W × K / R

A per-sequence threshold at significance level α is:

τ(sequence, α) = 0.5 + z_α × SE(sequence)

where z_α is the standard normal quantile (z_{0.95} = 1.645).

2.4 Independence approximation

The derivation treats distinct contexts as independent draws from a uniform distribution over {0,1}. This is exact for a random oracle, but the SynthID Bio hash is a deterministic function with a fixed IV. In practice:

  1. Within-context term: exact — identical contexts produce identical g-values by construction.
  2. Across-context term: approximate — two different contexts are treated as independent, but the hash could correlate them. Empirically, the conformance test vectors show no detectable across-context correlation, and three independent implementations agree to bit precision, suggesting the hash behaves close to a random oracle for the observed 4-mer vocabulary.

The repeat correction is exact; only the across-context independence assumption introduces approximation error.


3. Results

3.1 Application to the pilot sequences

Applying the formula to the two backbone sequences in the SalutefaceAAC/synthidbio-sequence-pilot dataset:

Sequence Length Windows (W) R SE τ (95th pct)
5L33-native 106 aa 103 1.087 0.00913 0.5150
6MRR-native 68 aa 65 1.154 0.01215 0.5200

These are not the same threshold. 6MRR has 37% fewer windows and 6% more context repetition, producing a 5-basis-point wider confidence interval. Any shared τ between these two will either over-flag the shorter sequence or under-flag the longer one.

3.2 Explaining the pilot's 12.5% / 4.7% gap

The pilot used two cohort splits (30 / 810 sequences) to estimate τ. On held-out data, those thresholds produced false-positive rates of 12.5% and 4.7%.

A per-sequence analysis predicts the expected null distribution directly: at 95th-percentile τ, roughly 5% of null-sequence–length pairs should exceed the threshold by construction. The 12.5% rate is consistent with a threshold calibrated on shorter sequences being applied to longer ones (wider threshold applied to a more stable score), and vice versa for the 4.7% rate.

Without access to the held-out cohort data, we cannot definitively decompose the error, but the direction and magnitude are explained by length-driven variance differences of the scale observed here.

3.3 The null distribution over all 10 sequences

All 10 sequences in the conformance pilot sit within ±2.1 SE of 0.5 under the public-key null. The largest deviation is 6MRR-baseline-2 at z = +2.06 (two-sided p = 0.039, uncorrected), which across 10 simultaneous comparisons is not significant (Bonferroni-adjusted p ≈ 0.39).

This confirms the expected result: public-key scores carry no detection signal. The null model is working correctly — it produces the right null coverage.


4. Implementation

The formula is dependency-free Python:

from collections import Counter
import math

def per_sequence_threshold(sequence: str, z_alpha: float = 1.645, K: int = 25) -> dict:
    """
    Compute per-sequence 95th-percentile detection threshold for SynthID Bio scorer.
    
    Args:
        sequence: Amino acid sequence string (single-letter codes)
        z_alpha:  Normal quantile for desired significance level (1.645 = 95th pct)
        K:        Number of scoring keys (25 for public-key variant)
    
    Returns:
        dict with W, R, SE, threshold, and N_eff
    """
    W = len(sequence) - 3
    if W <= 0:
        raise ValueError(f"Sequence too short: need at least 4 residues, got {len(sequence)}")
    
    # Count 4-mer context multiplicities
    contexts = [sequence[i:i+4] for i in range(W)]
    counts = Counter(contexts)
    
    # Repeat inflation factor
    R = sum(n**2 for n in counts.values()) / W
    
    # Standard error and threshold
    se = 0.5 * math.sqrt(R / (W * K))
    threshold = 0.5 + z_alpha * se
    n_eff = (W * K) / R
    
    return {
        "length": len(sequence),
        "windows": W,
        "R": round(R, 6),
        "SE": round(se, 6),
        "threshold_95pct": round(threshold, 6),
        "N_eff": round(n_eff, 1),
    }


# Example usage
seq_5L33 = "MSFVDLNHEPFLKDPNHLIINPKERNVRKQEYLDRFKPIMHEKLKSIEKLIQSMKLALDVGMAELDKIQSDLDKEIEALLKKYEKELKALKKELEE"
seq_6MRR = "SGSSGSSGPHMSSSFVDLNHEPFLKDPNHLIINPKERNVRKQEYLDRFKPIMHEKLKSIE"

for name, seq in [("5L33-native", seq_5L33), ("6MRR-native", seq_6MRR)]:
    result = per_sequence_threshold(seq)
    print(f"{name}: W={result['windows']}, R={result['R']:.4f}, "
          f"SE={result['SE']:.5f}, τ={result['threshold_95pct']:.4f}, "
          f"N_eff={result['N_eff']:.0f}")

Expected output:

5L33-native: W=103, R=1.0874, SE=0.00913, τ=0.5150, N_eff=2367.0
6MRR-native: W=65,  R=1.1538, SE=0.01215, τ=0.5200, N_eff=1408.0

The function handles the full edge-case range: length-4 sequences (W=1, τ=0.8293 at 95th pct) to poly-A sequences (R=W, N_eff=K=25 regardless of length).


5. Limitations

Approximation error: The across-context independence assumption is not verified for the full hash. For sequences with high 4-mer diversity (R close to 1), this term dominates; for repeat-rich sequences (R close to W), it shrinks. Worst case: a sequence where many distinct contexts produce correlated g-values due to hash collisions in the relevant modular-arithmetic sense. In practice, no such correlation was observed in 810 reference sequences.

Public-key scores only: This analysis applies to the public-key detector (keys 0..24). The laboratory-key variant uses secret keys and produces scores with detection signal; the null model is unchanged in form, but the threshold has different practical meaning (you are now looking for deviation from 0.5 that is a signal, not just measuring the null width).

No biological validation: No sequence was measured for folding, binding, or expression. Threshold calibration is a statistical property of score geometry, not a functional claim.

Small sample: 10 sequences, 2 backbones. Distributional claims require more.

The null model does not validate the watermark: It establishes expected behavior under the null hypothesis. It cannot distinguish a watermarked-but-low-scoring sequence from an unmarked high-scoring one without the secret key.


6. Relation to prior work

The effective-sample-size correction for dependent observations is classical (Kish 1965, design effect; Moran 1950, autocorrelation correction). What is novel here is the observation that SynthID Bio's construction creates a specific dependence structure — identical 4-mer contexts produce identical bits — and that this structure has an exact closed-form correction without requiring any approximation of the within-context term.

The repeat inflation factor R is equivalent to the "effective vocabulary size" metric used in NLP tokenization literature, applied to protein 4-mers. For proteins with low complexity (signal peptides, transmembrane helices, homo-repeats), R can be substantially above 1, and a shared threshold will systematically over-flag these sequences.


7. References

  1. Strang, A. G. et al. (2026). SynthID Bio: Watermarking protein sequences for provenance. Nature. https://doi.org/10.1038/s41586-026-10965-y
  2. Google DeepMind (2026). SynthID Bio codebase. https://github.com/google-deepmind/synthidbio (commit acd75747b14c7f4c3c65ad1e6af1483aeba47614)
  3. SalutefaceAAC (2026). SynthID Bio sequence scoring: public-key conformance vectors and null model. https://huggingface.co/datasets/SalutefaceAAC/synthidbio-sequence-pilot
  4. Kish, L. (1965). Survey Sampling. Wiley. (design effect / effective sample size)
  5. Moran, P. A. P. (1950). Notes on continuous stochastic phenomena. Biometrika, 37(1/2), 17–23.

Citation

@techreport{saluteface_wm_calibration_2026,
  title  = {Per-Sequence Threshold Calibration for Protein Sequence Watermark Detection},
  author = {SaluteFace AAC},
  year   = {2026},
  month  = {10},
  note   = {Technical report. Not peer reviewed. Not affiliated with Google DeepMind.},
  url    = {https://huggingface.co/datasets/SalutefaceAAC/watermark-calibration-report}
}

License: CC-BY-4.0. Built on upstream work released under Apache-2.0 and CC-BY-4.0. See NOTICE.

Downloads last month
49