Skip to content

Add majority voting plugin for candidate selection #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 10, 2025

Conversation

codelion
Copy link
Owner

@codelion codelion commented Jul 8, 2025

Introduces a plugin that generates multiple candidate solutions using the OpenAI API and selects the most frequent answer via majority voting. Includes answer extraction, normalization, and a summary of the voting process. Useful for tasks with discrete answers such as math, coding, and multiple choice problems.

fixes #201
superseeds #83

codelion added 6 commits July 8, 2025 20:27
Introduces a plugin that generates multiple candidate solutions using the OpenAI API and selects the most frequent answer via majority voting. Includes answer extraction, normalization, and a summary of the voting process. Useful for tasks with discrete answers such as math, coding, and multiple choice problems.
Enhanced the extract_answer function to better handle LaTeX boxed answers and multiple choice patterns. Moved majority voting summary from being appended to the response to logging via the logger, ensuring cleaner output.
Introduces a new MLX-compatible ThinkDeeper implementation (`thinkdeeper_mlx.py`) and integrates it into the inference pipeline for MLX models. Updates the inference logic to select the appropriate ThinkDeeper version based on the backend, and refines fallback and error handling for MLX generation. The evaluation script is updated with new test-time compute scaling approaches, including revised ThinkDeeper and majority voting configurations, and improved reporting for test-time compute experiments.
Updated best_of_n_sampling, mixture_of_agents, and majority_voting_plugin to handle providers that do not support the 'n' parameter by generating completions/candidates one by one in a loop. This improves compatibility with a wider range of API providers and ensures robust completion generation even when batch generation is not available.
Update version number in __init__.py and setup.py to 0.1.20 for new release.
@codelion codelion merged commit ad262d8 into main Jul 10, 2025
1 check passed
@codelion codelion deleted the feat-maj-at-k-plugin branch July 10, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement majority vote for parallel inferences
1 participant