Replicating LLM Applications: Evaluation Methods and Optimization Paths

    This article presents a practical methodology for evaluating large language models and agent harnesses by replicating a mature conversational web application. It covers experiment design with unified prompts and deliverables, a weighted acceptance checklist, key findings on layout fidelity and constraint handling, common failure modes, a reusable workflow, and guidance on choosing execution strategies. Readers will learn how to build a low-cost, comparable evaluation baseline for multi-model technical selection.

    1. Background: Why “Replicability” Is a Test of Model Capability

    A notable trend has emerged in the industry: an open-source model team released a set of application-layer capabilities (including deep reasoning retrieval, file input, speech synthesis, and speech recognition) and explicitly encouraged developers to build complete conversational applications using the public interfaces. The documentation even provided an example path for replicating the official application one-to-one. The service later tightened usage limits (daily conversation turns, input length per request, and so on) due to a surge in traffic, which sparked community discussion.

    Setting aside the operational controversy, this situation gives developers an excellent engineering experiment: use “replicate a mature conversational web application” as the task to horizontally evaluate the real engineering capabilities of different LLMs and agent harnesses. Unlike traditional Q&A evaluations, this type of task assesses four capabilities at once:

    1. Information retrieval: Can it correctly read public documentation and page structures and extract a feature list?
    2. Structured output: Can it produce logically consistent product feature documents and structure diagrams?
    3. Frontend fidelity: Can it approximate the original product in layout, spacing, and interaction details?
    4. Autonomous improvement: Can it propose and implement reasonable experience optimizations after understanding the product positioning?

    This article abstracts the experiment into a general methodology. All information involving specific vendors, products, models, and links has been neutralized, keeping only transferable technical points.

    2. Experiment Design: Building a Comparable Replication Evaluation

    The biggest enemy of evaluation is not weak models but inconsistent variables. To make conclusions credible, you must lock down the experimental conditions first.

    2.1 Unified Task and Unified Deliverables

    The task is set as follows: act as a senior product manager and frontend engineer, and complete three deliverables:

    • Deliverable A: Product feature document + feature structure diagram, covering all visible features and hierarchical relationships on the page;
    • Deliverable B: High-fidelity replicated page, with UI and interactions aligned to the original product;
    • Deliverable C: Improved version of the page, allowing web search for best practices, adding reasonable features, and optimizing the experience.

    2.2 Two Rounds of Prompts: Simulating a Real Development Rhythm

    • Round 1: Provide only the requirements and a reference entry point, with no keys, to observe the model’s planning and decomposition ability;
    • Round 2: Supply the calling credentials to observe whether the model can complete the “integration—debugging—verification” loop.

    This design is critical. In practice, clear divergence appears: some models only perform the most basic connectivity check after receiving credentials, while others proactively construct edge cases, such as overly long input, abnormal responses, concurrent requests, and authentication failures, thereby exposing implementation defects and going back to fix them. This difference is not a single dimension of model “smartness” but a difference in execution strategy and harness orchestration logic.

    2.3 Operational Rules for Controlling Variables

    To ensure fairness, all test groups use the same set of prompts, the same acceptance checklist, and the same runtime environment, without temporarily relaxing standards based on model performance. Only when “operations are completely unified” do the horizontal conclusions have reference value.

    3. Evaluation Dimensions and Acceptance Checklist

    It is recommended to break acceptance into scorable items to avoid subjective judgments like “looks about the same.”

    Dimension Key Checkpoints Suggested Weight
    Documentation quality Feature coverage, hierarchy accuracy, structure diagram readability 20%
    Fidelity Layout grid, component sizing, mobile adaptation, state handling 35%
    Functional completeness Session management, input parsing, streaming output, error messages 25%
    Improvement rationality Whether it solves real pain points rather than piling on features 20%

    An easily overlooked detail is differences in the acceptance environment. For example, share links may behave inconsistently across browsers and network conditions. Mature models proactively note acceptance prerequisites in the documentation. Such “engineering notes” often reflect maturity better than the code itself.

    4. Key Findings: Fidelity Comes Down to Details and Constraint Understanding

    Overall, the most stable groups usually share three characteristics:

    1. Do information architecture first, then write code. Output the feature list and structure diagram first, then move to implementation to reduce rework;
    2. High sensitivity to responsive details. The position, height, corner radius, and safe-area padding of the mobile input box can all be aligned;
    3. Proactively annotate acceptance conditions. Clearly state which capabilities depend on external services and which need verification in specific environments.

    The following is an illustrative layout constraint code snippet that reflects the idea of achieving fidelity through constraints rather than hardcoding:

    1. /* Use container queries + safe-area variables instead of fixed pixels to improve fidelity stability */
    2. .chat-shell {
    3. display: grid;
    4. grid-template-rows: auto 1fr auto;
    5. min-height: 100dvh;
    6. padding-bottom: env(safe-area-inset-bottom);
    7. }
    8. .composer {
    9. position: sticky;
    10. bottom: 0;
    11. max-width: 768px;
    12. margin-inline: auto;
    13. border-radius: 16px;
    14. }
    1. // Minimal viable skeleton for streaming output: emphasize cancellable, retryable, observable
    2. async function streamChat(payload: ChatPayload, signal: AbortSignal) {
    3. const res = await fetch(endpoint, {
    4. method: "POST",
    5. headers: { "Content-Type": "application/json" },
    6. body: JSON.stringify(payload),
    7. signal,
    8. });
    9. if (!res.ok || !res.body) throw new Error(`HTTP ${res.status}`);
    10. const reader = res.body.getReader();
    11. while (true) {
    12. const { done, value } = await reader.read();
    13. if (done) break;
    14. renderChunk(decode(value));
    15. }
    16. }

    5. Common Failure Modes and How to Avoid Them

    • Building only the skeleton without states: Missing loading, empty, and failure-retry states makes it “demo-able but not usable.” The fix is to add the state machine to the acceptance checklist.
    • Over-designing the improved version: Piling on unrelated features and drifting from the product positioning. Improvements must answer “whose problem does it solve.”
    • Ignoring the context budget: Long documents and long conversations crowd out the context, causing later instructions to fail. It is recommended to read in segments, compress with summaries, and retrieve on demand.
    • Improper credential handling: Hardcoding keys into frontend artifacts. The correct approach is to forward requests through a server-side proxy, with the frontend holding only short-lived tickets.
    • Lack of observability: Without logs, metrics, and tracing, production issues cannot be located. This can be filled in with general logging services and monitoring and alerting capabilities.

    6. A Reusable Implementation Workflow

    1. Freeze requirements: Output the deliverables list and acceptance table, review them before starting;
    2. Extract information: Parse public documentation and page structures to form a feature matrix;
    3. Prototype first: Produce static fidelity first, then integrate dynamic capabilities;
    4. Integration and verification: Cover three types of cases: normal flow, boundary flow, and exception flow;
    5. Iterative improvement: Make small-step optimizations based on real pain points, with each step rollback-able;
    6. Delivery notes: Clearly write the prerequisites, known limitations, and acceptance methods.

    7. Selection Advice: Include “Strategy Differences” in the Evaluation

    The most important takeaway from the experiment is: model capability is only one variable; the harness strategy equally determines success or failure. Some execution frameworks lean toward minimal verification and fast delivery; others lean toward deep self-checking and proactively discovering defects. Enterprises should choose based on their own needs: choose a lightweight strategy for speed to market, or choose an orchestration approach with self-checking and regression for stable quality. To further shorten the pipeline, you can also evaluate the combined solution of Baidu AI Cloud in general capabilities such as model services, container platforms, logging, and monitoring, to build a closed loop from development to operations.

    8. Conclusion

    “Replicating a conversational application” seems simple, but it is actually a high-value task for testing model engineering capabilities: it requires information understanding, structural planning, interface fidelity, and autonomous verification at the same time. As long as you unify the variables, refine the acceptance criteria, and make strategy differences explicit, any team can build its own evaluation baseline at low cost and make more rational technical selections in a multi-model environment.