3 ms·
GPT-4's explanation of its optimization does not make sense to me. It writes "Instead of moving it to P, we can directly use S in the following comparisons, sav
by cafaxo 3y ago
GPT-4's explanation of its optimization does not make sense to me. It writes
"Instead of moving it to P, we can directly use S in the following comparisons, saving one instruction." but then proceeds to use P as if that mov had happened.
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.
- smeagull 3y agoThere was already a paper on Transformer models and their inability to redefine variables. They had real problems with swapping variables and would forget that it had happened.
- bryan0 3y agoGPT states at the end: > However, in the lines following the removal, P should be replaced with S to maintain correctness.
- bonzini 3y agoAnd that's not enough. Think of the swap sequence t=a,a=b,b=t: all three moves are necessary. 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.
- deleted 3y ago[deleted]