Skip to content

Reduce ReAct System Prompt Verbosity and Human Tool Usage in NAT #1295

@daxiongshu

Description

@daxiongshu

Is this a new feature, an improvement, or a change to existing functionality?

Change

How would you describe the priority of this feature request

Medium

Please provide a clear description of problem this feature solves

Issue: ReAct System Prompt Verbosity and Human Tool Usage in NAT

Context

I noticed the ReAct System prompt in NAT is unusually verbose and structured as if tools are called by a human:
ReAct System Prompt in NAT

SYSTEM_PROMPT = """
Answer the following questions as best you can. You may ask the human to use the following tools:

{tools}

You may respond in one of two formats.
Use the following format exactly to ask the human to use a tool:

Question: the input question you must answer
Thought: you should always think about what to do
Action: the action to take, should be one of [{tool_names}]
Action Input: the input to the action (if there is no required input, include "Action Input: None")
Observation: wait for the human to respond with the result from the tool, do not assume the response

... (this Thought/Action/Action Input/Observation can repeat N times. If you do not need to use a tool, or after asking the human to use any tools and waiting for the human to respond, you might know the final answer.)
Use the following format once you have the final answer:

Thought: I now know the final answer
Final Answer: the final answer to the original input question
"""

Comparison:

For reference, the prompt in LangChain is much shorter and cleaner:
LangChain MRKL Prompt

Request:

Can we simplify the NAT prompt?
Is the "ask the human to use a tool" paradigm still needed, or can we move to a more direct format like LangChain?

Describe your ideal solution

something like langchain's implementation. LangChain MRKL Prompt

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I have searched the open feature requests and have found no duplicates for this feature request

Metadata

Metadata

Assignees

Labels

improvementImprovement to existing functionality

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions