Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not getting it... what does the layover in Python achieve?



Instead of making the wild ass guesses that GPT makes (sometimes correctly), Python can be used to do the things that Python can do right. For instance if you asked a question like "how many prime numbers are there between 75,129 and 85,412" the only way of doing that (short of looking it up in a table) is something like

  count(n for n in range(75129,85412) if is_prime(n))
and GPT does pretty well at writing that kind of code.


LLMs are bad at math and rigorous logic. But we already have Python which can do both of those very well, so why try to "fix" LLMs by making them good at math when you can instead tell the LLM to delegate to Python when it is asked to do certain things?

Or in this case, have the LLM delegate to Python and then have the Python code delegate to another AI for "fuzzy" functions.


It can provide several benefits:

1. Python's code is abundant, so model should be well trained to generate correct Python code. The chance to make mistake is less. 2. Python has all needed control flows, including loops, so expressive enough

Basically they could do without Python, using their own DSL, and putting that into the prompt, but that is probably more wasteful than just prompting the model to use Python

In short, Python is going to be even more useful moving forward, as the bridge language between our language (human language, in this case English) to a planning language that any machine can understand.


And all of this because we couldn't solve the GIL. If it's just a translation layer for a model to execute, I guess the GIL doesn't matter.


Also, this is the airgap / "explain your reasoning" step that AI safety people are so worried about.


It's easier to write down "51 + 99" then it is to compute their sum. Same for other executable code.


I think GPT is probably best at generating Python code, as well.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: