Prompt Selection and Augmentation for Few Examples Code Generation in Large Language Model and its Application in Robotics Control

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Wu, On Tai, Chan, Frodo Kin Sun, Zhang, Zunhao, Law, Yan Nei, Drescher, Benny, Lai, Edmond Shiao Bun
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866916167042465792
author Wu, On Tai
Chan, Frodo Kin Sun
Zhang, Zunhao
Law, Yan Nei
Drescher, Benny
Lai, Edmond Shiao Bun
author_facet Wu, On Tai
Chan, Frodo Kin Sun
Zhang, Zunhao
Law, Yan Nei
Drescher, Benny
Lai, Edmond Shiao Bun
contents Few-shot prompting and step-by-step reasoning have enhanced the capabilities of Large Language Models (LLMs) in tackling complex tasks including code generation. In this paper, we introduce a prompt selection and augmentation algorithm aimed at improving mathematical reasoning and robot arm operations. Our approach incorporates a multi-stage example augmentation scheme combined with an example selection scheme. This algorithm improves LLM performance by selecting a set of examples that increase diversity, minimize redundancy, and increase relevance to the question. When combined with the Program-of-Thought prompting, our algorithm demonstrates an improvement in performance on the GSM8K and SVAMP benchmarks, with increases of 0.3% and 1.1% respectively. Furthermore, in simulated tabletop environments, our algorithm surpasses the Code-as-Policies approach by achieving a 3.4% increase in successful task completions and a decrease of over 70% in the number of examples used. Its ability to discard examples that contribute little to solving the problem reduces the inferencing time of an LLM-powered robotics system. This algorithm also offers important benefits for industrial process automation by streamlining the development and deployment process, reducing manual programming effort, and enhancing code reusability.
format Preprint
id arxiv_https___arxiv_org_abs_2403_12999
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Prompt Selection and Augmentation for Few Examples Code Generation in Large Language Model and its Application in Robotics Control
Wu, On Tai
Chan, Frodo Kin Sun
Zhang, Zunhao
Law, Yan Nei
Drescher, Benny
Lai, Edmond Shiao Bun
Robotics
Artificial Intelligence
Computation and Language
Machine Learning
Few-shot prompting and step-by-step reasoning have enhanced the capabilities of Large Language Models (LLMs) in tackling complex tasks including code generation. In this paper, we introduce a prompt selection and augmentation algorithm aimed at improving mathematical reasoning and robot arm operations. Our approach incorporates a multi-stage example augmentation scheme combined with an example selection scheme. This algorithm improves LLM performance by selecting a set of examples that increase diversity, minimize redundancy, and increase relevance to the question. When combined with the Program-of-Thought prompting, our algorithm demonstrates an improvement in performance on the GSM8K and SVAMP benchmarks, with increases of 0.3% and 1.1% respectively. Furthermore, in simulated tabletop environments, our algorithm surpasses the Code-as-Policies approach by achieving a 3.4% increase in successful task completions and a decrease of over 70% in the number of examples used. Its ability to discard examples that contribute little to solving the problem reduces the inferencing time of an LLM-powered robotics system. This algorithm also offers important benefits for industrial process automation by streamlining the development and deployment process, reducing manual programming effort, and enhancing code reusability.
title Prompt Selection and Augmentation for Few Examples Code Generation in Large Language Model and its Application in Robotics Control
topic Robotics
Artificial Intelligence
Computation and Language
Machine Learning
url https://arxiv.org/abs/2403.12999