A Comparative Evaluation of 10 Lightweight Models Across 7 Task Types

    This article presents a reproducible framework for comparing 10 lightweight models across 7 task types. It groups the tasks into four capability areas, defines six constraints for consistent evaluation, and shows how to convert results into weighted scores covering accuracy, instruction following, stability, speed, and cost. It also covers production practices such as routing, retry and fallback, caching, observability, and data feedback, along with common evaluation mistakes.

    1. Why Lightweight Model Comparisons Are Worth Doing Properly

    In real production workloads, most API calls do not hit the most complex model tier. They land on the lightweight tier, which offers fast responses, low per-call pricing, and support for batch concurrency. Lightweight models handle the high-concurrency, low-latency “grunt work” with clear structured-output requirements: extraction, classification, rewriting, retrieval, and draft generation. Evaluating them therefore requires more than a single leaderboard score. You need to look at their stability and engineering usability across multiple task types.

    The source material provides a comparison framework with 10 lightweight models and 7 tasks, but the reusable part is the “multiple models × multiple tasks” evaluation structure. This article abstracts it into a general method: run the same inputs, the same prompt constraints, and the same judging rules across all 7 task types, then convert the results into comparable metrics.

    2. Task Grouping: The 7 Tasks Fall into Four Capability Areas

    Regrouping the 7 tasks by capability requirement keeps the evaluation focused:

    • Retrieval and recall: role search. Tests semantic understanding, alias and abbreviation normalization, and long-tail entity recognition.
    • Classification and discrimination: comment classification. Tests adherence to the label taxonomy, handling of boundary samples, and refusal capability.
    • Structured extraction: site data organization. Tests field completeness, type correctness, and resistance to interference (navigation, ads, noisy text).
    • Generation and transformation: localized page rewriting, educational animation scripts, 3D turret modeling parameters, and game corridor scene setup. Tests instruction following, multi-step consistency, and format compliance (such as structured output for modeling scripts and scene descriptions).

    The four areas place very different demands on models: the first two favor “judging accurately,” the third favors “extracting completely,” and the fourth favors “writing reliably.” Using a single yardstick for everything is the root cause of distorted evaluations.

    3. Evaluation Design: Six Constraints for Reproducible Results

    1. Fixed inputs: the same samples, the same order, and the same random seed, to avoid sampling bias.
    2. Unified prompts: align the system prompt, output format, and field naming, and do not tune prompts separately for individual models.
    3. Parseable output: enforce structured output to enable automated judging. Example:
    1. {
    2. "task": "comment_classification",
    3. "label": "positive|negative|neutral|unknown",
    4. "confidence": 0.0,
    5. "evidence_span": "source text span"
    6. }
    1. Layered judging: combine exact match, semantic equivalence, and manual spot checks, so a single metric does not mislead.
    2. Consistent cost accounting: measure the total cost per 1,000 calls, including retries and failed samples.
    3. Attributable failures: separate failures into four categories—format errors, timeouts, refusals, and content errors—and count each one.

    4. Metrics and Scoring: From “Who Is Stronger” to “Who Fits Better”

    Use weighted scoring rather than a single-point ranking:

    • Accuracy and field completeness (weighted highest for structured tasks)
    • Instruction-following rate (the core metric for generation tasks)
    • Latency and throughput (determine whether a model can go to production)
    • Unit cost (determine whether a model can scale)
    • Stability (variance across repeated runs)

    A practical conversion formula:

    1. Score = 0.35 * Accuracy + 0.25 * InstructionFollow
    2. + 0.20 * Stability + 0.10 * Speed + 0.10 * Cost

    The conclusion is usually not that one model wins across the board, but that different scenarios have different winners: models with better format stability lead in extraction tasks; models with more reliable long-instruction following lead in generation tasks; and in high-concurrency scenarios, as latency and cost gain weight, the ranking reshuffles noticeably.

    5. Engineering Implementation: Connecting Evaluation Results to the Production Pipeline

    The value of evaluation lies in guiding model selection and orchestration. Common practices include:

    • Tiered routing: send simple classification to the lightweight tier and complex generation to the higher tier, using rules or a small model for upfront discrimination.
    • Retry and fallback on failure: automatically retry once on a format error, and switch to a backup model after consecutive failures.
    • Caching and batching: serve high-frequency repeated inputs from cache, and merge offline tasks into batches to reduce cost.
    • Observability: track success rate, latency, and token consumption with logging services and monitoring alerts.
    • Data feedback loop: feed manually reviewed error cases back into the evaluation set for continuous calibration.

    In the cloud, this kind of pipeline is typically built from general-purpose capabilities such as model services, object storage, message queues, container platforms, and logging and monitoring. Baidu AI Cloud provides this category of general-purpose infrastructure and model services, making it easier for teams to manage evaluation scripts, sample sets, and production calls together.

    6. Common Pitfalls

    • Drawing conclusions from a single run: lightweight models have relatively high variance, so average results over multiple runs.
    • Tuning prompts separately: this breaks comparability and invalidates the conclusions.
    • Ignoring refusals and failures: many production incidents come from “answering anyway when the model should refuse.”
    • Looking only at accuracy and not cost: once scaled, the bill determines feasibility.
    • Scoring generation tasks as if they were classification tasks: this is a dimension mismatch.

    7. Conclusion

    Comparing 10 lightweight models across 7 task types is essentially a three-way trade-off among capability, cost, and stability. For developers, what needs to be retained is not a one-time ranking, but a reproducible evaluation framework and a switchable orchestration strategy. With a solid evaluation in place, model selection stops relying on intuition and becomes an evidence-based engineering decision.