[Simon Willison] has put together a list of how, exactly, one goes about using a large language models (LLM) to help write code. If you have wondered just what the workflow and techniques look like, give it a read. It’s full of examples, strategies, and useful tips for effectively using AI assistants like ChatGPT, Claude, and others to do useful programming work.
It’s a very practical document, with [Simon] emphasizing realistic expectations and the importance of managing context (both in terms of giving the LLM direction, as well as the model’s context in terms of being mindful of how much the LLM can fit in its ‘head’ at once.) It is useful to picture an LLM as a capable and obedient but over-confident programming intern or assistant, albeit one that never gets bored or annoyed. Useful work can be done, but testing is crucial and human oversight simply cannot be automated away.
Even if one has no interest in using LLMs to help in writing production code, there’s still a lot of useful work they can do to speed up the process of software development in general, especially when learning. They can help research options, interactively explore unfamiliar codebases, or prototype ideas quickly. [Simon] provides useful strategies for all these, and more.
If you have wondered how exactly glorified chatbots can meaningfully help with software development, [Simon]’s writeup hopefully gives you some new ideas. And if this is is all leaving you curious about how exactly LLMs work, in the time it takes to enjoy a warm coffee you can learn how they do what they do, no math required.
Beware, the problem might be the following:
These “chatbots” do take information from reliable human sources, such as coding forums.
But if less and less human coders remain, the quality of the imformation sources will degrade over time.
Eventually, results from “chatbots” will be taken as source of information by other “chatbots”.
And the wonderful, magic dream of AIs doing programmer’s work will eventually go “poof”.
Humanity doesn’t seem to realize that LLMs are a mirror of society, sort of.
They aren’t creative or deep thinking, but more like highly advanced filter stages.
^^ 2nd this.
ai trained on ai output have been found to degrade in their performance. not just llm’s but stable diffusion models as well.
To be fair, that’s also true of humanity and society as well as the internet in general, the enshittification of everything is in no small part due to self reinforcing bubbles feeding on their own output.
corollary to this that’s applicable right now: LLMs work way better with javascript and python than it does with, say, embedded C or verilog. brand new programming language? brand new embedded device? the LLMs don’t know anything, and won’t for a couple of years, at least.
Most of the code I see in coding forums is preceded by “this doesn’t work, what am I doing wrong?”
Not good training data I think.
Knowing something doesn’t work is a useful data point.
The multitude of replies implying ‘duh, you’re an idiot, me so smart’ less so.
The concerns about chatbot-produced code fail to take into consideration this reality: all human software developers occasionally write bad code. By this I mean code with errors or code that goes about doing what it does in a sub-optimal manner. This is why we test our code, or, better still, have others test our code. If all a developer did was submit code written by a chatbot, this code (assuming the developer described their needs in effective prompts) would be pretty good most of the time, and, better still, it would be produced quickly. But even if it were terrible, testing would filter out the bad stuff. So, because of these selective pressures, concerns about chatbots producing bad code is a little like worrying that creatures from a given environment might not all be perfect for that environment. Darwinian forces fix both problems, and we can look back on all the code produced in wonder, forgetting the survivor bias between our present and the past. Chatgpt doesn’t have to be right 100% of the time to be extremely useful. Anyone who has tried the alternatives (StackOverflow) can see the value in an extremely knowledgeable, cheerful, and, above-all fast, assistant.
It sure seems to me a ‘lazy’ way to code. I’d rather be creative (use my own brain) to come with a solution rather than have something else do it for me. Seems like you’d lose your ‘edge’, get ‘lazy’, get ‘sloppy’ about it and be mashing things together to get a maybe working system. No thanks. Nothing wrong with doing searches with standard search engines though for examples if you are really stuck (just like you do today). LLMs seem to be the ‘new math’ of computing coming our way :rolleyes: to our coding discipline.
Having experimented with these large language models a bit over the last year or so, they are good at some things, but awful at others, the issue being, they are stupid and like all stupidity, they are always absolutely sure they are correct. They will give you an answer most of the time, but you can never trust them to give you the correct answer. Precise wording can sometimes mitigate some of the inaccuracies but not all of them. I’m not sure what I fear more, the day these AI models get it right or the day we stop questioning whether they are getting it wrong.
Or, how about not blatantly stealing other people’s work?
There are zero, none, nada, ziltch, no useful models in existence that aren’t full to the gills with “non consensual” training data.
Anything they produce is poisoned, and can’t be used legally or ethicality, except for personal entertainment. And even that stretches the ethics.
I don’t care how far down the rabbit hole we are.
I don’t care how much work would need to be done to do it “the right way”.
We have to stop acting like this is okay, just because it is a clever little toy, and some executive wants to keep justifying their quarterly bonus.
LLMs and generative “AI” are theft, and a violation of consent.
Your brain is full with nonconsensual data.
Please appropriately track down and indemnify every author of every image, book, movie and sound you did not license, or delete it from your memory.
Utter nonsense, I buy books, pay to watch television, movies, theatre performances etc. etc. the data is licensed to me.
I am not allowed to post that data as my own or create derivative works from it without prior consent unless the license explicitly allows it.
I also consume free and open source data, for which there is almost always a license which may or may not permit me to modify and reuse it, with or without credit to the original creator.
Said licenses may also explicitly forbid the use for AI/LLM training.
It’s not a grey area, LLMs and AIs trained on data which wasn’t licensed to them are stealing and violating consent.
The difference is that an LLM can record much more completely, and more quickly, than the human brain. We retain concepts and ideas and general patterns, not complete works. And we have far less exposure to other people’s data, simply because it takes a long time to read and understand.
LLM’s will happily replicate other peoples work verbatim, with no regard for Copyright, or licencing restrictions. We can’t do that – at least not in high volume.