Using openai to solve Wordle

I am trying to come up with a prompt to pick a next word in the game of Wordle. I tried a whole bunch of variations of this basic format but it keeps picking words that include letters not in the word like caret or train (in this particular instance).

Play a game to guess a five letter word. After each guess you are told how close your guess is to the word. Your next guess should take into account the information from the previous guesses. Try to guess the word in as few attempts as possible.

Guess: crane
Result: The letters c, r and n are not in the word. The letters a and e are in the corrects places in the word.

Guess:

1 Like

I tried giving it even more information and it is spectacularly bad at this game, lol. I will try giving it a whole example of a complete game and try again.

Iā€™ve tried a few more prompt ideas and engines, but no better results:

1 Like

I would try including a bunch of examples of what you want to do in in the prompt, something like 50 shot learning. Show the guess progression at several different stages with desired completions. Get enough of these and you can find tune a model

1 Like

I think the problem here is that it is fundamentally adversarial. Itā€™s almost like youā€™d need two separate prompts or models running to do this rightā€¦ hmmmā€¦ thereā€™s an idea

What do you mean by that?

The hurdle here might even be more fundamental than the fact itā€™s an adversarial game. I tried a few variations of the prompt below and couldnā€™t reliably get it to generate words with specific letters excluded.

I wonder if it could ā€˜learnā€™ the rules given enough examples?

You have an agent with hidden information and a guesser trying to defeat it. Itā€™s basically a two player game, hence according to game theory itā€™s adversarial

3 Likes

I donā€™t think it understands word rules. Iā€™ve been trying to get it to write poetry ā€“ it knows what a sonnet looks like but it canā€™t grasp the rules behind a sonnet.

Things like syllables and letters seem to be beyond it, but Iā€™d happy to be proven wrong.

1 Like

Something I tried which was quite interesting was to reverse the game. Get openAI to settle on a 5-letter word and play according to the NYT rules. It chooses the word and you do the guessing. It will tell you letters are in the right place when they donā€™t exist and Vice versa. And when queried about itā€™ll say itā€™s sorry.

Its frustrating. I spent hours on this problem. It takes 3 minutes to solve wordle, but 2 hours of frustration trying to get ChatGPT to provide even the basics of a solution while keeping the letters in the correct order.

But I finally found a solution. An example. My first guess was stare. The second guess was rinseā€¦ The solution was ridge.

The only way that provided a solution was to ask it each time to create a compressive list of 5 letter words that ended in e. And after each subsequent guess, I just asked it to create a compressive list of words where R was the first letter( from second guess) and E was the last and didnā€™t contain n,s,t or a. (From first and second guess).

It provided a list and ridge was one of 10 words in the list that made sense to use. I was correct.

This only worked by asking it each time to create the list. Narrowing the words and possible choices. If you donā€™t ask each time, you will get stuck in a loop of words that donā€™t match the original criteria.

I hope this helps.

one simple change will probably improve the performance, wordle is part word game part letters game, if you give the letters of a word as a word i.e. ā€œpencilā€ then that is a single token to the AI, it will not look at it as a group of letters, replace ā€œpencilā€ with ā€œp-e-n-c-i-lā€ and you will get a very different response, maybe including both ā€œpencil, p-e-n-c-i-lā€ would be even betterā€¦ enjoy!