Using In-Context learning, a language model can learn to solve a task using few examples. One could argue that the mere existence of examples is not sufficient for better performances. In fact, their representation is also important.
For that reason, a list of methods were proposed to better organise the examples in the prompt.
In this method, examples are organised in the same representation with the target
question. It is denoted by
Full Organisation with an underlying Code Representation Prompt
/* Given the following database schema : */
$ { DATABASE_SCHEMA }
/* Answer the following : How many authors are there ? */
SELECT count (*) FROM authors
/* Given the following database schema : */
$ { DATABASE_SCHEMA }
/* Answer the following : How many farms are there ? */
SELECT count (*) FROM farm
$ { TARGET_QUESTION }
It includes only SQL queries of the selected examples with a prefix instruction in the prompt.
This organisation method is used to maximise the number of examples thanks to its small tokens needed for each example. It is denoted by
It is recommended that the format of the prefix instruction be consistent with the question representation.
SQL Only organisation
/* Some SQL examples are provided based on similar
problems : */
SELECT count (*) FROM authors
SELECT count (*) FROM farm
$ { TARGET_QUESTION }
Dail Organisation, denoted by
DAIL organisation
/* Some example questions and corresponding SQL queries
are provided based on similar problems : */
/* Answer the following : How many authors are there ? */
SELECT count (*) FROM authors
/* Answer the following : How many farms are there ? . */
SELECT count (*) FROM farm
$ { TARGET_QUESTION }