threshold-exactly6outof8

Exactly-6-out-of-8 detector. Fires when precisely six inputs are active. The supermajority detector.

Circuit

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

The Three-Quarters Threshold

6/8 = 75% - a common supermajority requirement:

  • Constitutional amendments: Many require 2/3 or 3/4
  • Corporate bylaws: Often need 75% for major decisions
  • Consensus protocols: BFT systems often use ⌈2n/3βŒ‰

With 8 inputs, 6 is the first integer β‰₯ 75%.

Tolerance Analysis

Active Inactive Tolerance This circuit
5 3 Can lose 0 0
6 2 Can lose 1 1
7 1 Can lose 2 0
8 0 Can lose 3 0

Exactly6 detects the state with precisely one-defection tolerance. Lose any vote and you drop below supermajority. Gain any vote and you have margin to spare.

Dual of Exactly2

Circuit HW Count Bit-flip image
Exactly2 2 28 Exactly6
Exactly6 6 28 Exactly2

Flipping all bits maps pairs to sextets. Both fire on exactly 28 inputs.

The Veto Position

In a system requiring 6/8 supermajority:

  • 2 dissenters can block any action (they need 3 to pass minority position)
  • 6 supporters are exactly enough (no defection allowed)

Exactly6 catches this critical configuration - the minimum winning coalition.

Parameters

Component Weights Bias
AtLeast6 all +1 -6
AtMost6 all -1 +6
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 exactly6(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)

# Supermajority: exactly 6
bits = [1, 1, 1, 1, 1, 1, 0, 0]
print(exactly6(bits))  # 1

# Near-unanimity: 7 is too many
bits = [1, 1, 1, 1, 1, 1, 1, 0]
print(exactly6(bits))  # 0

Files

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

License

MIT

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

Collection including phanerozoic/threshold-exactly6outof8