Note: An LLM was not used in writing this article.
On the topic of LLMs, I often see people having LLMs perform tasks that could be done by deterministic programs. They shouldn’t do that. They should have the LLM generate a program that they can then use to do the work. I would say any workflow that’s repeated, that can be made deterministic, should be. Making them 100x-1000x cheaper, and predictable, and extendable from a base.
In programming language runtimes, JIT’ing (just-in-time) a blob of instructions to something more efficient is what lets you author programs in a general, non-committal way, and then get the benefits of compilation (speed) for the bits that happen to be hotspots. The runtime abstracts the problem of optimization for you (caveat emptor: all abstractions leak).
LLMs performing work via token generation is general and fuzzy (great), but expensive and risky. So, by the same token (har!), people should direct their workflows to “JIT” the algorithm by making the agent produce code and then run the code and keep it, rather than doing the steps itself.
(This is also defensive against loss of access to or performance of the model, privacy concerns, etc.)