jagilley / fact-checker

Fact-checking LLM outputs with self-ask

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open Question: Fact Checking LLM

GvdDool opened this issue · comments

Hello,
On your repo, there is no discussion tab, so I am opening an issue as a question, and I hope that this is fine.

I found this package/page while looking into a method to check if the results I am getting from my LLM (google PaLM) are reliable. The questions I am asking are very specific, and I suspect many answers will be laced with hallucinations, which is understandable considering the training set and the narrow knowledge domain I am accessing with my question.

The questions I am asking are about educational institutes teaching a specific topic, by country, in pseudo-code:

Loop over all countries
By country, give a list of educational institutes teaching the specific topic
By educational institute, give the (degree) program in which the specific topic is taught
By program, give the modules part of this program
As you can see, this is a very specific line of questioning, and because we don't know if the model has documents specific on these parameters, I am looking for a method to verify that the answer to the third step is correct, because when false the list of modules is also false. Do you think your package can help me with this, or do you know there is another method more appropriate to check the results?

Thanks in advance for looking into this!

@jagilley in your notebook you are calling:
from langchain.llms import OpenAI
llm = OpenAI(temperature=0.7) # I would need to set this to 0.0 to be deterministic

I am not using OpenAI, but Google PaLM, which should be the same (if supported by langchain), but don't you need to add a key for OpenAI? If not, then this would be a great check, because the recommendation for fighting hallucinations is to use a second model to fact-check.

I hope you can help me set this up, as I am new to the world of LLM.

Hi @GvdDool, just seeing this now. I wouldn't recommend this approach anymore frankly. But you should be able to switch it out by using environment variables for the keys plus langchain

@jagilley that's interesting, why are you saying: "I wouldn't recommend this approach anymore frankly", what made you change your mind?

I am not exactly following your code, but are using the following:
from langchain.chains import LLMCheckerChain