Skip to content

Updating MIPROv2 Auto Settings #8165

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 3 commits into from
May 3, 2025
Merged

Updating MIPROv2 Auto Settings #8165

merged 3 commits into from
May 3, 2025

Conversation

klopsahlong
Copy link
Collaborator

@klopsahlong klopsahlong commented May 3, 2025

This PR updates the MIPROv2 auto settings based on intuition we've formed on ideal run settings from past experiments.

The new auto settings are calculated by pinning the number of candidates we want to explore for each model in light, medium, heavy, modes to n=6, n=12, n=18 respectively. To calculate the number of trials needed for proper exploration of each candidate, we use the following formula: trials = max(c*M*log(n), c=2, 3/2*n), where M is the number of modules in a program. In non zero-shot settings, when both few-shot examples and instructions are being optimized, we set the number of candidate few-shot examples to n, and the number of candidate instructions to n/2.

The impacts of this change will generally be to ensure that light mode explores enough candidates to make an impact on performance, and to generally decrease the # of candidates explored in heavy mode, which we found was often unnecessarily high before.

@@ -349,7 +349,7 @@ def propose_instructions_for_program(

# Create an instruction for each predictor
for pred_i, predictor in enumerate(program.predictors()):
for demo_set_i in range(num_demos):
for demo_set_i in range(num_demos)[:min(N, num_demos)]:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only create up to N new instructions, not up to num_demos instructions (since now num_demos != N)

"heavy": {"num_trials": 50, "val_size": 1000},
"light": {"n": 6, "val_size": 100},
"medium": {"n": 12, "val_size": 300},
"heavy": {"n": 18, "val_size": 1000},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we now pin auto run settings to the number of candidates we want to evaluate in each setting, not the number of trials we're willing to spend

@klopsahlong klopsahlong marked this pull request as ready for review May 3, 2025 17:38
@okhat okhat merged commit 524a58f into main May 3, 2025
3 checks passed
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.

2 participants