GPT-4 “discovered” the same sorting algorithm as AlphaDev by removing “mov S P”
twitter.com
twitter.com
That's good to see from GPT-4, but the comparison seems disingenuous, and I'd expect more from someone in academia.
And delivered with sarcasm and condescension. Not good to see, but par for the course on social media.
It's "close enough" to be worth trying to see if it hits on something useful, but also bad enough that you really need to carefully scrutinise what it comes up with, and probably need to write a much more comprehensive prompt about strategies it should and shouldn't try to apply to make it more generally usable.
My point of view on this is that this type of AI cannot reason, so it seems to me quite audacious to use it for programming. Following the AI's suggestion is like examining a PR from someone you don't know: don't they try to insert a backdoor or a subtle bug?
Even if you use it as some kind of "rubber duck", examining its suggestions - doing the necessary reasoning and the double checks - is pretty time consuming. Wouldn't the long term result be better if one spent some time to acquire a deeper knowledge of the field, rather than play the "prompt engineering" game (of which the rules might change next month)?
It feels like we are in the equivalent of programming language's "honey moon" [1] phase with this kind of technology. People will eventually get over the "wow" effect and use it for what it is good at.
"Would it be better to acquire a deeper knowledge"--for the cases described above, actually no? I already have that deeper knowledge. I don't have the attention span (both because this stuff can be boring and because I am frequently randomized) and for a lot of this stuff the gate is actually not solving the problem but the physical act of typing, or even copying and changing. Copilot, at least, absolutely does create bugs, but in my experience they're mostly bugs of the form "this actually isn't typesafe in the way that it's written" and that makes isolating and fixing them clear. (Rarely are those bugs logic bugs, just a burp in the output.)
There is a very clear future where this turns into incredible copy-paste garbage because it's not capable of refactoring, and that's a different problem. Avoiding it is why they pay us the medium bucks.
but it can answer the glass door push or pull question (see https://news.ycombinator.com/item?id=35506666), albeit a bit off (it didn't understand the mirrored writing).
But some other models had gotten the right answer.
This points to some evidence of being able to derive logical reasoning. Just because the model is "doing statistical guessing of the next word", doesn't mean this process does not produce logical reasoning as an outcome.
In one of my other responses I dug into how I'd asked it to analyse a piece of assembly generated with a compiler I've written, from a test program that didn't exist at GPT4's knowledge cutoff, and it did just fine.
Being capable of logic and reasoning is more of an illusion that arises as a result of the enormous amount of training they put in. You can make simple questions that it can't answer, so you can't claim it has logical reasoning if it fails at simple tasks. It just looks a lot like it has logical reasoning because it has been trained on text displaying logical reasoning.
Getting it to symbolically evaluate code it most certainly have never seen before has also worked well for me, as have getting to explain the hypothetical outcome of executing a piece of code written using a made up combination of two languages. Frankly, I've worked with plenty of developers who'd struggle to reason about simpler tasks than some of the stuff I've successfully thrown at GPT4, so I'd argue that if it can't reason then many humans can't either.
It also fails at some very basic things. The biggest challenge is that it's reasoning is different to humans, and it's terrible at some things we consider basic even as it can do other things at a far higher level.
> Wouldn't the long term result be better if one spent some time to acquire a deeper knowledge of the field, rather than play the "prompt engineering" game (of which the rules might change next month)?
"Prompt engineering" works best in fields you do have a deep knowledge of, where you can tell whether you're actually getting better solutions. I'm willing to put effort into that too is acquiring deeper knowledge of the field by exploring dependencies and getting an understanding of ambiguities of language we use to talk about a problem. While you can get bogged down in specific "incantations", the more important part of "prompt engineering" is getting better at recognising under-specified problems. In fact, one of the things I've toyed with is to feed it explanations of a problem and instead of asking it to solve it, I first ask it to suggest improvements and ask questions, and that will often reveal problems with the prompts with little effort.
With respect to assembler, it seems to hit one of the bad spots, in that you get far fewer textual structural hints. E.g. a label can be the start of a function or the start of a basic block, or part of a loop, or part of an if/else block, and you largely need to recognise contextual clues and know the patterns of whatever produced the asm to know which rules applies. E.g. one of the issues I ran into was that the asm I gave it was output from a compiler that used %esi in a very specific way. There was no way for GPT4 to know that from the sample it was given without "thinking it through" (see below), and it made a "guess" that many novice asm programmers also likely would've, but where someone more experienced would've stopped and demanded a confirmation of the calling convention.
That said, to the test I mentioned in the previous comment, I tried giving it the code in a fresh chat, and asked it to reason about the code, and to give me a list of information that I could provide that would make it easier to suggest optimisations.
When I explicitly asked it about the calling convention used for %esi in the code I gave it, it correctly reasoned its way through it by observing how it was treated within the given code. That's something an smart beginner at asm might spot, and an intermediate asm programmer pretty likely would spot, but the important part is that it was clearly able to explain why with references to the code.
It also when asked correctly recognised that the object was tagged (low bit used to indicate it's not a "real" pointer but a value object), and recognised vtable calling pattern that few developers without compiler experience would pick up on.
Frankly, after asking it these follow up questions my opinions on its understanding of asm is way up. It won't beat an experienced asm developer, but most developers I can ask questions of are not experienced asm developers, and even fewer knows the patterns it easily explained and reasoned about.
Apparently you haven't been following many academics on Twitter.
AlphaDev's optimization relies on the fact that B and C are already in the correct order. This precondition is missing from the prompt given to GPT-4. It seems that GPT-4 is hallucinating something that only resembles the correct optimization at first glance.
> However, in the lines following the removal, P should be replaced with S to maintain correctness.
While removing moves is a common optimization, it can't be done willy nilly.
As mentioned in the comment you replied to, the algorithm is wrong without the extra precondition B<C that is not included in the prompt, as should be clear from the fact that the largest value is computed as max(A,C) rather than max(A,B,C). This is the same precondition that allows to remove the move, effectively computing the smallest value as min(A,B) instead of min(A,B,C).
So the only correct answer to the prompt is to find a counterexample which does not sort correctly, for example 3 7 5. Not to remove an instruction randomly.
Another giveaway is that removing that line in the real optimization changes the output of the provided snippet if C < B. It feels like a hard sell to say GPT picked this line for that subtle reason based on information not provided, but explained it with something only correct at surface level.
Edit: I found the merges for sorting (Jan 2022) [1] and hashing (Jan 2023) [2]. Both of these are very plausibly in the training set for GPT-4, which was frozen sometime in March 2023.
[1] https://reviews.llvm.org/D118029
[2] https://github.com/abseil/abseil-cpp/commit/74eee2aff683cc7d...
> GPT-4 generally lacks knowledge of events that have occurred after the vast majority of its data cuts off (September 2021)
Isn't it necessary for GPT-4 to have had the optimization somewhere in its training set given how it works?
> AlphaDev uncovered faster algorithms by starting from scratch rather than refining existing algorithms
Finding that specific optimization, especially when given the comments, seems almost trivial by comparison.
Edit: I tried to understand the optimization in question. This is not the full sort3 algorithm, but only under the assumption that B < C. In that case the GPT-4 answer is actually wrong because it wasn't given that assumption.
When it screws up, we call it a hallucination. With careful prompting, you can get it to screw up in a way that works.
Color me unimpressed.
My point being, we are the result of a bunch of DNA molecules selected to make more copies of itself. Our neurons, whatever their internal structure, still reduce to just chemical and physical processes. Yet, here we are. Reductionism is not the way to dismiss emergent phenomena like intelligence, sentience or consciousness.
ChatGPT-4 “knows” it is an LLM and and that temperature=0 implies a less chaotic more ordered way of thinking. I can easily see that having an effect on what it says
Lots of bitshifting and unsigned ints and approximations these days. Stuff I would have never thought of, and then I can talk it through how something else only I thought of would be even more applicable, and it refines it for that too! Great pair programmer!
This level of competence will never show up in a live no-resource interview or any (watched) time trial I do.
Still very impressive, but I'd like to see it work on some other assembly for which the "answer" isn't already known.
Edit: done. Not sure how I missed that. Thanks!
This may however be distinction without a difference, since it corrodes the intellectual form of neither, and the processes are indistinguishable.
Discovery is principally a learning process (that may entail creative effort). Invention is principally a creative process (that may entail learning effort).
The second statement is similar but highlights the problematic distinction of the terms, since in such a framing they ascribe meaning solely and specifically to human intellectual processes, so one must also show either that we are alone in the universe, or (perhaps equally) that all cognitive entities share the same processes. This is of course merely dancing around questions of the universality of truth. Alas, only Wittgenstein knew the answer.
With Gödel, there is the space of the possible, the invention indeed being the axiomatic foundation that engenders the space of possibilities. If the space of possibilities is disconnected, intuitive jumps are required to arrived at unreacheable truths. So yes, here we are 'discovering' -- learning the membership set of true statements -- but these are existing things only in the context of the invention, which is why it is correct to say they are discovered in a relative sense.
This is hiding the assumption in plain sight in a different form. The question then would be: was x an existing thing that we "uncovered"/discovered (it has merely hidden) or we created it by thinking it into existence?
At least in terms of Mathematics, I do not think there is an objective answer for this question.
The definitions you provided are, IMO, just moving the problem to further concepts, that are also ill-defined. "Discovery mainly a learning process, Invention mainly a creative process", could mean almost anything. Also, as a rigorous definition, "mainly" does not cut it. It needs to be 100%.
Instead of pretending I know it is my opinion to accept they are merely two ways of looking at the same thing. At least, this is my position for now, until a proper argument emerges.
P.S. I see it as arguing which of 0.5 or 1/2 is the "true" number.