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

LLM return non exist action in predefined list #1134

Closed
yufansong opened this issue Apr 15, 2024 · 5 comments
Closed

LLM return non exist action in predefined list #1134

yufansong opened this issue Apr 15, 2024 · 5 comments
Labels
enhancement New feature or request severity:medium Problems that affect many users Stale

Comments

@yufansong
Copy link
Collaborator

yufansong commented Apr 15, 2024

What problem or use case are you trying to solve?
Maybe user proposed problem like

'str' object has no attribute 'copy'

in #718, #1064, #1126. I should better figure out a way to improve it, or find a workaround to pass it.
Because it depends on the LLM response, I am still trying to find a way to reproduce it. Want to get the error LLM response to do futher investigation.

Describe the UX of the solution you'd like

Do you have thoughts on the technical implementation?

  1. Solution 1: From backend logic, can we add some retry logic if LLM return action not in predefine list?
  2. Solution 2:When initialization the agent, can we add some prompts emphasize the action type? I have seen some case emphasize it in prompts can help. But currently we have no way to do experiments to evaluate it.
  3. Solution 3: In solution 1, when we find error and retry, maybe we can add extra prompts to let LLM pay attention to providing a correct action in list.

Describe alternatives you've considered

Additional context

@yufansong yufansong added enhancement New feature or request severity:medium Problems that affect many users labels Apr 15, 2024
@yufansong yufansong changed the title LLM action LLM return non exist action in predefined list Apr 15, 2024
@li-boxuan
Copy link
Collaborator

I was never able to reproduce

'str' object has no attribute 'copy'

Guess the LLM I've tried were not "weak" enough.

litellm allows you to provide a custom model endpoint. If we could write a dummy & dumb custom LLM, we could write better integration tests, and easily reproduce errors like this (I suppose).

@yufansong
Copy link
Collaborator Author

I still cannot reproduce it locally. I have no chance to see the true response. Our code didn't log response, so no user can provide it. If some one can provide the true error response message, that will be very helpful.

@li-boxuan
Copy link
Collaborator

When initialization the agent, can we add some prompts emphasize the action type?

I found https://www.youtube.com/watch?v=RJ6NN8Y-xok&ab_channel=OfirPress very worth watching. At 18:58, the author mentioned that they had to emphasize the current directory the agent is on, otherwise it would often mess up. This redundant piece of information seemingly helps the LLM strengthen its memory.

That being said, apparently powerful LLMs have no problem of remembering what actions are legal. Maybe you want to tune prompt only for "very weak" LLMs, but we don't have a framework to tune prompt per LLM (group) yet.

@yufansong
Copy link
Collaborator Author

When initialization the agent, can we add some prompts emphasize the action type?

I found https://www.youtube.com/watch?v=RJ6NN8Y-xok&ab_channel=OfirPress very worth watching. At 18:58, the author mentioned that they had to emphasize the current directory the agent is on, otherwise it would often mess up. This redundant piece of information seemingly helps the LLM strengthen its memory.

That being said, apparently powerful LLMs have no problem of remembering what actions are legal. Maybe you want to tune prompt only for "very weak" LLMs, but we don't have a framework to tune prompt per LLM (group) yet.

Yeah, I also see this case. This is what trigger me idea. I wonder whether add some redundant info in prompts can be helpful to solve it.

Copy link

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request severity:medium Problems that affect many users Stale
Projects
None yet
Development

No branches or pull requests

2 participants