Self-consistency (Wang et al., 2022) samples several reasoning paths at a non-zero temperature, then takes the answer most paths agree on. It replaces greedy decoding with a vote over diverse reasoning.
Implement majority_vote(answers), returning the most frequent answer with ties broken by first appearance.
Count occurrences, then return the answer with the highest count, scanning in order so ties keep the earlier one.
No results yet
Run your code to check it against the examples, or submit to run every test.