Program - Aided Language Models (PAL)
Gao et al. (2022) proposed a method of using large language models (LLMs) to read natural - language questions and generate programs as intermediate reasoning steps, which is called program - aided language models (PAL). It is different from chain - of - thought prompting in that instead of using free - form text to obtain solutions, it offloads the problem - solving steps to a programming runtime similar to a Python interpreter.
Take LangChain and OpenAI GPT - 3 as examples. We are interested in developing a simple application that can interpret the proposed questions and provide answers with the help of a Python interpreter. Specifically, we aim to create a function that allows using an LLM to answer questions requiring date comprehension. We will provide the LLM with prompts that include some examples (the examples are adopted from [here](opens in a new tab)).