Systematically Evaluating the Practical Engineering Capabilities of Next-Generation LLMs
As large language models (LLMs) rapidly evolve, developers often discover a gap between advertised capabilities and real-world stability. Rather than comparing parameters or simple Q&A metrics, this article explores how to systematically evaluate an LLM's development skills by having it build a complete, production-like project—a historical trading backtesting system. It covers data preparation, task decomposition, database design, backtesting logic, security boundaries, and six key dimensions for assessing model reliability in real engineering workflows.
As large language models (LLMs) continue to upgrade, developers frequently encounter a recurring issue: new models may look incredibly capable in their release notes, but once integrated into personal projects or enterprise systems, their ability to consistently complete tasks still requires rigorous engineering validation.
Instead of simply comparing parameter sizes, marketing metrics, or Q&A fluency, a better approach is to design a comprehensive project involving real data, external APIs, databases, and multi-turn interactions. This forces the model to undergo tests resembling a production environment. This article uses the task of “building a historical backtesting analysis system based on personal trading records” as a case study to discuss how to systematically evaluate the development capabilities of next-generation LLMs.
1. Evaluating LLMs Goes Beyond Smooth Responses
In simple Q&A scenarios, an LLM only needs to generate a block of text. However, in real development tasks, it must handle multiple layers simultaneously:
- Can it correctly understand business objectives?
- Can it decompose complex tasks into executable steps?
- Can it read and accurately parse structured data?
- Can it write API-calling logic based on documentation?
- Can it design reasonable, scalable data structures?
- Can it identify missing data, API failures, and permission limits?
- Can it validate its own implementation through testing?
- Can it pause and explain reasons to the user when exceptions occur?
Therefore, model evaluation should evolve from “generating a code snippet” to “assisting in completing a full engineering project.”
For trading backtesting projects, the ultimate goal is not for the model to simply output “buy” or “sell.” It should use reliable data to complete data cleaning, strategy replication, historical validation, metric calculation, and result explanation. A single error in any stage can distort the final conclusion.
2. Step 1: Prepare Data for Stable Model Comprehension
1. Raw Trading Exports Are Not Suitable for Direct Analysis
While most trading software exports files in tabular formats, they often suffer from practical issues:
- Inconsistent column names;
- Mixed date and time formats;
- Amounts, quantities, and prices recognized as strings;
- Buy, sell, and cancellation records mixed together;
- Multiple batch executions for the same security;
- Inclusion of summary rows, empty rows, or formatting notes;
- Non-standard encoding and header hierarchies.
If you feed such files directly to the model, it might only read the first few rows or mistakenly treat summary rows as trading records. Especially with larger files, the model’s comprehension of tabular data does not necessarily match the precise parsing of traditional data analysis programs.
2. Converting Tables to Text Is Not a Silver Bullet
Converting tables to structured text (e.g., Markdown) is a valuable preprocessing step. It helps the model better understand field relationships, column names, and partial data content. However, text conversion cannot replace programmatic validation.
A more robust approach is to maintain three data versions simultaneously:
- Raw files: For auditing and traceability;
- Standardized files: For model reading and manual inspection;
- Programmatic data tables: For subsequent statistics and backtesting.
It is recommended to establish a unified schema during the import phase, for example:
trade_idaccount_idsecurity_codesecurity_nametrade_datetrade_timedirectionquantitypriceamountcommissiontax
On this basis, use scripts to perform type conversions and basic validations, rather than relying entirely on the model to “understand” the data.
For instance, the import program should at least check:
assert quantity >= 0assert price >= 0assert trade_date is not Noneassert direction in {"BUY", "SELL"}
For amount fields, you should also verify that the quantity multiplied by the price roughly matches the transaction amount, and save costs like commissions and taxes separately to avoid duplicate calculations or omissions during backtesting.
3. Step 2: Break Down Large Tasks into Verifiable Stages
The most common way complex projects fail is by telling the model all requirements at once and waiting for it to auto-generate a complete system. This often leads to:
- The model modifying multiple files simultaneously, making it hard to locate errors;
- Early data misunderstanding errors cascading into subsequent modules;
- Constantly changing code structures that users cannot control;
- The model continuing to “patch code” when exceptions occur, exacerbating the problem;
- Inability for users to verify the correctness of each step’s output.
A better approach is staged collaboration.
Stage 1: Identify the Security List
First, only ask the model to extract security codes and names from the trading records and output a deduplicated list. Do not rush to pull market data yet. Manually verify:
- Are the security codes complete?
- Are there name misalignments?
- Does it include funds, bonds, or other non-target asset types?
- Are there delisted, renamed, or code-changed securities?
Proceed to the data fetching stage only after the list is confirmed.
Stage 2: Check API Documentation
If the system needs to integrate an external financial data API, first let the model read locally saved API documentation to extract:
- API purpose;
- Required parameters;
- Return fields;
- Date formats;
- Permission requirements;
- Rate limits;
- Pagination methods;
- Error response formats.
Do not let the model guess API names and parameters from memory. API calls are a high-risk step; a single wrong field can result in empty, partial, or erroneous data.
It is recommended to generate an API test module first, validating only a few securities over a short time range. Once confirmed working, proceed to write batch tasks.
Stage 3: Build the Data Collection Module
The data collection module should feature:
- Querying by security and date range;
- Checkpoint and resume capabilities;
- Failure retries;
- Request logging;
- Data deduplication;
- Incremental updates;
- Task progress display;
- Recovery after interruption.
Progress display is not just a UX issue; it is crucial for troubleshooting. A good task log should answer:
Current object: Security XCompleted: 120 / 500Current date range: Start date to End dateSuccessful records: xxxxFailed requests: xLast error: Insufficient permissions or empty return
If the model’s generated program lacks logs, retry mechanisms, or explanations for empty results, it is unfit for long-term tasks, even if the code runs.
4. Step 3: Evaluate Database Design Capabilities
A temporary script might save data as CSV, but a backtesting system typically requires a more standardized local database.
Consider splitting the data into at least the following tables:
1. Security Basic Info Table
Stores relatively stable information like security codes, names, markets, and listing status.
2. Daily Quote Table
Stores trading dates, open, high, low, close, volume, and turnover.
3. Intraday Quote Table
Stores finer-grained data like timestamps, prices, and volume. Due to potentially large data volumes, design specific indexes and partition strategies.
4. Trading Record Table
Stores actual personal trading records, including direction, quantity, execution price, fees, and source file.
5. Data Task Table
Records start time, end time, processed objects, success count, and failure reasons for each data collection task.
When designing table structures, follow these principles:
- Create joint indexes on security codes and trading dates;
- Set unique constraints on duplicate data;
- Layer raw and cleaned data;
- Do not define all fields as strings;
- Consider precision for amounts and prices;
- Record data sources and update timestamps;
- Retain audit information for critical changes.
If a model only generates one “wide table,” it might seem simple initially but will lead to update difficulties, data duplication, and degraded query performance long-term. Database design capabilities often reflect the model’s engineering level better than whether the code merely runs.
5. Step 4: Common Logic Errors in Backtesting Systems
Backtesting is not simply subtracting the buy price from the sell price. At a minimum, consider:
1. Look-Ahead Bias
Strategies can only use data publicly available at the time. They cannot use future closing prices, future financial data, or post-hoc revised data.
2. Execution Timing
If a strategy generates a signal after the close, it cannot assume immediate execution at that same closing price. Clarify whether execution happens at the next trading day’s open or follows other rules.
3. Trading Costs
Commissions, stamp duties, slippage, and minimum fees affect final returns. Ignoring costs, especially in high-frequency or short-term strategies, will severely overestimate performance.
4. Dividends and Splits
Whether historical prices are adjusted (e.g., for dividends or splits) directly impacts return calculations. Personal trading records use actual execution prices, while market data might use adjusted prices; the two must be unified.
5. Suspensions and Limit Moves
Generating a trading signal theoretically does not guarantee actual execution. The backtesting program must explicitly handle scenarios like inability to buy, sell, or trade due to suspensions or price limits.
6. Capital and Position Constraints
Strategies cannot use infinite capital or sell non-existent holdings. The system should maintain cash balances, position quantities, frozen capital, and available funds.
A qualified backtesting engine should output at least:
- Total return rate;
- Annualized return rate;
- Maximum drawdown;
- Win rate;
- Profit/loss ratio;
- Number of trades;
- Average holding period;
- Fee ratio;
- Detailed trade breakdown;
- Equity curve.
When the model generates these metrics, users should not just look at the results; they must verify the calculation formulas and boundary conditions.
6. How to Evaluate the Model’s Performance
Through this project, you can evaluate the model across six dimensions.
1. Data Comprehension
Did the model read the data completely? Did it identify abnormal rows? Could it detect field type errors?
2. Task Decomposition
Did the model proactively break the complex project into stages, or did it blindly generate uncontrollable amounts of code?
3. Engineering Implementation
Does the code have a modular structure, configuration management, logging, exception handling, and test cases?
4. Tool Calling
Does the model strictly use APIs according to documentation? Can it handle empty returns, timeouts, permission issues, and rate limits?
5. Self-Validation
Does the model proactively generate tests? Can it validate results with sample data? Can it discover its own logical errors?
6. Interaction Stability
In real use, observe if there are long unresponsiveness periods, repetitive generation, context loss, or failure to recover after task interruptions. Stability is hard to showcase in a demo but directly determines if the model is viable for real development.
7. Security Boundaries When Developing with LLMs
Trading data is sensitive, and API credentials should not be exposed directly to the model or written into code repositories. Recommended measures:
- Use environment variables for access credentials;
- Add config files to ignore lists;
- Mask accounts and tokens in logs;
- Prioritize using desensitized sample data;
- Require manual confirmation for delete and update operations generated by the model;
- Do not allow unreviewed code to connect directly to production databases;
- Retain raw inputs and version info for backtesting results.
Furthermore, no model should be considered an investment decision-maker. Backtesting reports only help analyze historical behavior; they do not prove future returns and cannot replace risk management and human judgment.
8. Conclusion: Shift Focus from “Smart” to “Reliable”
A new model’s excellence is not solely defined by its ability to write a pretty piece of code or ace a single demo. What truly matters is its ability to maintain clear steps, accurate data processing, verifiable results, and stable interactions in complex tasks.
Using a trading backtesting system as an example, the most reasonable evaluation approach is:
- First, let the model understand and organize data;
- Then, have it validate APIs and samples;
- Next, gradually build the database and collection module;
- Finally, implement backtesting and report generation;
- Confirm each step with tests and manual checks.
This method is slower than “one-shot full project generation” but makes it easier to spot issues and is better suited for real engineering. For any newly released LLM, you can apply the same philosophy: choose a real, complex, quantifiable task and use a complete development workflow to test its reliability, rather than being swayed by single-turn answers or marketing metrics.
