It may not be enough to just use LLMs to write your code when you can also use them to adjust it while your program runs. DoubleAI, a Tel Aviv, Israel-based startup founded in 2023, on Monday introduced Maxwell, a code execution model (CEM) that evaluates, optimizes, and rewrites binary code during execution. Named for Maxwell’s Demon, a creature imagined by physicist and mathematician James Clerk Maxwell in 1867 as part of a thought experiment on entropy, the Maxwell CEM preprocesses algorithms and machine instructions to maximize performance on available hardware. Maxwell is similar in concept to a just-in-time compiler, but provides more flexibility and formally verifies the equivalence of replacement code. Source code isn’t touched. "Both Maxwell and a JIT compiler work while the program runs and both produce new machine code," said doubleAI co-founder Gal Beniamini, who holds a PhD in theoretical computer science, in an email to The Register. "The difference is that a compiler can’t do high-level reasoning. It can’t, for example, change the algorithm. Maxwell can and does. "One of the reasons why JIT compilers are so narrow is that, even though they can be data-dependent, the changes they make must be deterministic and correct ‘by construction,’ since JIT compilers are ‘unthinking’ classical algorithms. "Maxwell brings the expressive power of frontier AI into the ‘JIT’ setting. In addition, Maxwell relies on formal verification to write actual, hard proofs that show that its optimizations are sound. This expands the scope of its allowed optimisation far beyond that of any algorithm or compiler." Beniamini pointed to sorting as an example. The compiler, he said, will make a general-purpose sorting algorithm run as fast as it can, but it won’t swap it out for a different algorithm. Compilers, said Beniamini, make decisions before the program runs and have to be narrow and conservative in their choices. Maxwell, he said, works with more information, isn’t just a one-pass operation, and operates at a higher level. "It sees the exact hardware the program has landed on, and the actual shapes and types of the data flowing through it (information that is only available during runtime!) ," Beniamini explained. "It also sees the state of the environment, what else is running in the same program, and which actual bottlenecks express themselves, and under which conditions. This allows it to specialize in ways a compiler never can." Since Maxwell operates continuously, it can keep improving programs as new bottlenecks arise…


