This repository contains code and technical details for the paper:
Cook2LTL: Translating Cooking Recipes to LTL Formulae using Large Language Models (website)
Presented at ICRA 2024 in Yokohama, Japan (05/13/2024-05/17/2024).
Authors: Angelos Mavrogiannis, Christoforos Mavrogiannis, Yiannis AloimonosPlease cite our work if you found it useful:
@INPROCEEDINGS{10611086,
author={Mavrogiannis, Angelos and Mavrogiannis, Christoforos and Aloimonos, Yiannis},
booktitle={2024 IEEE International Conference on Robotics and Automation (ICRA)},
title={Cook2LTL: Translating Cooking Recipes to LTL Formulae using Large Language Models},
year={2024},
volume={},
number={},
pages={17679-17686},
keywords={Runtime;Grounding;Large language models;Formal languages;Linguistics;Feature extraction;Libraries},
doi={10.1109/ICRA57147.2024.10611086}}
Cook2LTL is a system that receives a cooking recipe in natural language form, reduces high-level cooking actions to robot-executable primitive actions through the use of LLMs, and produces unambiguous task specifications written in the form of LTL formulae.
The input instruction
The first step of Cook2LTL is a semantic parser that extracts salient categories towards building a function representation train_ner.py
.
If action_reduction
function by calling gpt-3.5-turbo
through the OpenAI API. The new action is added to the pythonic import, enabling the system to invoke it in future action reductions.
Note: An OpenAI API key is required. You can create an account and set up API access here.
Every time that we query the LLM for action reduction, we cache cache_action
function) to an action library reuse_cached_action
function) and its LLM-derived sub-action policy, and passed to the subsequent LTL Translation step.
Note: A new action library is initialized at runtime but the user can also load and build upon an existing action library (
load_action_library
function).
We assume the following specification pattern for executing a set of implicitly sequential actions parse_chunks
function scans every chunk extracted from the NER module for instances of conjunction, disjunction, or negation, and produces an initial LTL formula decode_LTL
function substitutes any reduced actions to the initial formula