Added feature to enable GEPA to see the full program trajectory, instead of just seeing the target predictor#15
Conversation
9af967b to
c7dfefd
Compare
|
@TomeHirata Could you also review this one when you get time |
| trace_for_pred = [(predictor, predictor_inputs, predictor_output)] | ||
| # Pass the full captured trace to enable trajectory-aware metrics | ||
| # For backward compatibility, metrics that only use pred_trace[-1] still work | ||
| trace_for_pred = captured_trace if captured_trace else [(predictor, predictor_inputs, predictor_output)] |
There was a problem hiding this comment.
What's the intention of this change? metric_fn will receive duplicated information for captured_trace and trace_for_pred, which is not the intended behavior of gepa optimizer
There was a problem hiding this comment.
Made a change here. Now, it will search captured_trace to find the entry matching the current predictor call (using object identity of predictor_inputs and predictor_output) and then slices trace to include only entries up to and including that match. But, in case its not working then it will fallback to captured_trace. I am not sure what to do in case of fallback.
There was a problem hiding this comment.
I'm not sure if that change is necessary. We can have the same logic in metric function if needed.
There was a problem hiding this comment.
Can you tell then hoe excatly I should incorporate them? I am not getting how to do it.
This PR is related to feature implementation mentioned in #11
Implementation Details:
trace_for_predinfeedback_fn_creatorto pass the completecaptured_traceinstead of creating a single-element list