How to Evaluate Large Language Models on Complex Software Planning at Low Cost
A practical framework for evaluating LLM planning capabilities without generating an entire codebase in one expensive run. It explains how to separate architecture planning from code execution, design reproducible spreadsheet and visual-scene tests, define acceptance metrics, track token costs, and build an engineering workflow for reliable comparisons.
Large language models are improving rapidly at code generation. Some evaluations ask a model to generate a large game or even a complete operating system in a single run. However, the API cost of these tests can reach hundreds of dollars, putting them out of reach for many developers.
This article presents a tool-agnostic way to evaluate software planning capabilities under a limited budget. It also provides reusable documentation templates, cost formulas, and acceptance criteria.
1. Why You Should Not Generate an Entire Codebase from One Prompt
Asking a model to output a complete codebase from a single broad prompt creates three major problems.
First, the context grows continuously. As more conversation history is included, the number of input tokens increases, and costs can rise quickly.
Second, when the model writes code without a design document, interfaces between modules are more likely to become inconsistent.
Third, failures are difficult to diagnose. The problem may come from the planning process, the implementation, or the prompt itself, and it is hard to determine which factor caused the failure.
For these reasons, evaluations should separate planning from implementation. Each stage should produce an artifact that can be checked independently.
2. A Two-Layer Planning and Execution Process
This approach has two layers.
Planning Layer
Use a more capable model for planning. It should not write business logic. Instead, it should produce:
- Architecture design
- Module decomposition
- Data structure definitions
- Core interaction flows
Save the output as a local Markdown document so it can be versioned and reviewed manually.
Execution Layer
Use a lower-cost model for implementation. Provide the planning document as input and ask the model to implement individual functions and modules one at a time.
Each call should include only the description of the current module and its related interfaces. This keeps the input token count relatively small.
The division resembles collaboration between a software architect and development engineers. It allows the quality of the planning document to be scored separately from the implementation, while the generated code can be accepted or rejected on a module-by-module basis.
3. How to Evaluate a Spreadsheet Prototype
A practical test target is a spreadsheet prototype with basic interaction. A production office suite would contain a very large codebase, so the evaluation should focus on core functionality, such as:
- Reading and writing cell values
- Formula calculation
- Basic style settings
Step 1: Create a Test Record
For every test, record at least the following information:
- Name and version of the planning model
- Name and version of the execution model
- The complete prompts
- Maximum context length
- Input and output token counts
- Cost
- Execution time
- Number of API calls
Version numbers are especially important. The behavior of a model with the same name may change over time. Results without version information cannot be reliably reproduced.
Step 2: Require Coverage Across Three Layers
The planning document should cover three levels of the system.
Data Layer
The document should describe:
- How cells are stored
- Whether each cell contains the original input, calculated result, and formatting information
- How the dependency graph is represented
Logic Layer
The document should explain:
- The formula parsing process
- The message format used by the event bus
- The rules used to schedule calculations
Presentation Layer
The document should define:
- The rendering mechanism
- How user input is intercepted
- Which regions are redrawn during scrolling
The document should also include interface definitions. For every module, specify its input parameters, return values, and error conditions.
Step 3: Check Common Engineering Edge Cases
The planning document should address common implementation challenges. The following test cases can be used as a checklist.
Circular References
If A1 references B1 and B1 references A1, the system should return a clear error instead of recursing indefinitely.
Dirty Data Updates
After A1 is modified, dependent cells should be marked as dirty and recalculated. Unaffected cells should not be recalculated.
Rendering Performance
When one change affects a large number of cells, the redraw region should have an upper bound or use a batched processing strategy.
The more specific the proposed handling is, the stronger the planning quality is likely to be. Reviewers can score each case from 0 to 2 and record the reason for every score.
Step 4: Implement and Validate
After code is generated for each module, run the corresponding unit tests.
Possible acceptance metrics include:
- The percentage of test cases that pass
- Whether the code compiles successfully
- The number of lines manually modified by developers
The amount of manual editing provides a useful indication of how practical the execution model is in real development work.
4. Acceptance Metrics for Visual Scenarios
Visual evaluations are easily dominated by subjective judgment, so the evaluation criteria should be made as explicit as possible.
For example, consider a ruined-city scene in a 2D side-scrolling game. Before testing, fix the following parameters:
- Graphics library and version, such as a specific version of a Python graphics library
- Canvas resolution, such as 1920 × 1080
- Maximum particle count, such as a fixed limit per frame
- Frame-rate threshold, such as at least 30 frames per second on specified hardware
- Random seed, so repeated runs of the same code produce consistent results
Acceptance should include two categories of metrics.
Automated Metrics
Measure whether:
- The code runs successfully
- The program crashes during execution
- The average frame rate meets expectations
- Memory usage remains within the defined limits
Subjective Metrics
Ask three to five reviewers to use the same scoring rubric. Example criteria include:
- Whether the building silhouettes have sufficient depth
- Whether the lighting appears natural
- Whether the color palette is consistent
Each item should receive a score, and reviewers should record the reasoning behind their evaluations.
This process produces results that are easier to reproduce and makes differences between models easier to compare.
5. Engineering Integration and Cost Monitoring
Organizations can turn this evaluation process into an internal automated pipeline. A typical setup includes the following components.
- Document storage: Store planning documents in object storage and record their version numbers.
- Code repository: Keep the planning documents and application code in the same repository. When code is committed, record the corresponding planning-document version.
- Continuous integration: Run the four stages in order: planning, code generation, compilation, and testing. When requirements change, rerun only the affected stages.
- Logging and monitoring: Record the token usage and cost of every call, and configure alerts.
The estimated cost of a single task can be calculated as:
Single-task cost = Input tokens × Input price + Output tokens × Output price
Use the prices published by the model provider for the input and output rates.
Alert thresholds can be configured according to the team’s budget. For example:
- Set a daily token limit as a fixed proportion of the monthly budget
- Set a maximum cost for an individual task
- Limit retries for the same task to three attempts
When any threshold is exceeded, pause the pipeline and notify the person responsible for the evaluation.
6. Low-Cost Evaluation Checklist
Before starting a test, confirm each of the following items:
Model Selection
Have the version numbers of both the planning model and the execution model been recorded?
Task Decomposition
Does each execution task contain only one module?
Token Budget
Have the expected input and output limits for every stage been estimated?
Acceptance Criteria
Were the pass conditions defined before testing began?
Failure Rollback
When the planning document changes, is the previous version preserved for comparison?
7. Common Mistakes
Context Inflation
Including the entire project history in every prompt causes costs to increase quickly. Pass only the interfaces and document fragments required by the current module.
Model Version Changes
Running the same test again several weeks later may produce different results. Reports must include the model version and test date.
Exceeding a Billing Plan
Intensive testing can exceed a monthly quota. Configure alerts in advance and reserve additional budget for longer tasks.
Failing to Audit Generated Code
Model-generated code may contain security risks or code fragments of uncertain origin. Before merging it into the main branch, conduct a manual review and run static analysis.
Conclusion
Under controlled conditions and a limited budget, separating planning from execution can reduce the cost of trial and error. It also makes it possible to evaluate planning quality and implementation quality independently.
Whether this method is suitable for a particular team should be determined through a comparison on real tasks, using the test records and acceptance metrics described above.
