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

ontogpt may cache LLM's "errors"/inconsistent output #49

Open
leokim-l opened this issue Sep 18, 2024 · 3 comments
Open

ontogpt may cache LLM's "errors"/inconsistent output #49

leokim-l opened this issue Sep 18, 2024 · 3 comments

Comments

@leokim-l
Copy link
Member

Sometimes calls to GPT did not explicitly fail, but returned empty, which for practical purposes is a failed call, see image below. Thanks to
https://github.com/monarch-initiative/malco/blob/653291d119a5fffb31b2779b8a52221dadfea50e/src/malco/run/search_ppkts.py#L29-L31
they would be considered as unsuccessful, because there was no grounding. Rerunning the same phenopacket again, however, meant trying to ground the same empty reply over and over, since the output of the LLM had been cached. Solved by manually removing .litellm_cache.
image

Again, more of a reference for me, but @caufieldjh you may be interested in ontogpt UX

@caufieldjh
Copy link
Member

Hrm, in practice this shouldn't matter except in cases where the phenopacket doesn't parse for stochastic reasons, because any change in the way the prompt is submitted will cache a new response. But I see what you mean. Perhaps the extracted output needs its own error flag.

There are cases where a lack of grounding is expected or desirable, but we can definitely avoid caching responses with no content.

@leokim-l
Copy link
Member Author

Hmm, I am not 100% sure I understand.

So, just to make sure we understand each other: I am inclined to think the prompt we sent out made sense, but the LLM at hand returned an empty list. When ontogpt gets an empty list to ground, it obviously fails. When running the same prompt again, we get again the same cached empty list (funny that the numbers, such as "1. \n 2. ... " are there, which technically makes it a non empty reply) , then pass that on to ontogpt (sorry :P) and it obviously fails again. When removing .litellm_cache the effect was that the prompt would be sent again, this time returning a meaningful answer, which would then be forwarded to ontogpt for grounding.

@caufieldjh
Copy link
Member

Ah, that's right - I forgot the initial prompt and the grounding were decoupled here. Either way, the empty responses don't need to be cached, and that's something I can fix in ontogpt.

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

2 participants