Live data from Hacker News

Large language models do not recognize identifier swaps in Python

arxiv.org

61–70 of 103 posts

Re: Large language models do not recognize identifier swaps in Python

#61
post #45

Earlier quoted context omitted.

Humans make foolish, nonsensical mistakes too. Does that mean that they're not intelligent and not sensitive to the meaning of the code?

We already know that humans are sensitive to meaning. That's not a hypothesis that needs testing.

This experiment only proves LLMs are sensitive to meaning too. It was also already known.

Re: Large language models do not recognize identifier swaps in Python

#62

Earlier quoted context omitted.

I think the issue is just that, however silly or pointless the puzzle is, it's clearly understandable by any human who knows Python. You just use "len" any time you mean "print", and "print" any time you mean "len". And these large language models, despite being language models, simply cannot handle this concept.

Going to paste together snippets from comments on this thread. This bit is from the paper. > Typical programming languages have invariances and equivariances in their semantics that human programmers intuitively understand and exploit, such as the (near) invariance to the renaming of identifiers. This is bullshit lol. Identifier renaming may be a no-op for the code, or even for the compiler/interpreter, but it's abso…

@TeMPOraL and @og_kalu are the same people right?

Re: Large language models do not recognize identifier swaps in Python

#63
Every time somebody posts a negative result on LLMs' capabilities like that, somebody will go on HN, on Twitter, on Reddit, etc, and post an example where they get an LLM to produce a counter example of the negative result. Crucially, this follow-up "rebuttal" always seems to use a different prompt than the one in the original experiment.

What can we conclude from that kind of sequence? We can conclude that neither the original assertion, that "LLMs can't do X", nor the rebuttal, "They can if you tweak the prompt", are really telling us anything about the capabilities of LLMs to do what their users ask them to do: they are only telling us something about the capability of a user to get an LLM to do what the user wants.

In other words, we can see LLMs as random-access memories with imperfect recall. Much like a SQL query to a relational database, the right prompt can access the right piece of data, but unlike SQL nobody has a clue what "the right prompt" is in the general case.

Seen another way, any prompt a user makes to an LLM has some probability to elicit the desired response from the LLM. There is no known way to maximise that probability. Until there is, we cannot draw any conclusions about the capabilities of LLMs just by poking them and checking the results. To be very clear about it: we can't conclude either that "LLMs can't do X", nor that "LLMs can do X'. All we can conclude is "a user can do X".

Re: Large language models do not recognize identifier swaps in Python

#64

Earlier quoted context omitted.

We already know that humans are sensitive to meaning. That's not a hypothesis that needs testing.

This experiment only proves LLMs are sensitive to meaning too. It was also already known.

All I can see with any clarity is that LLMs are sensitive to the user's prompt.

Re: Large language models do not recognize identifier swaps in Python

#65
post #34

There seems to be a profound lack of scientific rigour and methodology amongst the engineers who build this stuff. The engineer's reply is always, "but the output works". But that's not what engineers always say, esp. when they're on company boards. They often make extraordinary claims about how it works -- and then get annoyed when people do actual experiments. This is a paper about what the properties of the system…

"ruthless, scientific focus, on the null (/failure) cases" means you're not going to build anything of value ever. There is risk in every startup, innovation, new technology, etc and a big part of making those work is laser focusing on success and leaving the failure cases to someone else (once you have a successful product and/or business).

That's why a) nothing ever works and b) business is not science.

Re: Large language models do not recognize identifier swaps in Python

#66
post #7

Human programmers will also initially spend 10x of effort working on code base where identifier names are meanongful but swapped. Doing so will employ a lot of inner dialogue such as "this method says close but it is actually reset" and I don't doubt LLMs may be made straight by the same prompts.

Yup. The whole premise of this test is idiotic. When you give a piece of code to an LLM, it doesn't magically switch into "code focused mode". They write: > Typical programming languages have invariances and equivariances in their semantics that human programmers intuitively understand and exploit, such as the (near) invariance to the renaming of identifiers. But this is bullshit . Identifier renaming may be a no-op…

To be clear, did you have any trouble figuring out the correct answer in the motivating example in the article's introduction?

I'm asking because sure, a human programmer might well get tripped up by a name swap if they had missed the swap, or forgot it, but when presented with a short test of three lines like the one in the article's motivating example, the majority of human programmers would pass the test easily.

That's what the experiment is testing. Three short lines and a question. The LLMs fail it. How often would humans fail it?

(Note I think the experiment is not very informative for other reasons, but I'm specifically pointing out that most humans would pass the test anyway).

Re: Large language models do not recognize identifier swaps in Python

#67

Earlier quoted context omitted.

It is a known and published weakness of LLMs that they do not have internal monologue, whereas human do (where they can remind themselves over and over that names are switched). But it's not impossible to implement it.

LLMs are the internal monologue.

They don't have N steps of iterative internal monologue before arriving at end result.

Re: Large language models do not recognize identifier swaps in Python

#68
post #16
post #5

Earlier quoted context omitted.

Just to point out: this doesn't work since at the point where it defines the new print function, the new len which now prints is used

Ok, but the error is more of a syntax error. If I did this in an interview, you wouldn't accuse me of a lack of some ineffable human quality of "deep understanding". Anyway, I asked it to fix it, and behold: def print(list_arg): return len(list_arg) def len(value): __builtins__.print(value)

>> If I did this in an interview, you wouldn't accuse me of a lack of some ineffable human quality of "deep understanding".

Yeah, sorry but I would. The experiment in the article is about identifier swapping, not about function redefinition, which is what you have done.

Better not do that in an interview.

Re: Large language models do not recognize identifier swaps in Python

#69

Every time somebody posts a negative result on LLMs' capabilities like that, somebody will go on HN, on Twitter, on Reddit, etc, and post an example where they get an LLM to produce a counter example of the negative result. Crucially, this follow-up "rebuttal" always seems to use a different prompt than the one in the original experiment. What can we conclude from that kind of sequence? We can conclude that neither t…

Along the same lines, I read something (on here but I don't think I can find it) suggesting that llms + prompting are kind of overfitting, where if you know what you achieve, you can try few things and get it - which would be equivalent to optimizing on a train set. Whereas if you try to get it to do something you don't already know how to do, all bets are off.

Re: Large language models do not recognize identifier swaps in Python

#70

Earlier quoted context omitted.

Going to paste together snippets from comments on this thread. This bit is from the paper. > Typical programming languages have invariances and equivariances in their semantics that human programmers intuitively understand and exploit, such as the (near) invariance to the renaming of identifiers. This is bullshit lol. Identifier renaming may be a no-op for the code, or even for the compiler/interpreter, but it's abso…

That's just shifting the goalposts. Someone gets LLMs to do something impressive? "Ooh, LLMs are intelligent!". Someone shows LLMs falling flat on their face? "Lol of course LLMs can't do that you're using it wrong". I'd also like to call out the preposterous claim that a human would not pass the example test illustrating the article. While in the normal course of coding and if they hadn't noticed the swap a human pr…

Sure that's the posts that are being shifted here.

If the same model can do exactly what you say it can't with so little effort added that you can do it minutes or hours within your paper release then the model can get very much do what you say it can't.

There's nothing inherent about falling flat on your face that makes it some quality reserved for beings that can't reason. Humans do that fine on their own al the time.

A paper that doesn't even pass the try rest is a paper that should be questioned at the very least. Invalidates all the claims it makes when the results it's founded on are patently false or misleading.

Post reply on HN