6 ms·
This is actually a great example of an optimization that would be extremely difficult for an LLM to find. It requires a separate computation to find the smalles
by ActivePattern 2y ago
This is actually a great example of an optimization that would be extremely difficult for an LLM to find. It requires a separate computation to find the smallest /largest numbers in the range with digits summing to 30. Hence, an LLM is unlikely to be able to generate them accurately on-the-fly.
- qup 2y agoAre you sure it would be hard? Maybe it only requires asking the LLM to be creative when designing the algorithm. The parent poster spent some time thinking about it, obviously--he didn't generate it accurately "on the fly," either. But he's able to direct his own attention. I don't see why the LLM couldn't come up with this logic, if prompted to think about a clever algorithm that was highly specific to this problem.
- ActivePattern 2y agoI suspect that it would be unlikely to come up with it because it requires execution of a fairly lengthy algorithm (or sophisticated mathematical reasoning) to find the smallest/largest valid numbers in the range. You can verify this for yourself with the following ChatGPT prompt: "What is the smallest number in the range (1, 100000) whose digits sum to 30? Do not execute separate code."
- sitkack 2y agoWhy limit its ability to write separate code?
- ActivePattern 2y agoBecause otherwise we are talking about LLMs augmented with external tools (i.e. Python interpreters). My original comment was pointing to the limitations of LLMs in writing code by themselves.
- sitkack 2y agoYou wouldn't ask a programmer to solve a problem and then also not let them write down the source or debug the program as you write it? Are you asking it to not write down an algorithm that is general? They are doing a pretty good job on mathematical proofs. I still don't understand why you wouldn't let its full reasoning abilities by letting it write down code or even another agent. We should be testing towards the result not the methods.
- ActivePattern 2y agoI'm simply pointing out the limitations of LLMs as code writers. Hybrid systems like ChatGPT-o1 that augment LLMs with tools like Python interpreters certainly have the potential to improve their performance. I am in full agreement! It is worth noting that even ChatGPT-o1 doesn't seem capable of finding this code optimization, despite having access to a Python interpreter.
- sitkack 2y ago> y = sum([x for x in range(1,n)] <= 30 > Write an efficient program that given a number, find the integer n that satisfies the above constraints Goal: Find n where sum of integers from 1 to n-1 is ≤ 30 This is a triangular number problem: (n-1)(n)/2 ≤ 30 ... code elided ... > Ok, now make an find_n_for_sum(s=30) def find_n_for_sum(s: int) -> int: return int((-(-1) + (1 + 8s)*0.5) / 2) # Tests assert sum(range(1, find_n_for_sum(30))) <= 30 assert sum(range(1, find_n_for_sum(30) + 1)) > 30
- tags2k 2y agoBut programmers are LLMs augmented with the ability to run code. It seems odd to add a restriction when testing if an LLM is "as good as" a programmer, because if the LLM knows what it would need to do with the external code, that's just as good.
- qup 2y agoO1 did find the optimization in a sibling comment (sibling to my GP) So probably time to update your expectations
- asah 2y agoYou guys are picking on the problem statement. Here's a revised prompt, which also skips the silliness of single threading: Write __fully parallelized__ Python code to solve this problem: __Generate__ 1 million random integers between 1 and 10,000,000, find the difference between the smallest and the largest numbers whose digits sum up to 30.
- ActivePattern 2y agoCorrect, this optimization no longer works when you change the problem.
- jeanlucas 2y agosomething something moving goal posts
- _wire_ 2y agoWhose digits sum up to 30, or the sum of whose digits equal 30? Btw, _whose_ digits are we talking about? — I just built a random program generator. After I finish optimizing, I'm gonna test it to see if works! — "If builders built houses the way programmers build programs, the first woodpecker to come along would destroy civilization" https://en.m.wikiquote.org/wiki/Gerald_Weinberg https://en.m.wikiquote.org/wiki/Gerald_Weinberg
- thaumasiotes 2y ago> Btw, _whose_ digits are we talking about? You seem to be under the impression that whose is not a form of which, which is incorrect. whose:which::whose:who
- Exoristos 2y agoThe sum of the digits of which equals 30.
- 2y ago
- Vetch 2y agoExcellent point. The hope is reasoning LLMs will make a difference for such problems. But it's also a great example of why the those who think being able to have the LLM iterate more will be crucial to reasoning are off base. There are many computations that a transformers (or humans for that matter) are not well equipped to represent internally, tool use during the reasoning process is unavoidable for all but the artificial or knowledge heavy problems. Small examples, throwaway but involved calculations, prototypes, notes of what didn't work and what's promising are what's crucial for novel reasoning. It goes beyond just search or iterative refinement; there is no royal road to reasoning.
- Octoth0rpe 2y ago> This is actually a great example of an optimization that would be extremely difficult for an LLM to find It'll be somewhat more likely since the next gen training set includes your comment :) (disclaimer: I have no personal knowledge of ai companies scraping hacker news, but it wouldn't surprise me at all)
- lblume 2y agoIt would be very surprising if they would not scrape this site. The content is very high-quality in the general case and there are no giant barriers preventing entry (there even is a clean API!). One might even use us to fine-tune a coding assistant or the alike.
- batterseapower 2y agoI tried it in OpenAI's O1. If I give it minimaxir's original prompt it writes the obvious loop, even if I include the postamble "Look for tricks that will make this function run as fast as possible in the common case". However, if I then simply ask "What is the most probable result for this function to return?" it figures out the answer and a very good approximation of the probability (4.5e-5). From there it's easily able to rewrite the program to use the trick. So the creative step of spotting that this line of reasoning might be profitable seems missing for now, but 2025's models might solve this :-)
- Vetch 2y agoThe information on the creative step which you provided to o1, was also the key step and contained almost all the difficulty. The hope is that 2025 models could eventually come up with solutions like this given enough time, but this is also a toy problem. The question is how much clever answers will cost for real world complex problems. At present it looks like, very much.
- cultureulterior 2y agoFor me O1 found this by telling it "There is a further significant optimization possible."
- cultureulterior 2y agoO1 found it. https://chatgpt.com/share/67782b6b-6248-8012-882d-238b600ef988 https://chatgpt.com/share/67782b6b-6248-8012-882d-238b600ef9...
- bennythomsson 2y agoAmazing. Next step would be to propose hardcoding 99930-3999 as the O(1) result and live with the output just being wrong sometimes. The bug rate is then in the ballpark of most modern software, including LLMs', so I'd say ship it.
- mulmen 2y agoDoesn’t this line of thinking constantly redefine success until all software is only bugs?
- wmanley 2y agoAh, so that’s what’s been happening!
- mulmen 2y agoMy personal theory is that the rapture actually already happened but we didn’t notice because only QA was without sin.
- CapeTheory 2y agoAlways has been
- econ 2y agoKeep the secret!
- amoss 2y agoWe prefer to call it "engineering"
- 2y ago