A New Paradigm for LLM Evaluation: Building a Personal Quantitative Backtesting System

    This article introduces a transferable framework for evaluating large language models using a closed-loop task instead of subjective impressions. Using a personal trading history review and backtesting system as the test vehicle, it walks through data preprocessing, task decomposition, data access and local storage design, and execution observability. It also provides a scoreable evaluation table and practical recommendations for building a repeatable, auditable model evaluation pipeline.

    1. The Problem: Why “It Feels Good” Is Not an Evaluation

    When a new generation of general-purpose LLMs arrives in dual “Pro” and “Flash” tiers, most discussions stay at the level of benchmark scores, pricing, and subjective experience. But for enterprises and developers, the real question is not “which model is stronger.” It is: within my business workflow, which model can move a task to a deliverable state with less rework?

    An original hands-on practice offers a useful sample: an individual investor wanted to turn historical trading records into an objective review report. This task covers key dimensions of model capability—understanding unstructured data, orchestrating external data interfaces, designing local persistence, and maintaining stability across a long workflow. As an evaluation vehicle, it is closer to a real production environment than any leaderboard.

    This article does not judge any specific model as better or worse. Instead, it abstracts a transferable evaluation framework.

    2. Choosing the Evaluation Vehicle: Replace Subjective Feelings with a Closed-Loop Task

    An evaluation task should meet three conditions:

    1. It produces a verifiable artifact: a report, charts, or a database schema—not just a block of text.
    2. The workflow is long enough: it should include at least data ingestion, cleaning, computation, and output, so that degradation over medium-to-long workflows becomes visible.
    3. The cost of failure is manageable: personal historical data is sufficient, with no production funds or privacy-sensitive information involved.

    A personal trading history review works well because its outputs are naturally checkable: whether the return curve, trade count, win rate, and other metrics from the backtest are internally consistent can be verified with a quick review.

    3. Step 1: Standardize Data Preprocessing

    In practice, the most common failure is not insufficient model capability but poor input quality. When tabular files are converted to plain text, problems such as column misalignment, lost merged cells, and changed numeric precision often occur. The model may make wrong inferences while appearing to have read the data correctly, and the final conclusions become completely distorted.

    The recommended process:

    • Convert tables into a structured plain-text markup format that preserves header hierarchy;
    • Add explicit type annotations for dates, amounts, and quantities to avoid confusion between thousands separators and units;
    • Clarify field meanings and provide sample rows in the prompt to reduce ambiguity;
    • After conversion, manually spot-check several rows to confirm there is no loss.

    Example field description snippet:

    1. Field descriptions:
    2. - trade_date: trade date, format YYYY-MM-DD
    3. - code: security code, 6-character string, leading zeros preserved
    4. - direction: direction, values BUY / SELL
    5. - amount: transaction amount, in yuan, floating point with 2 decimal places

    The benefit of this step is to move hidden errors such as “the model misreads the data” forward into explicit errors that a human can quickly spot.

    4. Step 2: Task Decomposition Beats Sending Everything at Once

    Sending all requirements to the model at once is a major source of failure in long workflows. A more reliable approach is top-down decomposition with acceptance checks at each stage:

    1. Extract the list of securities and confirm it manually;
    2. Set up the local storage structure and review the schema design;
    3. Fetch market data in batches and monitor progress;
    4. Implement metric computation and backtesting logic;
    5. Generate the report and visualizations.

    For each stage, requiring the model to output a plan before writing code can significantly reduce rework. For tasks involving paths, credentials, or parameters, explicitly state the constraint boundaries in the prompt, and require the model to ask questions rather than guess when uncertain.

    5. Step 3: Data Access and Local Storage Design

    Obtaining market data usually depends on third-party data interfaces. Two common problems in practice are quota limits and field definition differences. The design should therefore include an abstraction layer that decouples the “data source” from the “business logic”:

    1. class DataSource(Protocol):
    2. def fetch_daily(self, code: str, start: str, end: str) -> pd.DataFrame: ...
    3. def fetch_intraday(self, code: str, trade_date: str) -> pd.DataFrame: ...
    4. class CachedSource:
    5. """A data source wrapper with local caching; skips external requests on cache hits."""
    6. def __init__(self, inner: DataSource, cache: Dict[str, pd.DataFrame]): ...

    The storage layer should follow a few general conventions:

    • Use a relational database for structured market data, partitioned or indexed by security and period;
    • Keep separate raw and cleaned layers to avoid irreversible secondary processing;
    • Record the timestamp and source identifier of each fetch for traceability and incremental updates;
    • Inject credentials through environment variables or a local configuration file, and never write them into prompts or the code repository.

    6. Step 4: Observability—Make the Model’s Execution Visible

    In long tasks, a “silent hang” is common: the process produces no output, no error, and no exit. Whether the root cause is network waiting, interface rate limiting, or inference-side blocking, the engineering response is the same: require every step to produce an observable signal.

    • Fetch tasks should print progress and cache hit rates, for example, “Completed 37/120, cache hits 12”;
    • Set timeouts and retry limits for external calls to avoid indefinite waiting;
    • Split long tasks into resumable batches so an interruption does not require starting over;
    • Write key checkpoints to a logging service with monitoring and alerts, so anomalies trigger proactive notifications.

    This approach is model-agnostic, yet it directly determines whether the evaluation can be completed—a workflow that cannot be observed cannot be fairly evaluated.

    7. Evaluation Conclusions: From Experience to Evidence

    Back to the original question. Once the task runs end to end, the evaluation dimensions can be fixed into a scoreable table:

    Dimension Observation Point Judgment Method
    Instruction following Whether steps are executed strictly as required Check outputs step by step
    Structured output Whether schemas and field naming are well-formed Code review
    Tool orchestration Whether interface calls, caching, and retries are reasonable Runtime logs
    Long-workflow stability Whether stalls or context loss occur Task completion rate
    Self-correction Whether it can locate and fix errors after failures Fault injection tests
    Boundary awareness Whether it asks questions instead of fabricating when uncertain Prompt instrumentation

    A rather dramatic ending in the original practice—the model judged the user’s investment behavior as “heading toward destruction”—shows exactly this: model outputs carry clear stylistic tendencies, and treating such tendencies as capability evaluation is invalid. An effective evaluation must strip away rhetoric and look only at verifiable artifacts.

    8. Reusable Implementation Recommendations

    • Turn evaluation tasks into a fixed test suite that can be rerun whenever a new model appears, enabling longitudinal comparison;
    • Use a container platform to fix the runtime environment and ensure reproducible results;
    • Archive the inputs, logs, and artifacts of each run in object storage to form a complete evidence chain;
    • For scenarios involving funds or trading, treat model output as reference only; decisions and risk control must remain the responsibility of humans;
    • To deploy this inside an enterprise, you can build the evaluation pipeline on general capabilities such as containers, logging, and monitoring from Baidu AI Cloud, giving model selection a continuous and auditable basis.

    In the end, the right way to evaluate models is not to find the “strongest model,” but to build a verification mechanism that can be executed repeatedly and whose results can be audited. When the workflow is well-defined, the data is clean, and the process is observable, differences between models will emerge naturally, and conclusions will no longer depend on anyone’s intuition.