From Newsgroup: comp.compilers
Derek <
derek-nospam@shape-of-code.com> wrote:
All,
Some analysis on Anthropic's LLM generated C compiler https://shape-of-code.com/2026/02/22/investigating-an-llm-generated-c-compiler/
Does anybody have any inside information about those involved? I'm
assuming that at least one of them had experience in compiler
production.
No inside information, but looking at code and blog bring some things. First, accurding to the blog the author created several compilers using previous versions of Claude. Claude was supposed to do work from prompts with no access to previous results, but presumably prompts used experience from previous attempts. Also, human created a collection of tests. Git history shows that first version was quite a bit smaller (AFAICS 4073) than the final result and probably rather limited. Also, a commit before first version indicates that initial task was to handle something like 'int main() {printf N;}', it seems that LLM did more than that.
Blog says that at each step the LLM worked on a small part of compiler, trying to make it pass some specific tests. This seem to indicate that each commit corresponds to several LLM trials. Given that task was split into a lot of smallish subtasks it looks reasonable that LLM could go trough all of this.
Concerning your remark 'that this must be regurgitation of pieces from existing compilers', I am not sure what you expected. AFAICS changing variable names and using different control structures is possible in purely mechanical way. And to that inline expansion and its inverse, that is factoring and look of code can be
quite different. Parts could be taken from existing compilers (or textbooks), but trying to make them work together is likely to introduce changes. To say the
truth, lexer in first version looks like something that could come from a compiler textbook. OTOH, at that stage I would not expect originality: there are
little things that can be organized in different way but there is limited number
of ways for sensible top level organization.
One more thing: IIUC code models were trained on Git repositores, so they are more likely to repeat _changes_ to code, than code itself. But given that they use loose matching and use templates from huge pool of samples sequence of changes that produce LLM result has low probablity to show significant similarity with training code (there were reports that with special prompts LLM could repeat part of its training source, but probability of such thing happening by accident seem to be quite low).
--
Waldek Hebisch
--- Synchronet 3.21d-Linux NewsLink 1.2