Evaluating Enhanced and Lightweight LLMs Through Real-World Development Tasks
A practical framework for comparing enhanced and lightweight large language models through a personal trade-record backtesting system, covering data processing, tool calls, database design, fault recovery, observability, cost, and human review. The article explains how to divide responsibilities between model tiers while maintaining reproducibility, auditability, data security, and compliance.
When large language models are released in enhanced and lightweight variants, the community often judges them from a single conversation, a demo, or a short code-generation task. Although intuitive, this approach can be highly misleading. A one-off interaction does not reveal how well a model handles long-context understanding, reliable tool calls, exception recovery, data consistency, or the amount of manual rework required.
A more reliable approach is to place the model inside a realistic but well-bounded project workflow, then evaluate it using reproducible intermediate artifacts and measurable metrics. This article uses a personal trade-record backtesting system as an example. It examines how an LLM can assist with data cleaning, security extraction, market-data retrieval, database modeling, and backtest report generation, and uses the workflow to assess how enhanced and lightweight models can be assigned different development responsibilities.
This article focuses only on engineering methods and technical practices. It is not investment advice. Trading data should be anonymized and processed in a compliant environment.
1. Why Use Trade-Record Backtesting as an Evaluation Project?
Trade-record backtesting is a typical task involving semi-structured data, multiple tool calls, and result interpretation. It includes spreadsheet exports, field normalization, unique-symbol extraction, market-data retrieval, local database writes, backtest metric calculations, and report summarization.
Compared with asking a model to answer a standalone technical question, this type of project exposes more realistic failure modes:
- Can the model understand API documentation in a long context?
- Can it generate executable code step by step?
- Will it invent fields when an API response is incomplete?
- Can it keep progress visible?
- Can it recover from timeouts or interruptions using checkpoints?
The project also has clear success criteria: complete data, reproducible results, an auditable process, and recoverable failures. Once the evaluation metrics are fixed, different model variants can be compared on the same task set.
In general, an enhanced model may be better suited to complex architecture design, long-chain debugging, and report synthesis. A lightweight model may be more suitable for field extraction, format conversion, batch scripts, and frequent low-cost calls. These are only initial assumptions, however, and must be validated through project-level testing.
2. System Goals and Boundaries
The system takes trade-record files exported from a personal securities account and produces a backtesting analysis report. At a minimum, the report should include:
- A list of symbols
- The covered data period
- The number of trades
- Win rate
- Profit-to-loss ratio
- Maximum drawdown
- Returns over holding periods
- Sample-size warnings
- Risk warnings
The scope should also be explicit. The system performs historical backtesting and analysis only. It does not execute trades, make guaranteed return claims, or replace human decision-making.
From a data-security perspective, trade records should first be anonymized by removing account numbers, names, financial account identifiers, and other sensitive fields. Only necessary fields such as trade date, symbol, direction, quantity, price, and fees should be retained.
Market data and backtest results should be stored in a controlled local or cloud environment. If the system is deployed on Baidu AI Cloud, general categories such as object storage, relational databases, logging, and monitoring can be used to store files, task states, and execution logs. The specific service selection should still be determined by compliance requirements and cost constraints.
3. Overall Architecture and Step-by-Step Workflow
The system should be divided into seven layers rather than asking the model to generate the entire application in one pass:
Data export and anonymization
Export a spreadsheet from the trading software, remove sensitive columns, and retain required fields such as trade date, symbol, direction, quantity, price, and fees.Format normalization
Convert the spreadsheet into a general-purpose markup format or structured table that the model can read more reliably. In practice, asking a model to analyze a spreadsheet directly may result in missed fields. Converting it to structured text and performing sample-based validation is often safer.Symbol extraction and human confirmation
Initially ask the model only to extract a deduplicated list of symbols. It should also provide the extraction rationale and identify missing fields. A human should confirm the result before the workflow continues.Market-data adapter layer
Define a unified data-provider interface that hides differences between data sources and standardizes dates, frequencies, adjustment conventions, and units.Local database modeling
Create tables for trade records, symbols, market data, task states, failures, and backtest results. Use primary keys and unique constraints to ensure idempotency.Backtest engine
Calculate returns, drawdowns, win rate, and other metrics either trade by trade or according to defined strategy rules. The engine should also record the sample period.Report generation and review
Let the model summarize the results, but always include the original statistical tables and sample-size warnings. A human should review the output before it is used.
A reusable adapter-layer pattern can be represented as follows:
def fetch_bars(symbol, start, end, freq):return data_provider.query(symbol=symbol, start=start, end=end, freq=freq)def run_fetch(symbols, start, end):for s in symbols:task = task_repo.get_or_create(s, start, end)if task.status == "success":continuetry:bars = fetch_bars(s, start, end, "daily")validate(bars, s, start, end)db.upsert("market_bar", bars)task_repo.mark_success(s)log_progress(s, "done")except Exception as e:task_repo.mark_failed(s, e)log_failure(s, e)
This pseudocode demonstrates three principles: tasks should be reentrant, writes should be idempotent, and failures should be traceable. Whether an LLM proactively incorporates these engineering constraints is an important measure of its production readiness.
4. Step-by-Step Prompts Are More Controllable Than a Single Large Prompt
A key lesson from this type of workflow is that all requirements should not be submitted to the model at once. For personalized, multi-stage tasks, a single broad prompt gives the model too much freedom and makes the final output difficult to verify.
A more effective approach is to divide the work into steps, define acceptance criteria, and preserve intermediate artifacts. For example:
- Step 1: Extract the symbol list and return a structured result together with the extraction rationale.
- Step 2: Retrieve market data through the unified adapter interface, report progress by symbol, write failures to a failure table, and support checkpoint-based resumption.
- Step 3: Generate database DDL and the logic for calculating backtest metrics.
A human should review each stage before allowing the next one to begin.
Prompts can also impose explicit constraints, such as:
- Do not invent data when an external interface has not been called.
- When fields are missing, return a missing-field list instead of guessing.
- Report progress after processing each symbol.
- After a failure, resume from the checkpoint rather than restarting the entire job.
These constraints move model output from “plausible-looking” to “verifiable and operational.”
5. Database and Reliability Design
The database schema should be normalized and extensible. An example market-data table is shown below:
CREATE TABLE market_bar (symbol TEXT NOT NULL,trade_date TEXT NOT NULL,freq TEXT NOT NULL,open REAL,high REAL,low REAL,close REAL,volume REAL,PRIMARY KEY (symbol, trade_date, freq));
The system should also include:
- A task-state table with states such as
pending,running,success, andfailed - A failure table containing error types, retry counts, and the most recent error message
- A backtest-results table containing parameters, sample periods, and calculated metrics
All writes should use upserts or unique constraints to prevent duplicate retrievals from contaminating the dataset. Logs should record the start time, end time, row count, and validation result for each symbol so that the process can be audited.
Model-call reliability also requires engineering controls. Long periods of no response or apparent hangs can occur. The appropriate response is not to repeatedly resend the same large prompt. Instead, the system should use timeouts, heartbeats, and segmented execution. After an interruption, it should resume from the checkpoints already persisted to storage.
Model evaluation should therefore go beyond a single successful run. Useful metrics include timeout rate, retry success rate, average recovery time, and the number of manual interventions. A lightweight model may be faster for simple extraction and batch tasks, while an enhanced model may be more reliable for complex debugging and long workflows. Both claims must be supported by measured results.
6. How to Evaluate Enhanced and Lightweight Models
A fixed evaluation framework should cover the following dimensions:
- Task completion
- Code executability
- Long-context understanding
- Tool-call reliability
- Latency and throughput
- Cost
- Observability
- Security and compliance
- Manual rework rate
Task completion measures whether the model produces usable intermediate artifacts rather than only plausible text. Code executability checks whether the generated code includes exception handling, idempotency, and validation. Long-context understanding measures whether the model can correctly extract fields from interface documentation. Tool-call reliability focuses on timeout handling and recovery after failures. Manual rework rate is especially important because it closely reflects production cost.
In terms of division of labor, a lightweight model is often appropriate for:
- Field extraction
- Format conversion
- Simple script generation
- Batch preprocessing
An enhanced model is often better suited to:
- System architecture
- Complex error diagnosis
- Backtest report summarization
- Risk-warning generation
The two model tiers should not be viewed simply as substitutes. They can work as complementary layers in the same system. The final evaluation should not be reduced to a statement that one model is simply “better.” A useful conclusion should explain which model is more suitable for a particular task, budget, and reliability requirement.
Finally, all model-generated backtesting code and conclusions must be reviewed by a human. Financial data must be handled in compliance with applicable requirements, and backtest results do not constitute investment advice. A statement that a model has identified a strategy as heading toward “destruction,” for example, should be understood as a strong warning about a high-risk trading pattern, not as an executable decision.
The value of this type of system is ultimately determined by data quality, engineering constraints, reproducible processes, and human review—not by a single model interaction.
