Natural language as a programming language

Algorithms consist of a series of small, well-defined operations — traditionally, calls to simple functions. In principle, any function can be rewritten as an LLM call by describing its operation in natural language and sending it off. If the operations are too complicated or numerous for a single call, the function can be recursively decomposed into simpler subroutines until an LLM is capable of solving all of them. The LLM calls could even be nested so that they call each other, e.g., with the root call containing function-scope operations and a nested call containing loop-level operations. Entire programs could be translated into natural language and executed on LLMs instead of on CPUs.

LLM capability is a superset of code capability

In practice, you would never want to outsource existing function calls to LLMs like this — they’re slower, more expensive, and, depending on how you’ve set up your prompts, less reliable. But treating LLM calls as functions like this means you can suddenly write new types of functions that were never possible before.

Sorting strings by meaning

Consider a list of strings representing nouns. If we add an LLM call to a comparison operator, we can sort the strings — not lexicographically, but by the size of the objects they represent. We could make many single comparison operations, e.g., “is a fish bigger than a car?”, “is a house bigger than a fish?”, and in doing so, sort an arbitrarily large list.

Hybrid reasoning is stronger than individual forms

You could, of course, ask the LLM to sort the contents of a string containing 100 nouns all at once but it would probably start to hallucinate. The key to the sorting example is how it breaks down the types of reasoning and assigns them to the most appropriate form of computation. The CPU does the part that only it can do reliably — the sorting algorithm — and the LLM does the part that only it can do (at all) — the comparison operation. I wonder how far such a synergy could take you. Could you have an LLM do fuzzy reasoning about an arbitrary problem, use a partial collaboration with traditional algorithms to build itself a more formalized representation of the knowledge it determines could be relevant (like Cyc), and then use a highly CPU-based but still LLM-augmented inference algorithm to determine an answer that is more reliable and traceable than the pure LLM approach?