by agentultra · 3y ago · 0 comments
We already write more code than we understand given how lowly the industry regards formal methods and how divided it is even on testing.
It is not surprising to me that Bertrand Meyer could miss that error in the code! A former colleague of mine challenged his grad students to implement an error-free version of binary search. He gave them the specification and verified each one: the majority of the submissions had errors. It’s a marvel that computers and software work so well.
And instead of tackling the problem of programming, as Dijkstra put it, we’re going to automate writing more code. Great.
See you in a few years when we can’t even keep up with the deluge of error prone programs.
Although we have gotten this far with very few proofs and models. Who knows, maybe we’ll just tolerate it?
It would be nice to have code synthesis work on larger examples from deep specifications. And models that understand proof tactics and can speed up the process of formalizing proofs. That would be nice.
I think the worst case of this situation will pop up before that; not writing code at all but just hook the AI up, ‘prompt engineered’ directly like so;
<body>
<script>doInsuranceForm();</script>
</body>
Which will AI generate a html insurance form every time the page is requested and handle the user input etc. And it’ll be subtly wrong most of the time; it’s insurance, who knows if the current programmed forms are correct anyway (I know of at least one insurer that rounds off $0.01 wrong almost every policy because of using float for money on the web side).Why have the AI make code we can read? Just let it do the entire thing /s
It’ll happen though and it will be used seriously by companies. The quality of the AI, legislation and public/consumer complaint fallout will determine if we get back to code that humans check. Being sceptical about humans wanting quality over paying as little as possible, I am going to say no.
I was in a class on Isabelle where we had to write and prove correct a binary search function. As I recall, everyone admitted that their first function didn’t work.
People often do (L+R)/2 but that can overflow. Using L+(R-L)/2 avoids the overflow problem.
This worries me. The problem of programming isn't that we're too slow at writing code. It's that we're not thinking critically enough about the problems we're solving. And the way we approach programming is to not fully understand what we're doing and derive joy from fixing the result of our neglect later on.
TFA touches on this a little but doesn't dive in deep: how do you know that your software does what you think it does? In such a small example, a world renown researcher missed an error! Several people did. In their current state, LLM's will gleefully give you wrong answers as if they're 100% correct and it is now your job to verify they are correct. Most programmers do not know how to write a proof or other sort of formally verifiable specification. How will they know that the code they are about to commit is correct?
For now, LLM's aren't capable of mathematical reasoning. You can't prompt it for a piece of code and then ask it to demonstrate it's reasoning or prove to you why the change is correct with regards to your specifications.
And to make matters worse, humans are terrible at finding errors in code. Empirical studies on large scale informal code review suggest that humans can only reduce error rates when reviewing somewhere in the realm of 200LOC every couple of hours. We're not effective at finding errors to begin with and our abilities drop precipitously if we read too much code. Now we're going to have an assistant that generates possibly correct code and we're going to have to proof-read hundreds of lines?
This does not seem like a good use of time or enhancing my productivity.
I think we need to wait until we can get ML models that understand proof tactics and kernels to help automate proofs. I would be much more willing to accept code from a bot that can demonstrate its reasoning and isn't simply generating code based off of statistical models. Computers are nefariously discrete machines and "almost right" isn't good enough in many, many cases.
What will enhance productivity, in my humble opinion, are better languages that let us write more precise specifications and can derive the code for us.
I think we should take advantage of any improvements we can get, that result in a net gain, for the individual. Programming is a practical endeavor. There’s no need to wait.
But I think most people will prefer the easy way out.
We will have to review code LLMs write, I don't doubt that, but the overall process should be faster. Additionally, they can review the code we write as well.
LLMs can find bugs in code, not all for sure, but they have the broad knowledge to be able to at least suggest lines of code that aren't working and why their reasoning.
How many hours per day can you stay focused on difficult (or at least non-boring) problems? And for how many years?
Whenever someone says "AI = productivity enhancer", I hear "AI = burnout accelerator".
https://rachelbythebay.com/w/2021/10/30/5tb/
If it takes away the boilerplate and the interesting problems leaving us with just with 5 TB problems then yeah, burnout city.
For burnout because of intense work, it could be that the movement to reduce the number of hours we work will come at the right time. 4 day work weeks at 100%, for example.
Lots of people experience burnout because writing boring code can be mind-numbing. Then there are people factors, such as a bad manager. Perhaps AI can give us more understanding management?
Like the US auto market - a once thriving ecosystem of fiercely competing innovative small businesses consolidated into 3 vertically integrated firms who now think innovation is building a slightly bigger truck.
Of course, they'll probably blame it on AI coz a story about the inevitable march of technological progress invites less government oversight of the abuse of market power, and we will no doubt be plied with plausible sounding stories to that effect.