-
Notifications
You must be signed in to change notification settings - Fork 3
OptoPrime fixes: #2
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
Conversation
doxav
commented
May 30, 2025
- Prompt template fix to prevent frequent confusions of LLM between #Variables, #Input and #Code for trainable params
- construct_update_dict: more robust extraction (key matching, ast type conversion, error handling)
|
The CI error is normal, it uses current CI (the new CI has been pushed in the other PR) |
OptoPrimeMulti add async for multi candidates technique which are compatible
|
@doxav @allenanie Lets' merge this with the effort of branch opto_refactoring |
|
@doxav, I created a new version of OptoPrime with more robust parsing/extraction (it's called OptoPrimeV2). Do you mind merging this to the PR I created? |
|
I looked through the change -- this should be integrated into https://github.com/AgentOpt/Trace/blob/experimental/opto/trace/projections/code_projections.py @doxav's code is more robust than what we have right now! |
…ns/code_projections.py and tested with OptoPrime (modification to OptoPrime not commited)
|
@allenanie As per your request, I adapted it to projection. I let you modify OptoPrime V1/V2 with your own strategy. I did a quick test, it worked. My recommendations:
|
|
Thanks for the bump!!! I'll bring it up to @chinganc to see if he approves (because this is more of an aesthetic unification) |
|
So this is an interesting case. Currently, projections are assigned to nodes. Each (trainable) node can have some projections and that will be used in optimizer update. See https://github.com/AgentOpt/Trace/blob/65a0309475d08232f0dd2ec4640ec43b8964306d/opto/optimizers/optimizer.py#L57 What's proposed here is different. It's a post processing step for processing the suggestion str dict of OptoPrime.
|
|
@chinganc A little bit of context: When I initialy created tests/llm_optimizers_tests/test_optimizer.py and tested it with local small language models (phi-4), I often got basic optimizer failures due to formatting errors or proposition to train non trainable parameters. So I applied this code in OptoPrime,converting according to their type and filtering only on trainable params, this highly raised the success rate for SLM. I then moved it to projection following Nie suggestion in PR. I think it is a good default processing, custom projections can still be applied. |
… to projection (3.9 compliance and test __code)
Maybe this should be used as a generic post processor for OptoPrime. @allenanie does this help the V2? Can we apply this to also the XML output? |
|
Hi @doxav, I think the optimizer v2 APIs are finally getting finalized -- I'll take a look at this PR and see how the fixes can be applied! |
|
This should not be a projection, the initial code was to correct issue in extract_llm_suggestion and construct_update_dict which are still failing, this impacts OptoPrime / OptoPrimeV2 / OptoPrimeMulti. I should replace by this https://github.com/doxav/NewTrace/tree/more_robust_llm_extraction and make a PR then ? |