threshold-exactly7outof8

Exactly-7-out-of-8 detector. Fires when precisely seven inputs are active. The lone-dissenter detector.

Circuit

  xβ‚€ x₁ xβ‚‚ x₃ xβ‚„ xβ‚… x₆ x₇
   β”‚  β”‚  β”‚  β”‚  β”‚  β”‚  β”‚  β”‚
   β””β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”Όβ”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”˜
               β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”
       β–Ό               β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚  β‰₯ 7    β”‚     β”‚  ≀ 7    β”‚
  β”‚ b = -7  β”‚     β”‚ b = +7  β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚               β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
               β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚   AND   β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
      one dissenter?

The Singleton Complement

This circuit detects the complement of Exactly1: instead of one voice in the wilderness, it's one holdout against consensus.

Circuit Pattern Interpretation
Exactly1 00000001 Pioneer, outlier
Exactly7 11111110 Holdout, veto

Both fire on exactly 8 input patterns (one for each position).

Near-Unanimity

7/8 = 87.5% - overwhelming but not complete agreement:

  • Hung jury: 11-1 in a 12-person jury (scaled to 8)
  • Single point of failure: All systems go except one
  • Error correction: A single bit flip from all-ones

The circuit identifies the liminal state between consensus and unanimity.

Dual of Exactly1

Circuit HW Count Interpretation
Exactly1 1 8 One active
Exactly7 7 8 One inactive

They are perfect duals. Bitwise NOT maps each Exactly1 input to a unique Exactly7 input.

The Holdout Problem

In consensus systems:

HW Status Exactly7
6 Multiple dissenters 0
7 Single holdout 1
8 Complete consensus 0

Exactly7 identifies the unique scenario: overwhelming support with precisely one objector. This is useful for:

  • Identifying the blocking vote
  • Detecting near-consensus states
  • Finding the single bit error in a codeword

Parameters

Component Weights Bias
AtLeast7 all +1 -7
AtMost7 all -1 +7
AND [+1, +1] -2

Total: 3 neurons, 21 parameters, 2 layers

Usage

from safetensors.torch import load_file
import torch

w = load_file('model.safetensors')

def exactly7(bits):
    inp = torch.tensor([float(b) for b in bits])
    atleast = int((inp * w['atleast.weight']).sum() + w['atleast.bias'] >= 0)
    atmost = int((inp * w['atmost.weight']).sum() + w['atmost.bias'] >= 0)
    comb = torch.tensor([float(atleast), float(atmost)])
    return int((comb * w['and.weight']).sum() + w['and.bias'] >= 0)

# One holdout at position 3
bits = [1, 1, 1, 0, 1, 1, 1, 1]
print(exactly7(bits))  # 1

# Complete unanimity - no holdout
bits = [1, 1, 1, 1, 1, 1, 1, 1]
print(exactly7(bits))  # 0

Contrast with 7-out-of-8

Circuit Condition Fires on
7-out-of-8 HW β‰₯ 7 HW = 7, 8 (9 patterns)
Exactly7 HW = 7 HW = 7 only (8 patterns)

The difference: 7-out-of-8 includes unanimity. Exactly7 excludes it.

Files

threshold-exactly7outof8/
β”œβ”€β”€ model.safetensors
β”œβ”€β”€ model.py
β”œβ”€β”€ config.json
└── README.md

License

MIT

Downloads last month
15
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including phanerozoic/threshold-exactly7outof8