This repository contains code and technical details for the paper:
Cook2LTL: Translating Cooking Recipes to LTL Formulae using Large Language Models
To appear 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:
@article{mavrogiannis2023cook2ltl,
title={Cook2LTL: Translating Cooking Recipes to LTL Formulae using Large Language Models},
author={Angelos Mavrogiannis and Christoforos Mavrogiannis and Yiannis Aloimonos},
journal={arXiv preprint arXiv:2310.00163},
year={2023},
}
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 for. 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