I'm trying to teach openai's text-davinci-003 a new programming language based on BASIC. I'm feeding llama_index with a dozen text files explaining variables types, if/then/else blocks, PRINT/INPUT, how to comment code, and a few other things like numeric functions (min, max, abs, sgn, etc). The files are divided by topic.
I'm using a simple vector reading the documents stored in a folder as explained in the very first basic examples of llama index. There's also a service context with temp set to 0.7 and a prompt helper to to slightly tweak the initial settings.
When I ask davinci to explain a particular instruction or function, the result is usually good.
When I ask the AI to
write code that asks the user his age and then write a funny comment about his age category.
The code returned is actually rather good:
INPUT "What is your age?": Age
IF Age < 18 THEN
PRINT "You are a kid!"
ELSE IF Age >= 18 AND Age < 30 THEN
PRINT "You are young and wild!"
ELSE IF Age >= 30 AND Age < 50 THEN
PRINT "You are a grown-up!"
ELSE
PRINT "You are wise!"
END IF
But if ask the AI to do the same AND comment the code (I just add " and comment your code" at the end of the query, it will return something completely wrong either in JS or in C.
Any idea why a single additional simple order is enough to break a process that seemed to work ?