How to Evaluate Next-Generation Large Language Models: From Code Execution to Data Reliability

    A practical framework for evaluating large language models through a realistic trading-data analysis project. It examines requirements understanding, task planning, code execution, data validation, backtesting reliability, failure recovery, interaction stability, and security.

    When a new model is released, many people immediately ask it to write a few code snippets or answer several questions, then judge its ability based on whether the responses “sound human.” For real development work, however, model evaluation cannot stop at the chat experience. In complex projects involving financial data, external APIs, local databases, and automated analysis, reliability depends on whether the model can turn an ambiguous goal into an executable process and remain controllable when errors occur.

    This article uses a representative scenario: combining personal trade records with historical market data to build an analysis system for performance review and backtesting. The purpose is not to prove that one model is universally better than another, but to demonstrate a more professional evaluation methodology.

    1. Define What You Are Evaluating

    The capabilities of a large language model can generally be divided into five areas.

    Understanding. Can the model identify the user’s actual problem instead of generating template code based on a few keywords?

    Planning. Complex tasks may involve reading data, cleaning fields, calling APIs, designing a database, calculating backtests, and generating reports. Whether the model can break the project into appropriate stages directly affects the risk of losing control.

    Execution. Can the generated code run? Does it handle exceptions and account for pagination, rate limits, duplicate data, and null values?

    Verification. Can the model proactively check data volume, time ranges, field meanings, and calculation results instead of assuming everything is correct after generating the code?

    Interaction stability. During a long task, does the model become stuck, repeat itself, or lose context? Can it continue after an interruption? These are important factors in real-world use.

    Model evaluation should therefore focus not only on whether code was produced, but also on whether the model established a workflow that is auditable, reproducible, and correctable.

    2. Start with a Realistic Task, Not Simple Q&A

    The most effective evaluation approach is to give the model a small or medium-sized project with real constraints.

    For example, a user may have trade records containing the security identifier, trade direction, execution price, quantity, execution time, fees, and other fields. The goal is to:

    1. Identify the instruments mentioned in the trade records;
    2. Retrieve historical market data for the corresponding date ranges;
    3. Store the original trades and market data in a local database;
    4. Reconstruct changes in portfolio holdings;
    5. Calculate returns, drawdown, win rate, and holding periods;
    6. Produce a readable performance review report.

    The difficulty lies not in any single function, but in connecting multiple stages correctly. Instrument names may not be unique, date formats may differ, market-data APIs may omit certain trading days, and the adjustment method can affect backtest results. If a model only produces code that looks complete without asking about these issues, its engineering capability remains limited.

    3. Use Staged Interaction Instead of Generating the Entire System at Once

    Complex tasks should not be completed with a single prompt. A safer approach is to divide the project into stages and request human confirmation after each stage.

    Stage 1: Parse and Confirm the Source Data

    First, ask the model to read the trade files and provide only field identification and a data overview. It should not immediately implement the backtesting logic. The following points should be checked:

    • Which worksheets are included in the file;
    • The name and data type of each field;
    • Whether there are null values, duplicate rows, or abnormal prices;
    • Whether dates represent calendar days, trading days, or timestamps;
    • How buy and sell directions are represented;
    • Whether commissions and taxes are recorded separately.

    At this stage, the most valuable output is not code, but a data dictionary and a list of risks. Confirming the meaning of each field before proceeding can significantly reduce rework.

    Stage 2: Extract Instruments and Review Them Manually

    Ask the model to extract the instruments from the trade records, generate a deduplicated list, and mark the first and last trade dates for each instrument. Human review is necessary because an instrument-identification error can affect the entire analysis.

    A robust workflow should preserve three fields: the original name, the normalized name, and an internal unique identifier. Names should not be used as the sole primary key. For duplicate names, renamed instruments, or inconsistent formats, an explicit mapping table should be introduced.

    Stage 3: Design the Data Storage Structure

    Market data and trade records should not simply be placed in one temporary file. At a minimum, the data model should separate the following tables:

    • instrument: Basic instrument information;
    • trade_record: Original trade records;
    • daily_quote: Daily market data;
    • intraday_quote: Intraday market data;
    • sync_task: Data synchronization tasks and statuses;
    • backtest_result: Backtest results and parameter records.

    The database design should include uniqueness constraints. For example, the instrument identifier, trading date, and quote interval can form a unique key to prevent duplicate requests from contaminating the dataset. Original and cleaned data should also be stored separately whenever possible so that the source can be traced when problems occur.

    4. Data Ingestion Is a Critical Part of Model Evaluation

    When a model calls a data API, do not verify only whether the request returned a response. Also verify whether the response is complete.

    A properly designed synchronization module should support at least the following capabilities:

    1. Send requests in batches by instrument and date range;
    2. Retry failed API requests;
    3. Control request frequency;
    4. Record the start time, end time, and status of each task;
    5. Save the number of successful and failed records and the reasons for failure;
    6. Support resumable execution;
    7. Perform idempotent writes for duplicate data;
    8. Issue clear warnings when data is missing.

    The core process can be represented with the following pseudocode:

    1. for instrument in instruments:
    2. task = create_sync_task(instrument, start_date, end_date)
    3. try:
    4. for page in request_by_page(instrument, start_date, end_date):
    5. rows = normalize(page)
    6. validate(rows)
    7. upsert(rows)
    8. update_progress(task, len(rows))
    9. mark_success(task)
    10. except Exception as exc:
    11. record_error(task, str(exc))
    12. mark_failed(task)

    The key evaluation point is not whether the model can generate a loop. It is whether the model considers failure recovery, progress reporting, and data validation.

    5. A Backtesting System Must Distinguish Data Correctness from Conclusion Correctness

    A backtest result that looks reasonable does not necessarily mean that the calculation is correct. At least the following issues should be checked.

    1. Look-Ahead Bias

    When making a trading decision for a given day, the system may use only information that was publicly available at that time. If the model calculates a buy price using the closing price while the trade actually occurred before market close, the result may contain look-ahead bias.

    2. Trade Ordering

    The order of multiple buys and sells on the same day affects holdings and cost basis. The system must sort trades by their actual execution timestamps rather than by date alone.

    3. Trading Costs

    Commissions, taxes, slippage, and minimum trade sizes all affect returns. If the system calculates only the price difference, performance will usually be overstated.

    4. Suspensions, Price Limits, and Missing Quotes

    When no executable price is available on a particular date, the system must not automatically substitute the previous day’s price. It should distinguish explicitly between no trading, missing data, and an API that failed to return data.

    5. Calculation Parameters

    Backtest results must preserve parameters such as initial capital, adjustment method, commission rate, slippage assumptions, and trading rules. Without these parameters, the same strategy cannot be reproduced.

    6. How to Detect “False Completion”

    In practical use, a model may produce a large block of code and claim that the task is complete, even though the code was never executed or only handles ideal conditions. To identify false completion, ask the model to provide:

    • The project directory structure;
    • The responsibility of each file;
    • The database schema;
    • The commands required to run the project;
    • A minimal test dataset;
    • Features that have been verified;
    • Features that have not been verified;
    • Known issues;
    • Error logs and suggested fixes.

    If the model cannot clearly explain what has actually been executed and what is only inferred, the result should not be considered complete.

    You can also introduce deliberate failures, such as an empty file, duplicate records, invalid dates, API timeouts, and missing fields. Observe whether the model can handle them consistently. A genuinely useful model is not one that always produces a “correct answer,” but one that exposes uncertainty when uncertainty exists.

    7. Handle Model Delays and Interruptions as Engineering Problems

    A long period without a response during a complex task does not necessarily indicate insufficient model capability. The cause may be an overly long context, a failed tool call, an external API waiting state, or a problem in the execution environment. The following practices can improve reliability:

    • Break large tasks into shorter tasks;
    • Require clear intermediate results at each step;
    • Separate code execution from code explanation;
    • Back up important files;
    • Create a version record before each modification;
    • Add timeouts and retry mechanisms to long-running tasks;
    • Resume from a task-status table after an interruption instead of rerunning the entire workflow.

    This also shows why model evaluation cannot be separated from the usage environment. A model may provide excellent individual answers but still have limited value in real development if it cannot reliably complete a multi-turn collaboration.

    8. Build Reusable Evaluation Metrics

    A model can be scored across the following dimensions:

    Evaluation dimension Key focus
    Requirements understanding Whether it identifies key constraints and hidden risks
    Task planning Whether it can divide the work into appropriate stages
    Code quality Whether the code is modular, maintainable, and testable
    Data reliability Whether it validates completeness and consistency
    Exception handling Whether it supports retries, recovery, and alerts
    Result interpretation Whether it explains definitions, assumptions, and limitations
    Interaction stability Whether it can sustain a long-running workflow
    Security awareness Whether it avoids exposing credentials and sensitive data

    When personal accounts, access tokens, and local files are involved, security requires particular attention. Credentials should not be placed directly in prompts, code repositories, or logs. Sensitive configuration should be loaded through environment variables or secure local configuration. The model should also not receive more file or system permissions than the task requires.

    Conclusion

    The most reliable way to evaluate a new model is not to compare a few conversational answers, but to ask it to complete a clearly bounded project using realistic data and a verifiable process. In a trading-data analysis scenario, the key questions are whether the model can understand the business objective, make progress in stages, build a reliable data pipeline, identify backtesting pitfalls, handle failures, and clearly distinguish verified results from unconfirmed assumptions.

    Treating a model as a programmer that can automatically complete everything often leads to disappointment. Treating it instead as a collaborative tool with planning, coding, and explanation capabilities—and supporting it with clear task boundaries, testing procedures, and human review—provides a more objective way to assess its practical value.