Repository navigation
The improvement on the metric #1462
acse-yl2020
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Dear dspy experts,
Hope you are doing well.
When you are looking at this thread, my hands are probably on my head to scratch some ideas out of it or somewhere else to make myself calm down:)
I am writing this to kindly ask your opinions on the potential reasons for the optimization process not showing any improvement during iterations. The performance metric remains constant, i.e.,
Scores so far: [96.78, 96.78, 96.78, 96.78, 96.78, 96.78, 96.78, 96.78, 96.78, 96.78, 96.78, 96.78, 96.78]
Best score: 96.78
It looks super suspicious:)
My code is designed to tackle complex mathematical problems. I don’t expect it to output a simple “correct” or “incorrect” result. Instead, I aim to have it generate the reasoning steps involved in solving each problem. This approach leads to two problems:
Please bear with my code—I'm not sure where should my hands be put :)
------------------------------------------------------ signature------------------------------------------------------------
Define the signature
class ScoNeSignature(dspy.Signature):
question = dspy.InputField(desc="......")
answer = dspy.OutputField(desc="The detailed, mathematically rigorous solution to the optimization problem")
explanation = dspy.OutputField(desc="Step-by-step explanation of the solution process", default="")
equations = dspy.OutputField(desc="Relevant mathematical equations in LaTeX format", default="")
------------------------------------------------------ CoT----------------------------------------------------------------
Update the CoT class
class CoT(dspy.Module):
def init(self):
super().init()
self.generate_answer = dspy.ChainOfThought(ScoNeSignature)
-------------------------------------------------------metric---------------------------------------------------------------
def metric(gold, pred, trace=None):
if hasattr(gold, 'questions'):
question = gold.questions
gold_answer = gold.answers
else:
raise AttributeError("Gold object doesn't have 'questions' attribute")
---------------------------------------------------# Set up the optimizer-------------------------------------------------------
config = dict(max_bootstrapped_demos=8, max_labeled_demos=8, num_candidate_programs=10, num_threads=4)
teleprompter = BootstrapFewShotWithRandomSearch(metric=metric, **config)
Compile and optimize the program
optimized_program = teleprompter.compile(CoT(), trainset=train_dataset)
What I'm currently considering is that the evaluation metric could be improved, as the LLM tends to give good scores to answers as long as the answer appears 'reasonable'. However, it seems that the modifications on the metric, i.e., promotor structure, do not provide any fix to the current situation. Do you have any suggestions? Or any suggestions in general?
Thanks 3000:)
All reactions