Tried these with some local models and these are the ones that generated the program one shot, a few of them also generated the results correctly one shot. llama3.1-70b, llama3.1-405b, deepseekcoder2.5, gemma-27b, mistral-large, qwen2.5-72b. https://gist.github.com/segmond/8992a8ec5976ff6533d797caafe1... I like how the solution sort of varies across most, tho mistral and qwen look really similar.
The Languages of English, Math, and Programming
21–30 of 49 posts
Re: The Languages of English, Math, and Programming
#22If I understand correctly, Peter Norvig's argument is about the relative expressivity and precision of Python and natural language with respect to a particular kind of problem. He's saying that Python is a more appropriate language to express factorisation problems, and their solutions, than natural language.
Respectfully -very respectfully- I disagree. The much simpler explanation is that there are many more examples, in the training set of most LLMs, of factorisation problems and their solutions in Python (and other programming languages), than in natural language. Examples in Python etc. are also likely to share more common structure, even down to function and variable names [1], so there are more statistical regularities for a language model to overfit-to, during training.
We know LLMs do this. We even know how they do it, to an extent. We've known since the time of BERT. For example:
Probing Neural Network Comprehension of Natural Language Arguments
https://aclanthology.org/P19-1459/
Right for the Wrong Reasons: Diagnosing Syntactic Heuristics in Natural Language Inference
https://aclanthology.org/P19-1334/
Given these and other prior results Peter Norvig's single experiment is not enough, and not strong enough, evidence to support his alternative hypothesis. Ideally, we would be able to test an LLM by asking it to solve a factorisation problem in a language in which we can ensure there are very few examples of a solution, but that is unfortunately very hard to do.
______________
[1] Notice for instance how Llama 3.1 immediately identifies the problem as "find_factors", even though there's no such instruction in the two prompts. That's because it's seen that kind of code in the context of that kind of question during training. The other LLMs seem to take terms from the prompts instead.
Re: The Languages of English, Math, and Programming
#23 from math import prod
from itertools import combinations
def find_products(k=3, N=108) -> set[tuple[int, ...]]:
"""A list of all ways in which `k` distinct positive integers have a product of `N`."""
factors = {i for i in range(1, N + 1) if N % i == 0}
return {ints for ints in combinations(factors, k) if prod(ints) == N}
find_products()Re: The Languages of English, Math, and Programming
#24It's worth noting that math and programming do not appear to be considered "languages" by much of the academic and/or neuroscientific literature; see [0] on the front page right now and my comments regarding the same [1]. [0] https://news.ycombinator.com/item?id=41868884 [1] https://news.ycombinator.com/item?id=41892701
Re: The Languages of English, Math, and Programming
#25Re: The Languages of English, Math, and Programming
#26It's worth noting that math and programming do not appear to be considered "languages" by much of the academic and/or neuroscientific literature; see [0] on the front page right now and my comments regarding the same [1]. [0] https://news.ycombinator.com/item?id=41868884 [1] https://news.ycombinator.com/item?id=41892701
Yes, calling an algorithm, a formal description of a generative function "a language" is clearly wrong. I don't think we need an academic dissertation on this.
> Sometimes a natural language such as English is a good choice, sometimes you need the language of mathematical equations, or chemical equations, or musical notation, and sometimes a programming language is best. Written language is an amazing invention that has enabled human culture to build over the centuries (and also enabled LLMs to work). But human ingenuity has divised [sic] other notations that are more specialized but very effective in limited domains.
Re: The Languages of English, Math, and Programming
#27It's worth noting that math and programming do not appear to be considered "languages" by much of the academic and/or neuroscientific literature; see [0] on the front page right now and my comments regarding the same [1]. [0] https://news.ycombinator.com/item?id=41868884 [1] https://news.ycombinator.com/item?id=41892701
Of course, this is what Chomsky calls a “terminological dispute”, so I mean no offense and you’re ofc free to stand your ground that the only language is what appears in human brains! But if mathematical notation and programming languages aren’t languages, what are they…? Protocols? Recursively generative patterns? Maybe just grammars?
The best move in any terminological dispute is “my terms are more useful”, so this seems like a good reason to keep language as it’s defined by the generative linguistics. Or, more broadly:
Saussure approaches the essence of language from two sides. For the one, he borrows ideas from Steinthal and Durkheim, concluding that language is a 'social fact'. For the other, he creates a theory of language as a system in and for itself which arises from the association of concepts and words or expressions. Thus, language is a dual system of interactive sub-systems: a conceptual system and a system of linguistic forms. Neither of these can exist without the other because, in Saussure's notion, there are no (proper) expressions without meaning, but also no (organised) meaning without words or expressions.
https://en.wikipedia.org/wiki/Theory_of_languageRe: The Languages of English, Math, and Programming
#28It's worth noting that math and programming do not appear to be considered "languages" by much of the academic and/or neuroscientific literature; see [0] on the front page right now and my comments regarding the same [1]. [0] https://news.ycombinator.com/item?id=41868884 [1] https://news.ycombinator.com/item?id=41892701
Huh, interesting. Programming languages were devised with Chomsky’s foundational theory of formal languages in mind, and they’re one of the few actual implementations of it. I read your comment and it seems your main thrust is that arithmetic activity lights up different brain regions than communicative activity, which I don’t personally see as a compelling basis for a definition of the word “language”. Of course, th…
But if I must, I suppose I am indeed assuming a stance by taking potshots at this narrower (albeit more precise) use of the word language by (obliquely) pointing to counterexamples that could be considered languages in their own right; the sweeping claim that "language is not essential for thought" seems far broader than the narrow sense in which the term is construed in the actual paper.
Re: The Languages of English, Math, and Programming
#29Re: The Languages of English, Math, and Programming
#30I would place English (or all spoken/written languages in general) first, Math (as discovered) second, and programming languages last.