Majority Voting for Code Generation

📅 2026-04-16
📈 Citations: 0
Influential: 0
📄 PDF

career value

198K/year
🤖 AI Summary
This work addresses the limited accuracy and robustness of large language models in code generation under unlabeled test-time scenarios by proposing Functional Majority Voting (FMV). FMV constructs a consensus of functional equivalence among multiple generated programs based on their runtime execution signatures over test inputs, selecting a representative solution. Notably, it is the first method to employ such a consensus mechanism as an aggregation strategy for test-time reinforcement learning. Requiring no additional training or substantial computational overhead, FMV significantly improves pass@1 performance on LiveCodeBench, demonstrating its effectiveness as an efficient test-time inference mechanism. While it does not surpass the inherent capabilities of the base model, FMV establishes a novel paradigm for unsupervised code generation.

Technology Category

Application Category

📝 Abstract
We investigate Functional Majority Voting (FMV), a method based on functional consensus for code generation with Large Language Models, which identifies a representative solution from multiple generations using their runtime execution signatures on test inputs. We find that FMV is an effective test-time inference strategy, substantially boosting performance on LiveCodeBench without a large compute overhead. Furthermore, we extend the utility of functional consensus and apply it as an aggregation strategy for label-free Test-Time Reinforcement Learning. We demonstrate that this increases pass@1 on holdout tasks, but find no evidence of self-improvement beyond the base model's performance ceiling.
Problem

Research questions and friction points this paper is trying to address.

Code Generation
Functional Consensus
Majority Voting
Test-Time Inference
Reinforcement Learning
Innovation

Methods, ideas, or system contributions that make the work stand out.

Functional Majority Voting
code generation
test-time inference
functional consensus
Test-Time Reinforcement Learning
🔎 Similar Papers