Cranial-XIX / llm-pddl

361 stars 32 forks source link

Cleaning LLM-generated pddl problem files #8

Open haomengz opened 1 year ago

haomengz commented 1 year ago

Thanks for the nice work!

I am wondering when you use LLM to generate pddl problem files, how do you handle the cleaning, i.e. removing the extra text other than pddl file. I have tried several LLM models and the pddl problem files would contain other text.

YuqianJiang commented 1 year ago

Thank you for your interest! I have found that adding this line to the prompt was enough for GPT-4: "Only return the PDDL file. Do not return anything else."

If you continue to get extra text, maybe you can try to parse the output and look for the start and end of PDDL code. For instance (define (problem ...) (:goal ...))