
Self-consistency majority vote (Kamath Ch 4)
Source:R/kamath_llm2_native.R
morie_kamath_self_consistency.RdMode of the parsed answers; ties are reported and broken by first appearance, exactly as in Python.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_kamath_self_consistency(V)
#> $answer
#> [1] "1"
#>
#> $votes
#> [1] 1
#>
#> $agreement
#> [1] 0.125
#>
#> $counts
#> 1 2 3 4 5 6 7 8
#> 1 1 1 1 1 1 1 1
#>
#> $tie
#> [1] TRUE
#>
#> $tied_answers
#> [1] "1" "2" "3" "4" "5" "6" "7" "8"
#>
#> $n_unparsed
#> [1] 0
#>
#> $n_voted
#> [1] 8
#>
#> $estimate
#> [1] 0.125
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "Self-consistency majority vote over parsed answers"
#>