Skip to content
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

[Bug] Prompt construction of class ToolLLaMA and ToolLLaMALoRA #304

Open
yuyq18 opened this issue Sep 2, 2024 · 0 comments
Open

[Bug] Prompt construction of class ToolLLaMA and ToolLLaMALoRA #304

yuyq18 opened this issue Sep 2, 2024 · 0 comments

Comments

@yuyq18
Copy link

yuyq18 commented Sep 2, 2024

The prompt construction code of toolbench/inference/LLM/tool_llama_model.py#L97-#L103:

for message in conversation_history:
    role = roles[message['role']]
    content = message['content']
    if role == "System" and functions != []:
        content = process_system_message(content, functions)
    prompt += f"{role}: {content}\n"
prompt += "Assistant:\n"

When the role is assistant, the content included in the prompt only contains the Thought and excludes Action and Action Input. This is because the action details are stored in the function_call key of the message.

Here is the code of conversation_history construction in toolbench/inference/LLM/tool_llama_model.py#L116-#L123:

message = {
    "role": "assistant",
    "content": thought,
    "function_call": {
        "name": action,
        "arguments": action_input
    }
}

This bug results in the assistant portion of the prompt during inference being inconsistent with the prompt used during training, potentially leading to decreased evaluation performance.

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

No branches or pull requests

1 participant