Closed GabrielFritz closed 6 months ago
I have had similar experience when the agent abruptly jumped into conclusions. It seems to be quite random.
similar problem here
I'm facing the similar issues here while i'm using initialize_agent function with AgentType.CHAT_CONVERSATIONAL_REACT_DESCRIPTION.
Hi, @GabrielFritz. I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.
Based on the information provided, it seems that the issue is related to the agent jumping to conclusions even when the necessary information is not available in the intermediate steps. Several other users have also reported similar experiences. However, the issue remains unresolved at this time.
If this issue is still relevant to the latest version of the LangChain repository, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself. Alternatively, if no action is taken, the issue will be automatically closed in 7 days.
Thank you for your understanding and contribution to the LangChain project. Let us know if you have any further questions or concerns.
Dosu, the way you've described this misconstrues the issue, as it implies that the agent is making irrational judgements, which would simply be a matter of training or prompt guidance.
The problem here is that the agent is requested to produce tokens even after it should have stopped, and continues to extrapolate its predicted answer to its query as part of the "log" it believes itself to be encountering. The agent could emit a stop token in this circumstance, but teaching a network to do that is significantly harder than using something like Microsoft/Guidance to ensure that the inference stops when it completes its evaluation.
More critically, parsing should not fail when this occurs; the library code here should be capable of noticing that the agent has jumped the gun, and ignore whatever tokens occurs past what appears to be an erroneous prediction. As it stands, LangChain simply retries or outright fails, wasting energy, compute time, and potentially valuable responses which simply had excess enthusiasm.
P.S. Whoever thought "stale bots" were a great idea, stop it. Just stop.
@baskaryan Could you please help @Dessix with this issue? It seems that the agent is continuing to produce tokens even after it should have stopped, leading to parsing failures. @Dessix also suggests using Microsoft/Guidance to ensure that the inference stops when it completes its evaluation. Thank you!
Hi, @GabrielFritz,
I'm helping the LangChain team manage their backlog and am marking this issue as stale. From what I understand, the issue addresses an agent's tendency to jump to conclusions without having the necessary information in intermediate steps, as observed in the provided code. There have been discussions involving other users, including lifan0127, xinj7, and tmin97, reporting similar experiences. The issue was marked as stale previously, but it seems that Dessix has clarified that the problem is not about irrational judgments but rather the agent's failure to stop producing tokens when it should. The suggested solution is to use Microsoft/Guidance to ensure the inference stops when it completes its evaluation. Dosubot has requested baskaryan to assist with the issue.
Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you!
Hello!
I was following the recent blog post: https://blog.langchain.dev/custom-agents/
Then I noticed something. Sometimes the Agent jump into the conclusion even though the information required to get this conclusion is not available in intermediate steps observations.
Here is the code I used (pretty similar to the blogpost, but I tried to modify a little the prompt to force the Agent to use just the information returned by the tool):
Input: What is Leo DiCaprio current relationship status?
Output:
Extra thing I noticed: When the Agent was a pirate like in the blogpost, I made the wikipedia search return "I love rum". In this scenario, I was able to enforce the agent to keep calling the tool, instead of jumping into the conclusion. It reached the max retries and failed. BUT with wikipedia search working fine, seems that the fact that the observation has some information about the question (in my case, DiCaprio's information, even if the information has nothing to do with the question), it kinda got more confidence into jumping into conclusions. Does this make any sense?
Does anyone found a way to solve this?