LLM filtering some data from tool response.
# support
w
I've been notice a strange behaviour since a few months. We have a tool that returns a list of restaurants, in json format. The LLM constantly avoid saying the names of the restaurants when generating a message following the tool response. For example, look at the messages below: { "name": "get_restaurants", "role": "tool_call_result", "time": 1722870773304, "result": "Zia Lucia; Brasserie Blanc; Duck & Waffle; New Street Grill; Tinseltown; Emilia's Crafted Pasta; Cabotte; Barcelona Tapas Bar & Restaurant", "toolCallId": "call_kkxHmJO2KO9c2qxnwvgbzWOL", "secondsFromStart": 68.439 } { "role": "bot", "time": 1722870773417, "source": "", "endTime": 1722870805967, "message": "Hold on a sec. Here are some excellent dining options in the Aldgate East area. 1, known for its delicious pizzas with a variety of dough options. 2, offers classic French cuisine in a relaxed setting. 3, a unique dining experience with British and European dishes located high above the city with stunning views. 4, a great spot for steak and seafood lovers. 5, an American style diner with a wide range of comfort food. 6. Specializes in fresh handmade pasta dishes.", "secondsFromStart": 68.29 } It happens constantly. I have tried to return the data from the tool in json format, and also plain text, as in the logs above, but there no change in the behaviour. Is there some intentional filtering of names going on in background? You will also notice that in the bot generated message, there are information not provided by the tool. Those information were provided in the first version of the tool response, so it looks like the bot message has been generated from cached data somehow? Finally, if I have the tool to return something like "we do not have any restaurants in that location", the LLM correctly says that there are not restaurants available. I've tried all the different flavours of gpt4. Anthropic models seem to work correctly.
v
You can continue this conversation by mentioning me in the message.
@whitenoise Oh, I see what you're getting at. It sounds like there might be an issue with how the LLM is processing the tool's output. There shouldn't be any intentional filtering of names unless it's specified in the prompt or the tool's configuration. It's possible that the LLM is not correctly interpreting the output as it should. Regarding the additional information that's not provided by the tool, it's possible that the LLM is using its own knowledge to fill in details, which it's trained to do when it thinks it's necessary for a complete response. However, it should not fabricate details not present in the data provided by the tool. As for the caching issue, the LLM should not retain information between sessions, but if you're noticing behavior that suggests otherwise, it might be worth investigating further. For the issue with the restaurant names not being mentioned, I would recommend checking the prompt that's being sent to the LLM to ensure that it's asking the LLM to list the names explicitly. If the prompt is correct and the issue persists, it might be a good idea to reach out to support for a deeper look into the problem. If you need any further assistance or would like me to check anything specific, please let me know!
Got it. Tagging @User for additional help.
w
The system prompt is not intentionally instructing to filter names, and this behaviour has emerged a few months ago with no changes to the system prompt. Additionally, the prompt seems to work correctly with Anthropic models , meaning the names are not filtered.
s
call id please.
w
this one: 9f6bfe97-301f-4dd2-a23a-d2cb41c55c45
this other one: 83e0b424-6b84-47cf-bfc9-3f2d98ef9217 I have many more with the same issue if you need.
s
Copy code
json
  "results": [
    {
      "toolCallId": "",
      "result": "<insert-content-to-insert-in-hisotry->",
      "message": {
        "type": "request-complete",
        "role": "assistant",
        "content": "<insert-conent-to-speak-here>"
      }
    }
  ]
}
@whitenoise try this format.
w
hi, this format partially solves the issue because now the LLM say exactly whats it is in the context. The problem is that this way we miss out on the LLM capability to process data in put in JSON form and create a human description, following the instructions on tone, style and so on specified in the system prompt. So, the fix is not exactly fixing the problem.
Additionally, this is only happening with gpt4 models. Can you please exaclate this issue? It's quite blocking for us.
s
83e0b424-6b84-47cf-bfc9-3f2d98ef9217
i looked into this again and found out the model actually generated Definitely a memorable dining experience.. . Market Halls Victoria is a lively food hall with a variety of options from pizza to Thai street food. but till then call was ended.
9f6bfe97-301f-4dd2-a23a-d2cb41c55c45
for this call can you share the other model call id where it worked as you have expected because it is also generated response further.
@whitenoise i missed the logs by mistake.
s
Marking as complete because of no response.