I’ve spent a few weeks now trying to create an assistant that is able to answer questions reliably (not hallucinating, no overgeneralisation, not mixing simple things up), in a physics related space.
First thing I tried, after getting the recommendation from ChatGPT, was to add “fixes” to the prompt, for things that my agent got wrong. Yet, the more I followed that path and the more I added to the prompts, the more mistakes my assistant started to make. So, I followed my intuition again and only defined the persona and which sources it may use in the system prompt and tried to keep it minimal.
Yet, it would still happily overgeneralise every now and then. It usually takes two or tree runs (inputting the same data) and I get a wrong result. When I ask it, why it provided the wrong result, it usually states that it applied a principle that applies to a related category, but that doesn’t apply to the question it was working on.
In order to fix that I went to create functions, where the assistant persists relevant data to my backend, so it could load it when needed, and would see what type of thing it is working on, so it won’t be tempted to give answers that apply only to a different type. I am not 100% done with this, but it looks promising. Also I am trying to handle mathematical calulations as far as possible in my backend.
However now that the assistant isn’t overgeneralising, it starts to make simple mistakes, like “take the longer 4m, instead of the shorter 6m piece”. It can happen that it mixes up the same thing in a different way in the next sentence. Or it says: “take the long piece” and in the next sentence it explains why the 4m (short piece) is the right one.
I am getting the feeling that I am missing something fundamental here, but can’t figure out what it is. I had great results using ChatGPT to get advise for complex questions, so I thought I would be able to create an assistant doing the same thing. But I can’t figure out how to prevent the assistant from making mistakes all the time.
Temperature is at the lowest setting: 0.01. TopP: 1.0. I also had some success with adding an instruction to double check everything to the system prompt:
Important: Always use this 2 step process:
1. Create the answer
2. Test: Before finalizing the answer, double check whether all items that were conisdered in creating the answer are identical to the items in your mental model. Make sure no generalization has been applied. In case any discrepancy has been found, restart the process. Make sure that this test has been passed successfully before presenting any answer to the user.
However, it won’t solve such simple mistakes when it takes the short piece for the longer piece for instance. I found that it can help if I add a hidden user message to the thread, reminding it that it shouldn’t switch these things up when dealing with that part, but I can’t guard against every mistake it might make beforehand.
Has anyone run into a similar issue and found a way how to fix this?
