threshold-atmost6outof8

At-most-6-out-of-8 detector. Fires when 6 or fewer inputs are active. The near-unanimity blocker.

Circuit

  xβ‚€ x₁ xβ‚‚ x₃ xβ‚„ xβ‚… x₆ x₇
   β”‚  β”‚  β”‚  β”‚  β”‚  β”‚  β”‚  β”‚
   β””β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”Όβ”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”˜
               β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚ w: -1Γ—8 β”‚
          β”‚ b:  +6  β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
           HW ≀ 6?

Detecting Non-Consensus

This circuit fires unless near-unanimity or unanimity is achieved:

HW AtMost6 Status
0-6 1 At least 2 dissenters
7 0 Single holdout
8 0 Unanimous

It identifies states where meaningful opposition exists.

The Two-Dissenter Minimum

For something to pass AtMost6:

  • At least 2 inputs must be inactive
  • At most 6 inputs can be active

This is the threshold for "blocking minority" in many systems.

Coverage

Nearly everything passes:

HW C(8,k) AtMost6?
0-6 247 Yes
7 8 No
8 1 No

Total: 247 of 256 inputs (96.5%).

Dual of AtLeast2

Circuit Condition Fires on
AtLeast2 HW β‰₯ 2 247 inputs
AtMost6 HW ≀ 6 247 inputs

Both fire on almost everything. AtLeast2 misses empty/singleton; AtMost6 misses near-unanimous/unanimous.

Parameters

Component Value
Weights all -1
Bias +6
Total 9 parameters

Usage

from safetensors.torch import load_file
import torch

w = load_file('model.safetensors')

def atmost6(bits):
    inp = torch.tensor([float(b) for b in bits])
    return int((inp * w['weight']).sum() + w['bias'] >= 0)

# Supermajority with 2 dissenters
print(atmost6([1,1,1,1,1,1,0,0]))  # 1

# Single holdout
print(atmost6([1,1,1,1,1,1,1,0]))  # 0

Files

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

License

MIT

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

Collection including phanerozoic/threshold-atmost6outof8