-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat (multi-agent): add reasoning type for the role playing module: react #408
base: master
Are you sure you want to change the base?
Conversation
I will add more examples to demonstrate the performance improvements made by the new prompt, hoping that we can verify the enhancements through so-called human feedback. |
Comparison of the outputs generated by the original prompt and the latest prompt (GPT-4-turbo)Here are 6 responses generated by the GPT-4 model based on both the modified prompt (the latest prompt) and the original prompt. The initial parts of all responses are listed below. Overall, the modified prompts draw inspiration from the react approach and further refine concepts such as "instruction, input, etc." which make the agent's responses more actionable and detail-oriented when solving problems. Additionally, thanks to "React", the agent demonstrates stronger reasoning capabilities.
|
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
This prompt template looks more like ReAct instead of CoT (whose prompt can be as simple as "think step by step"). However it is not exactly ReAct, which consists of a sequence of thoughts, actions, and observations. I suggest to consider renaming this to avoid confusion, and add basic CoT as a baseline prompt. I also suggest to add additional few-shot examples (e.g., example responses w/ and w/o function calling) in the template. |
Thanks for your comments, really helpful. I will modify it according to them. When I complete it (it may take some time), I will pin you. Thanks. |
…generators.py and camel/prompts/ai_society.py
… of thought in test_ai_society_example.py
… of thought in test_ai_society_example.py
@ZIYU-DEEP Hello, I've changed the prompt's reasoning type to
Regarding the function calls, could you please clarify 'example responses with and without function calling'? Thank you! |
thanks @Appointat, the current pull request looks good in general! i will take a closer look at it later this week. for 'example responses', i was originally thinking about adding few-shot examples in the prompt template. see discussions in the original paper for its effect in performance improvement (https://arxiv.org/pdf/2210.03629.pdf). however, those in-context learning examples usually need to be task/environment-specific, which cannot be the case here. just plain templates should be fine! for 'with or without function calling', langchain has a simple example with function calling for environment interaction: https://api.python.langchain.com/en/latest/agents/langchain.agents.react.agent.create_react_agent.html. |
Thank you so much for your follow-up. I will read the documents/pagers you provided and take your advice, in a few days. |
Hey @Appointat , I think for ReAct agent we have to combine function call to let the agent be able to do the real action. You can refer to https://github.com/dair-ai/Prompt-Engineering-Guide/blob/main/notebooks/react.ipynb and https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/agents/react/agent.py |
Dear @camel-ai/camel-maintainers , |
Hi @ZIYU-DEEP and @Wendong-Fan, thanks for your replies. As I mentioned earlier, this PR aims to integrate the react method into role-playing. Given the fact of the continuous interaction in role-playing, we must tailor the method to fit the current context in camel. One difference is that normal react involves only one agent, while camel role-playing includes two agents. Normal react:
camel react:
So I insist the modification personally. |
Description
This PR introduces substantial improvements to the role-playing module's prompts in our large language model (LLM). The changes are designed to enhance the clarity, structure, and interactivity of the role-playing experience. The updated prompts provide more explicit instructions and a clearer framework for the interaction between the user and the assistant, focusing on a task-oriented approach.
Motivation and Context
The enhancement of the role-playing module's prompts was necessitated by user feedback and observed interactions indicating a need for more structured and clear guidance in task-oriented role-play scenarios. The previous prompts lacked specific action-oriented instructions and a clear task completion signal, leading to potential confusion and less effective role-play interactions.
Example of One Round of Role-Playing
Analysis
The new output showcases a structured approach to role-playing, where the AI User and AI Assistant engage in a clear, task-focused interaction. The prompts guide the AI Assistant to not only provide solutions but also to perform specific actions, enhancing the clarity and effectiveness of the interaction.
Structured Interaction: The interaction follows a clear structure, with defined roles and specific instructions, leading to a more organized and focused conversation.
Action-Oriented Responses: The AI Assistant not only provides information but also outlines the actions to be taken, demonstrating a deeper level of engagement and understanding of the task.
Task Completion Signal: The use of "Solution&Action" and "Action" sections clearly delineates the response and the actionable steps, guiding the AI Assistant toward task completion.
This structured and action-oriented approach ensures that the role-playing module is more user-friendly and effective in achieving task-oriented goals.
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Implemented Tasks
Checklist
Go over all the following points, and put an `x’ in all the boxes that apply. If you are unsure about any of these, don't hesitate to ask. We are here to help!