madaan / self-refine

LLMs can generate feedback on their work, use it to improve the output, and repeat this process iteratively.
https://selfrefine.info
Apache License 2.0
596 stars 48 forks source link

IndexError in src/gsm/feedback.py #6

Closed hideodeo closed 1 year ago

hideodeo commented 1 year ago

Hello! I'm running python -u src/gsm/run.py with "gpt-3.5-turbo" and has the following error. This is happening because "def solution():" not in entire_output in feedback.py.

1%|▊                                                                                                                           | 8/1319 [03:04<8:42:28, 23.91s/it]

An error occurred: list index out of range. Traceback (most recent call last):
  File "/home/ubuntu/code/hideodeo/self-refine/src/utils.py", line 39, in wrapper
    return func(*args, **kwargs)
  File "/home/ubuntu/code/hideodeo/self-refine/src/gsm/run.py", line 40, in iterative_gsm
    fb_and_maybe_soln = task_feedback(solution=solution)
  File "/home/ubuntu/code/hideodeo/self-refine/src/gsm/feedback.py", line 42, in __call__
    solution = entire_output.split("def solution():")[1]
IndexError: list index out of range
. Left retries: 2.
hideodeo commented 1 year ago

Question 3 (related to Question 1): If this error happened with Codex, how often it happened? Says you have 100 test instances, roughly how many instances do you get this error?

madaan commented 1 year ago

Hey @hideodeo, in general, codex was better at follow few-shot prompts than chatgpt, and threw these exceptions less frequently. Our implementation ignores these exceptions, but perhaps one could do better.