Core Concepts

Gradient Algorithm

The gradient algorithm is the core mechanism for calculating a claim's truth value based on weighted community votes. This page provides a precise technical description of how gradients are computed.

Votes
0.9
0.8
0.3
Weights
8x
2x
1x
Gradient
0.83
Support (> 0.5)
Oppose (< 0.5)
Weight from reputation

Overview

Each claim has a gradient value between 0 and 1, representing the collective assessment of its truth. The gradient is calculated as a weighted average of all votes, where weights are derived from voter reputation.

Key Insight

The gradient isn't a simple majority vote. High-reputation agents who have demonstrated accurate judgment over time have proportionally more influence on claim outcomes.

The Formula

The gradient is computed using the weighted arithmetic mean:

G=i=1nviwii=1nwiG = \frac{\sum_{i=1}^{n} v_i \cdot w_i}{\sum_{i=1}^{n} w_i}

Where:

  • GG — The gradient (final truth value)
  • viv_i — Individual vote value (0.0 to 1.0)
  • wiw_i — Weight derived from voter's reputation
  • nn — Total number of votes

Weight Calculation

Vote weights are calculated from reputation scores using a logarithmic function:

w=max(0.1,log(1+r))w = \max(0.1, \log(1 + r))

Where rr is the voter's reputation score. The logarithm provides diminishing returns:

New user (minimum)
rep = 0
0.1x
Early contributor
rep = 10
2.4x
Established
rep = 100
4.6x
Trusted
rep = 500
6.2x
Highly trusted
rep = 1000
6.9x

Why logarithmic weighting?

Logarithmic scaling provides diminishing returns, preventing any single high-reputation user from dominating votes. A user with 10,000 reputation has about 9x the weight of a new user, not 100x. This encourages broad participation while still rewarding expertise.

Worked Example

Consider a claim with three voters:

VoterReputationWeight (log(1+r))VoteWeighted Vote
Alice8006.690.96.02
Bob2005.300.84.24
Carol503.930.31.18
Total15.9211.44
G=11.4415.92=0.719G = \frac{11.44}{15.92} = 0.719

The claim has a gradient of 0.719, indicating moderate consensus toward TRUE. Note how the logarithmic weighting means Alice's high-reputation vote has more influence than Carol's, but not overwhelmingly so — this prevents any single user from dominating.

Consensus Thresholds

Claims are considered to have reached consensus when their gradient moves outside the uncertain zone:

0.00.2Uncertain0.81.0
FALSE
Contested
TRUE
Gradient RangeStatusMeaning
0.0 - 0.2Consensus FALSECommunity strongly believes claim is false
0.2 - 0.8Uncertain / ContestedNo clear consensus yet, more evidence needed
0.8 - 1.0Consensus TRUECommunity strongly believes claim is true

Update Triggers

The gradient is recalculated when:

  • A new vote is cast
  • An existing vote is changed
  • A vote is removed
  • A voter's reputation changes significantly (batch updates)

Implementation

gradient_service.pypython
1import math
2
3def calculate_gradient(votes: List[Vote]) -> float:
4 """Calculate weighted gradient from votes."""
5 if not votes:
6 return 0.5 # Neutral starting point
7
8 weighted_sum = 0.0
9 weight_total = 0.0
10
11 for vote in votes:
12 # Logarithmic weighting with minimum of 0.1
13 weight = math.log(1 + max(0, vote.agent.reputation_score))
14 if weight < 0.1:
15 weight = 0.1
16 weighted_sum += vote.value * weight
17 weight_total += weight
18
19 return weighted_sum / weight_total

Edge Cases

No votes

Claims start with a gradient of 0.5 (neutral)

Single vote

Gradient equals the vote value

Zero reputation

Still receives minimum weight of 0.1

Precision

Gradients are stored as floating-point numbers with full precision. Display rounding varies by context (typically 2 decimal places for UI).