# Consensus Reproducibility Eval

> Evaluates the reproducibility and deterministic behavior of generative AI models (diffusion and LLMs) by measuring the likelihood of identical outputs given identical prompts and seeds. It probes the stability of model inference and training under decentralized, heterogeneous hardware conditions. Use when the user has predictions and gold and needs to compute consensus.

- Skill: `qhjqhj00/consensus-reproducibility-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/consensus-reproducibility-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/consensus-reproducibility-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/consensus-reproducibility-eval

---


# consensus-reproducibility-eval

> Generative Artificial Intelligence Reproducibility and Consensus — Edward Kim et al. (2023) (arXiv:2307.01898, 2023)

## What this evaluates

Evaluates the reproducibility and deterministic behavior of generative AI models (diffusion and LLMs) by measuring the likelihood of identical outputs given identical prompts and seeds. It probes the stability of model inference and training under decentralized, heterogeneous hardware conditions.

## Datasets

- **ImageNet (ILSVRC classes)** — total 1000; splits: test (1000)
- **sd-concepts-library** — total ?; splits: train (-1); HF `sd-concepts-library`

## Metrics

- `consensus` **(primary)** — range: percent
  - Percentage of generated outputs that match the mode perceptual hash or exact sequence when identical prompts and seeds are used across independent runs. Computed as (matching_outputs / total_outputs) * 100.
- `verification_accuracy` — range: percent
  - Probability of correctly detecting fraudulent or incorrect behavior in a decentralized network using majority or super-majority voting. Calculated via binomial distribution P(X=k) = C(n,k) * p^k * (1-p)^(n-k), where p is the consensus likelihood and n is the number of verifiers.
- `outliers` — range: count
  - Count of generated outputs that deviate from the mode perceptual hash within a class group, optionally allowing for hamming distance tolerances (Ot<=1, Ot<=2).

## Input / output format

**Input**: For images: prompt template 'A photo of {class}' + fixed seed. For LLMs: prompt '### Human: Please write a description about {name} ### Assistant:' + decoding strategy (greedy, beam, multinomial).

**Output**: Generated images (512x512) or text sequences. Perceptual hashes (aHash, dHash, pHash, cHash) computed from images for comparison.

## Scoring recipe

```python
def compute_consensus(outputs):
    hashes = [compute_perceptual_hash(o) for o in outputs]
    mode_hash = max(set(hashes), key=hashes.count)
    consensus_pct = (hashes.count(mode_hash) / len(hashes)) * 100
    return consensus_pct

def compute_verification_accuracy(n_verifiers, p_consensus, k_successes):
    from math import comb
    return comb(n_verifiers, k_successes) * (p_consensus ** k_successes) * ((1 - p_consensus) ** (n_verifiers - k_successes))
```

## Common pitfalls

- GPU non-determinism and floating-point error drift can cause hash mismatches even with identical seeds and prompts.
- Multinomial sampling is inherently non-deterministic, unlike greedy or beam search decoding, which must be explicitly controlled for reproducibility.
- Hamming distance tolerance thresholds (e.g., Ot<=1, Ot<=2) significantly alter outlier counts and consensus percentages.

## Evidence (verbatim from paper)

> The consensus percentages are computed by the number of outliers over the total number of images hashed. This can be used as the likelihood that an image generated with the same prompt and seed will generate the same perceptual hash. Verification of Correctness - Type I Error - For majority vote and tolerance of 2, we can achieve 99.843%, 99.988%, and 99.999% verification with 3, 5, and 7 independent verifiers.

## Citation

```bibtex
@misc{kim2023genai_reproducibility,
  title={Generative Artificial Intelligence Reproducibility and Consensus},
  author={Edward Kim et al. (2023)},
  year={2023},
  note={arXiv:2307.01898}
}
```

- arXiv: 2307.01898

