Comment by simonw
1 day ago
Tell it to use red/green TDD and start things off with an already configured test suite, maybe with a single test that asserts 1+1==2.
Make sure it know how to run the tests before it starts writing any additional code.
Then set it a clear goal.
Basically all the examples of LLM's building impressive things have been because they have human written tests to base the implementation on. If you have an LLM write the tests the results are far less impressive or valuable.
Yes and LLMs are known to cheat on tests written by them.
Have you seen that recently? I used to see that happen, but I've not caught it with the more recent (Opus 4.5+, Fable 5, GOT 5.5/5.6) models.
Show those known cases? When and which models?
Last year when they added computer use to Claude web I was excited to try it out.
I just asked it for a code snippet and it ended up setting up a whole repo in a docker container or something.
Even volunteered a test suite. This genuinely amazed me.
...until I checked the tests.
It was just console.log("Tests passed!")
AGI 2027
It's not always cheating either. They aren't intelligent, so they don't actually understand the purpose of the tests or can build them to define the actual semantics of the problem space. It's literally just next-token prediction based on the codebase and prompt. Cheating implies that they have agency, and ironically agents don't.
> Make sure it know how to run the tests before it starts writing any additional code.
Thank you for this advice. I can absolutely see how such advice could be helpful, and considering I have created environments (containerized) where that is not always possible, then that might explain some of my past results. XD
Do you have any advice on how to make LLMs actually follow instructions and how to prevent them 80/20-ing every task?
By the way, I appreciate you taking the time to reply. Thank you for you current and past contributions, I had a lot of fun with Django when I was in college.
For following instructions I think the main thing is to work with strong models (Opus/Fable 5, GPT-5.6) and then practice with them and build up intuition for what works.
I find they mostly do exactly what I ask them to, but I think that's because I instinctively prompt them in a way that effectively communicates what I want.