MineDojo / Voyager

An Open-Ended Embodied Agent with Large Language Models
https://voyager.minedojo.org/
MIT License
5.53k stars 512 forks source link

Did you do any tests with an additional refactoring agent? #39

Closed TimeLordRaps closed 1 year ago

TimeLordRaps commented 1 year ago

From my experiences gpt-4 is quite good at refactoring code for reusability. Your current set of agents does influence reusability with the prompt action_template.txt and the third code criteria:

"Your function will be reused for building more complex functions. Therefore, you should make it generic and reusable. You should not make strong assumption about the inventory (as it may be changed at a later time), and therefore you should always check whether you have the required items before using them. If not, you should first collect the required items and reuse the above useful programs."

However, I find this influence lacking or nonexistent, though I'm confident without it, performance would likely degrade. With all this in mind. I think a complete agent for refactoring, while requiring another gpt-4 call, would be useful in extending hierarchical function composition as well as limiting the size of the skill library thus refining the top 5 skills returned to more meaningful skills. I still need to more deeply read the paper, look through the codebase more, and experiment to confirm my hunches. My capacity with OAI API is limited so if you did experiment with this at all and see any noticeable difference, please let me know before I proceed, if not any advice on where in the codebase to peruse to best get started would be equally appreciated. If this proves to be fruitful, next directions could be additions to the refactoring step that would use gpt3.5 to further the performance, I don't think more than one gpt4 call for the actual refactoring is necessary, but I do believe that a gpt3.5 call between code generation and refactoring could improve performance while maintaining low additional costs.

TimeLordRaps commented 1 year ago

I just compared my skill codebase from 104 iterations with the goal of beating the ender dragon and the checkpoint present in #27 and it seems like not setting the goal to open-endedness drastically impacts the performance on code reusability. I didn't change anything in any prompts to do with code reusability or refactoring, only the curriculum_qa_step1_ask_questions.txt's ultimate goal and curriculum.txt ultimate goal and criteria 7 to reflect a desire to find and stay in relevant locations to beating the ender dragon for only as long as necessary.

wangguanzhi commented 1 year ago

Hi @TimeLordRaps! I think a refactoring agent would be very useful. We haven't tried this before. Maybe you can do refactoring before adding a new skill to the skill library. But this may require additional verification to check whether the refactoring operation is correct. Let us know if you find any interesting behaviors. And thanks a lot for helping us make this project even better!!

go-maple commented 1 year ago

@wangguanzhi Bro, When you decide to open source. It's decided become more power than before :). It's very important for us.we both enjoy it.

but I want your team can create a channel to discuss in Discord.