[Paper Review] Large Language Model Programs
This paper introduces Large Language Model Programs (LLM Programs), a method that embeds pre-trained LLMs within explicit algorithms to enhance their reasoning and algorithmic capabilities. By decomposing tasks into isolated subproblems and calling the LLM only on relevant context per step, the approach achieves a 6.4% improvement in evidence-supported question-answering over chain-of-thought prompting without any fine-tuning.
In recent years, large pre-trained language models (LLMs) have demonstrated the ability to follow instructions and perform novel tasks from a few examples. The possibility to parameterise an LLM through such in-context examples widens their capability at a much lower cost than finetuning. We extend this line of reasoning and present a method which further expands the capabilities of an LLM by embedding it within an algorithm or program. To demonstrate the benefits of this approach, we present an illustrative example of evidence-supported question-answering. We obtain a 6.4\% improvement over the chain of thought baseline through a more algorithmic approach without any finetuning. Furthermore, we highlight recent work from this perspective and discuss the advantages and disadvantages in comparison to the standard approaches.
Motivation & Objective
- Address the limitations of LLMs in performing algorithmic tasks such as sorting or searching, even after fine-tuning.
- Overcome architectural constraints of decoder-only Transformers, including finite context length and poor out-of-distribution generalization.
- Provide a scalable, interpretable, and modular alternative to fine-tuning by embedding LLMs within explicit programs.
- Demonstrate that structured programmatic control can improve performance on complex reasoning tasks without requiring model retraining.
- Highlight the benefits of modular decomposition in improving reliability, interpretability, and generalization in LLM-based systems.
Proposed method
- Decompose complex tasks into smaller, isolated subproblems, each solved by a single LLM call with minimal, relevant context.
- Use a programmatic control flow to manage state and orchestrate LLM calls, ensuring each step receives only the necessary input.
- Apply a tree search over paragraph selection during reasoning to dynamically choose the most relevant evidence for each reasoning step.
- Maintain a high-level algorithmic structure that guides the LLM through a sequence of well-defined operations, rather than relying on a single, monolithic prompt.
- Integrate LLMs as subroutines within a larger program, allowing for modularity, testability, and composability of individual components.
- Leverage the LLM’s generation capabilities within a structured framework to ensure correctness and consistency across steps.

Experimental results
Research questions
- RQ1Can embedding LLMs within explicit programs improve their performance on algorithmic and reasoning tasks compared to standard in-context learning?
- RQ2Does a programmatic approach with isolated subproblem solving lead to better generalization and reduced interference compared to single-prompt chain-of-thought methods?
- RQ3To what extent can LLM programs achieve performance gains without any fine-tuning, especially in evidence-supported question-answering?
- RQ4How does the modular, algorithmic structure of LLM programs enhance interpretability and reliability compared to end-to-end neural models?
- RQ5In what scenarios is programming with LLMs more advantageous than fine-tuning on expert demonstrations?
Key findings
- The LLM program approach achieved a 6.4% absolute improvement in evidence-supported question-answering accuracy over the chain-of-thought baseline, without any fine-tuning.
- By isolating subproblems and providing focused context per LLM call, the method reduced interference between reasoning steps, improving overall reasoning quality.
- The programmatic approach enables trivial generalization guarantees—for example, filtering and search components scale naturally to larger document sets.
- Embedding LLMs in algorithms mitigates architectural limitations such as finite context length by allowing dynamic loading and summarization of relevant information.
- The method supports safer and more reliable behavior by enabling external control mechanisms, such as filtering or validation, between LLM calls.
- The approach is compatible with existing LLM capabilities and can be applied across diverse tasks, including reasoning, summarization, and text generation, without retraining.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.