Stop Guessing: How to Evaluate Modern LLM Applications
A practical framework for measuring what matters across prompts, retrieval, and tool behavior
Every team building with large language models (LLMs) hits the same inflection point. The prototype works. The demo impresses stakeholders. Early users are enthusiastic. And then the system goes to production, where it encounters real queries from real users operating in real conditions, and something goes wrong. Not catastrophically wrong, usually. Wrong in the quiet, corrosive way that erodes trust over weeks and months. Answers that are almost right but miss a critical detail. Responses that cite internal documents but pull from the wrong version. Tool calls that fire when they should not, or fail to fire when they should.
The instinct is to fix the prompt.
This approach is understandable. Prompts are the most visible, most accessible lever in any LLM application. Changing a prompt takes minutes, requires no infrastructure changes, and often produces an immediate visible improvement on the specific failure that triggered the fix. Teams iterate on wording, add instructions, restructure examples, and test against the offending query. The new version handles that case better. Problem solved.
Except that the problem remains unsolved. It has been patched, and in production systems, there is a meaningful difference between patching and solving. The organizations that are deploying LLM applications successfully at scale have learned this the hard way and have built something fundamentally different in response. They have built evaluation systems.
This issue explores what systematic evaluation looks like for modern LLM applications, why it matters for enterprise governance, and how to move beyond prompt tinkering into a disciplined practice that actually improves outcomes.
Why Prompt Tinkering Hits a Wall
Prompt engineering is a legitimate discipline. Good prompts matter. The structure of instructions, the quality of examples, and the specificity of formatting guidance all influence how a model behaves. But prompt engineering, as the primary mechanism for improving production LLM systems, has severe limitations that most teams discover only after investing significant effort.
The first limitation is visibility. When you change a prompt and test it against the query that failed, you learn exactly one thing: whether the new prompt handles that specific query better. This does not address whether it can handle the other 10,000 queries your system processes daily. You do not learn whether the fix introduced regressions in cases that previously worked. Prompt changes propagate through the entire system, affecting every interaction, and without systematic measurement, the net effect is unknowable.
The second limitation is misattribution. Production failures in LLM applications often appear as prompt problems when they are actually retrieval, orchestration, or data problems. A customer service system that provides incorrect policy information may appear to have a prompt issue, when the real problem is that the retrieval pipeline is returning an outdated policy document. A financial analysis tool that produces inconsistent numbers may seem to need better instructions when the actual issue is that the tool-calling mechanism is passing malformed parameters to the calculation API. Research published in 2025 found that, under realistic conditions, roughly 70% of the passages retrieved by RAG systems did not directly contain the correct answer. When your retrieval is that noisy, no prompt will reliably produce correct outputs.
The third limitation is false confidence. Prompt iteration creates a strong psychological signal of progress. Each iteration produces a visible improvement on the test case that motivated it. Teams accumulate a growing collection of “fixed” cases and naturally conclude that the system is getting better. But without systematic measurement across a representative set of queries, this confidence is unfounded. The system may be getting better at the specific cases the team has examined while getting worse in ways nobody has noticed yet.
The mature approach recognizes prompt quality as one variable in a complex system and evaluates all variables together.
What “Evaluation” Should Mean for LLM Applications
Evaluation is not a test you run before deployment. It is a continuous practice that spans the entire lifecycle of an LLM application. This distinction matters because LLM applications are fundamentally different from traditional software in ways that make one-time testing insufficient.
Traditional software behaves deterministically. Given the same input, it produces the same output. You can write tests that verify specific behaviors and have confidence that passing tests will continue to pass unless someone changes the code. LLM applications do not work this way. The model itself is probabilistic. The data flowing through the system is constantly changing. User behavior evolves. External APIs and data sources update. A system that performs well today may degrade tomorrow for reasons unrelated to any changes your team made.
Effective evaluation for LLM applications operates at two timescales and two levels of granularity.
The two timescales are offline evaluation and production monitoring. Offline evaluation runs controlled experiments against curated test sets before changes are deployed. Production monitoring tracks system behavior continuously against live traffic. Both are essential. Offline evaluation tells you whether a change is likely to improve things. Production monitoring tells you whether it actually did, and whether anything else has shifted in the meantime.
The two levels of granularity are component-level evaluation and end-to-end evaluation. Component-level evaluation examines individual pieces of the system in isolation. How good is the retrieval? How well does the model follow instructions? Does the tool-calling mechanism select the right tools? End-to-end evaluation examines the final output that the user actually sees. Is the answer correct? Is it complete? Is it grounded in the provided context? These are complementary lenses. Component evaluation helps you diagnose problems. End-to-end evaluation helps you measure user experience.
The organizations getting real value from LLM evaluation maintain all four of these capabilities simultaneously. They run offline tests before deploying changes, continuously monitor production behavior, examine individual components when diagnosing issues, and measure the final user-facing output to assess overall quality.
Evaluating Prompts Systematically
With the caveats about prompt tinkering established, prompts still deserve careful evaluation. The goal is to move from ad hoc testing against individual examples to systematic measurement against a representative set of inputs.
Effective prompt evaluation examines three dimensions. The first is instruction following. Does the model actually do what the prompt tells it to do? If the prompt says to respond in JSON format, does the output parse as valid JSON? If the prompt says to limit the response to three sentences, does the model comply? If the prompt says to decline questions outside a defined scope, does the model respect that boundary? These are verifiable, often automatable checks.
The second dimension is answer quality. Given the information available in the context, how good is the response? This is harder to measure automatically because “quality” depends on the use case. For a customer service application, quality might mean accuracy, completeness, and appropriate tone. For a code generation tool, quality might mean correctness, efficiency, and adherence to coding standards. For a summarization system, quality might mean faithfulness to the source material and appropriate compression. Defining what quality means for your specific application is a prerequisite that many teams skip.
The third dimension is robustness across variation. A prompt that works well for straightforward queries but breaks down on edge cases, ambiguous inputs, or adversarial phrasings is not production-ready. Evaluation should include the easy cases that the system should handle routinely, the hard cases that test the boundaries of system capability, and the adversarial cases that probe for failure modes.
The practical mechanism for prompt evaluation is a fixed test set of representative queries, sometimes called a “golden set” or “eval set.” This test set should include examples from each category of expected input, annotated with expected outputs or, at a minimum, with criteria for acceptable outputs. When evaluating a prompt change, you run the new prompt against the entire test set and compare the results to those of the previous version.
Side-by-side comparison is the workhorse technique. Present the outputs from two prompt versions to evaluators (human or automated) without revealing which version produced which output, and ask them to assess quality. This approach controls for the bias that comes from knowing which version is “new” and which is “old.”
LLM-as-a-judge, where you use one model to evaluate the outputs of another, has become a standard technique for scaling prompt evaluation beyond what human review can handle. The approach works well for many evaluation criteria, but it comes with documented limitations. Research has shown that LLM judges exhibit position bias (preferring whichever answer appears first), verbosity bias (rating longer answers higher regardless of quality), and what researchers have termed “situational preference,” where the same judge gives inconsistent ratings on difficult cases. Even top-performing models fail to maintain consistent preferences in nearly a quarter of challenging evaluations. Calibrate your automated judges against human judgment on a sample of cases, and do not treat their scores as ground truth.
Evaluating Retrieval
If your application uses retrieval-augmented generation, and most enterprise LLM applications do, retrieval quality is likely the single most important factor in system performance. A perfect prompt cannot compensate for a retrieval pipeline that surfaces the wrong documents. And retrieval failures are particularly insidious because they are invisible to end users. The user sees a fluent, confident answer. They have no way to know that the answer was generated from irrelevant or outdated source material.
Retrieval evaluation examines three properties. The first is relevance. Of the documents or passages retrieved for a given query, how many are actually relevant to answering it? This is the most fundamental retrieval metric, and poor relevance is the most common retrieval failure. Studies of production RAG systems have found that retrieved passages frequently do not contain the information needed to answer the query correctly. When this happens, the model either hallucinates an answer, synthesizes something plausible but wrong from tangentially related material, or acknowledges it cannot answer. And hallucination is the most common outcome.
The second property is coverage. Even if retrieved documents are relevant, do they contain all the information needed for a complete answer? Partial retrieval is a subtle failure mode. The system might find a document that mentions the customer’s pricing tier, but miss the document that describes the exception applicable to their specific contract. The resulting answer is partially correct and therefore more dangerous than a clearly wrong answer, because partial correctness is harder to detect.
The third property is noise. Retrieval systems often return a mix of relevant and irrelevant passages. The model must then determine which passages to rely on and which to ignore. Research has demonstrated that RAG systems are sensitive to the ordering and composition of retrieved context. Simply reordering the same set of retrieved documents can change the model’s answer. Noisy retrieval puts an unfair burden on the model to perform information triage that it was not designed for.
Measuring these properties requires ground truth. For each query in your evaluation set, you need to know which documents or passages contain the correct answer. Building this ground truth is labor-intensive but essential. Without it, you cannot distinguish between a prompt problem and a retrieval problem when the system produces an incorrect answer.
Practical retrieval metrics include precision at k (the fraction of the top k retrieved documents that are relevant), recall (the fraction of all relevant documents that were retrieved), and mean reciprocal rank (the average position of the first relevant document in the result list). These are standard information retrieval metrics that predate LLMs by decades, and they remain the right tools for the job.
One pattern that experienced teams watch for is the interaction between retrieval quality and prompt quality. When retrieval is good, providing relevant, complete, low-noise context, even a mediocre prompt produces acceptable results. When retrieval is poor, even an expertly crafted prompt produces unreliable results. This interaction means that investing in retrieval quality often yields higher returns than investing in prompt refinement, particularly for systems that have already undergone initial prompt optimization.
Evaluating Tool-Calling Behavior
As LLM applications grow more capable, they increasingly rely on tool calling to perform actions, retrieve structured data, execute calculations, and interact with external systems. Agentic architectures, where the model orchestrates multi-step workflows across multiple tools, are becoming the standard pattern for complex enterprise applications. And tool calling introduces an entirely new category of failure modes that prompt-level evaluation cannot capture.
Tool-calling evaluation examines several dimensions.
The first is tool selection
Given a user query, does the model choose the correct tool? In systems with many available tools, the model must interpret the user’s intent and map it to the appropriate capability. Errors here include calling the wrong tool entirely, calling a tool when the query should have been answered directly from the model’s knowledge, or failing to call any tool when one was clearly needed. Research benchmarks have found that even top-performing models achieve only about 50% accuracy on multi-step tool-use tasks, highlighting the room for improvement.
A concrete example makes this tangible. Consider an internal financial analysis agent that has access to a revenue lookup API, a forecasting model, a currency conversion tool, and a report generation service. A user asks, “How did our EMEA revenue compare to the forecast in Q3?” The correct behavior is to call the revenue lookup API with the EMEA region filter and Q3 date range, then call the forecasting tool with the same parameters, then compare the two results. A tool selection failure might look like the model calling the currency conversion tool first (because the query mentions a non-US region) or skipping the forecasting tool entirely and answering based on its parametric knowledge of what forecasts “typically” look like. Both failures produce fluent, confident responses. Both are wrong in ways that a prompt evaluation would never detect.
The second dimension is parameter correctness
Even when the model selects the right tool, it must construct the correct parameters. Staying with the same example, suppose the model correctly calls the revenue API but passes “Q3 2025” as a string when the API expects start and end dates in ISO format. Or it passes the region code “EMEA” when the API expects “EU” plus separate calls for the Middle East and Africa. The API might return an error, or, worse, a valid but incorrect result, perhaps defaulting to global revenue when it receives an unrecognized region code. Parameter errors are particularly dangerous precisely because the tool often executes successfully, the model receives a response, and it incorporates that response into its answer with full confidence. The error is buried in the mechanics of the call rather than surfaced as an obvious failure. The user sees a number that looks reasonable, but it is wrong.
The third dimension is sequencing
Many real-world tasks require multiple tool calls in a specific order, where the output of one call informs the input to the next. In the EMEA revenue example, the model needs to complete the revenue lookup before it can compare it to the forecast. If it calls both tools simultaneously with independent parameters, it might compare Q3 actual revenue against a Q2 forecast, or against a forecast generated with different regional assumptions. Sequencing errors also include making redundant calls that waste resources without improving the answer, or failing to pass the output of one call as input to the next when the tools are designed to work in a chain.
The fourth dimension is failure handling
What does the model do when a tool call fails? Production systems routinely encounter timeout errors, rate limits, malformed responses, and service outages. If the revenue API is down, does the agent tell the user it cannot retrieve the data right now, or does it quietly produce an answer based on whatever information it has in context, which might be last quarter’s cached results or its own training data? A well-designed system should retry when appropriate, fall back to alternative approaches when possible, and communicate limitations transparently when it cannot fulfill the request. A poorly designed system either hallucinates a response as if the tool call had succeeded, or fails silently, or enters a retry loop that burns tokens and time without ever surfacing the issue.
Evaluating tool-calling behavior requires test cases that cover each of these dimensions, including explicit failure cases. Your evaluation set should include scenarios where the correct action is not to call any tool, where a tool call should fail, and the model should handle the failure gracefully, and where multiple tools must be orchestrated in sequence. The negative and edge cases are often more revealing than the happy-path tests that most teams start with. A useful practice is to log every tool call in production, including the parameters passed and the responses received, and periodically audit a sample for correctness. This audit often reveals patterns of parameter errors or unnecessary calls that would be invisible without systematic inspection.
System-Level Evaluation
Component-level evaluation of prompts, retrieval, and tool calling is essential for diagnosis, but it is insufficient to measure what the user actually experiences. System-level evaluation examines the application's complete output, from query to final response, and assesses whether the system accomplished its purpose.
System-level evaluation should measure at least four properties.
The first is correctness
Is the information in the response factually accurate? This seems straightforward, but it is operationally challenging because it requires some source of truth to evaluate against. For systems that answer questions from a defined knowledge base, correctness can be assessed against it. For systems that perform calculations or data lookups, correctness can be verified against the underlying data. For systems that generate creative content or provide subjective guidance, correctness may need to be reframed in terms of appropriateness or alignment with organizational guidelines.
The second is faithfulness
Even if the response is factually accurate, is it grounded in the context that was provided? A system might produce a correct answer that it derived from its parametric knowledge rather than from the documents it was supposed to reference. This matters because parametric knowledge can be outdated, and because users of enterprise applications need to trust that answers are based on authoritative sources rather than the model’s general training. Faithfulness evaluation compares the claims in the response against the retrieved context and flags any claims not supported by the provided material.
The third is usefulness
A response can be correct and faithful while still being unhelpful. It might be too vague, too verbose, poorly structured, missing the key information the user needed, or pitched at the wrong level of technical detail. Usefulness is inherently subjective and use-case-specific, which makes it harder to automate. But it is arguably the most important dimension because it directly determines whether users derive value from the system.
The fourth is operational performance
Production systems must meet practical constraints around latency, cost, and reliability. An answer that takes 30 seconds is often worse than a slightly less comprehensive answer that arrives in three seconds. A system that costs $5 per query to run will not scale to enterprise volumes. Operational metrics, including response time, token consumption, error rates, and infrastructure costs, are essential inputs to system-level evaluation. Cost-aware evaluation is becoming increasingly important as organizations discover that the most accurate system configuration can be four to ten times more expensive than a balanced one, and most production use cases do not require maximum accuracy on every call.
Safety and compliance represent a fifth dimension
They are particularly important for enterprise deployments. Does the system respect content policies? Does it decline requests outside its defined scope? Does it avoid generating content that could create legal, regulatory, or reputational risk? These constraints are typically defined by organizational policy and tested through targeted adversarial evaluation, including red-teaming exercises that attempt to elicit prohibited behaviors.
Building an Evaluation Loop
Prompt evaluation, retrieval evaluation, tool-calling evaluation, and system-level assessment are most effective when integrated into a continuous loop rather than treated as periodic activities.
The foundation of the evaluation loop is a representative benchmark set. This is a curated collection of test cases that reflects the full range of inputs your system encounters in production. Building this set is one of the highest-value investments a team can make, and it is never truly finished. Good benchmark sets share several characteristics.
They are representative
The distribution of test cases should roughly match the distribution of real queries. If 60% of your production traffic involves policy questions, 20% involves account inquiries, and 20% involves troubleshooting, your benchmark set should reflect those proportions.
They are annotated
Each test case should include criteria for acceptable responses. For factual queries, this means the correct answer. For more subjective queries, this means a rubric that defines what “good” looks like. Annotations are expensive to create but essential for automated evaluation.
They are versioned
As you add new test cases, fix incorrect annotations, or adjust evaluation criteria, you need to track those changes so you can compare results across versions of the benchmark set and determine whether improvements are real or artifacts of benchmark changes.
They grow from production failures
Every time the system fails in production, and the failure is identified, the offending query should be added to the benchmark set with an annotation indicating the correct behavior. Over time, this process builds a benchmark set specifically tuned to your system’s failure modes, making it increasingly useful for detecting regressions.
With a benchmark set in place, you need metrics for each layer of the system. Retrieval metrics such as precision and recall at the retrieval layer, instruction following and quality scores at the prompt layer, selection accuracy and parameter correctness at the tool-calling layer, and correctness, faithfulness, and usefulness at the system level. These metrics should be computed automatically whenever a change is proposed, providing immediate feedback about whether the change improves or degrades performance.
The final element of the evaluation loop is failure review. On a regular cadence, the team should examine recent production failures, classify them by root cause (prompt, retrieval, tool calling, data quality, or something else), and convert them into new test cases. This practice serves two purposes. It continuously improves the benchmark set and builds organizational knowledge of the system’s failure patterns, which in turn informs architectural and strategic decisions.
What Mature Teams Do Differently
The gap between teams that struggle with LLM quality and teams that manage it well is not primarily about talent or tooling. It is about whether evaluation is embedded in how the team works or bolted on as a periodic exercise.
The teams that get this right have made evaluation a reflex, not an event. When an engineer changes a prompt, the benchmark suite runs before the change is merged, just as unit tests run before a code change is merged. The results show up in the review itself. Regressions are visible immediately. Nobody has to remember to run the eval suite because the pipeline runs it for them. This is not a high bar to clear technically, but it requires a decision that evaluation is important enough to be a gate rather than a suggestion. Most teams that have not made that decision are still running evaluations manually, sporadically, and only when something has already gone wrong.
Longitudinal tracking matters more than most teams initially appreciate. A single evaluation tells you where the system stands today. A trend line over weeks and months tells you something far more valuable. It reveals a gradual degradation that no single snapshot would catch. It shows whether a series of small, individually harmless changes has compounded into a meaningful regression. It gives your AI Council or risk committee something concrete to review beyond anecdotes. The teams that produce these trend lines are the ones that can answer the question “Is our AI getting better or worse?” with data rather than intuition.
One of the most consequential shifts happens when teams start using evaluation data to inform product decisions rather than treating it exclusively as a model-tuning signal. A pattern I have seen repeatedly is that evaluation reveals a category of queries where the system consistently underperforms, and the engineering instinct is to fix the model’s handling of those queries. But when product leaders see the same data, they sometimes reach a different conclusion. Maybe those queries should be routed to a human. Maybe the interface should guide users away from ambiguous phrasing. Maybe the feature needs tighter scoping. The cheapest, most effective fix for a struggling LLM feature is often a product change rather than a model change. Teams that wall off evaluation data inside the engineering function miss this entirely.
The open-source ecosystem has matured substantially in the past eighteen months. Frameworks like RAGAS, DeepEval, and TruLens now provide standardized metrics for retrieval quality, faithfulness, and answer relevance, reducing the cold-start effort required to build evaluation infrastructure. But frameworks are scaffolding, not solutions. They need to be populated with test data that represents your actual traffic, configured with metrics that reflect your actual quality standards, and reviewed by people who understand both the technical system and the business domain. A team that installs RAGAS but never builds a representative benchmark set has a tool, not a practice.
Finally, the teams that sustain evaluation over time are the ones that connect it to governance. Evaluation metrics are the evidence base for compliance assertions under the EU AI Act. They are the data that risk committees need to approve or restrict AI deployments. They are the foundation of any credible claim that your AI systems perform as intended. When evaluation is positioned as a governance capability rather than an engineering chore, it earns the organizational investment it needs to remain viable, and it attracts cross-functional attention that makes it useful beyond the engineering team.
Connecting Evaluation to Trusted AI
Trusted AI requires two complementary capabilities: governance frameworks that define what AI systems should do, and observability infrastructure that reveals what AI systems are actually doing. Evaluation is where these capabilities converge for LLM applications.
Governance frameworks establish the standards. The system should provide accurate information. It should cite authoritative sources. It should decline to answer questions outside its scope. It should not generate harmful content. These are policy decisions that reflect organizational values and risk appetite.
Evaluation infrastructure verifies those standards in practice. It measures accuracy against defined benchmarks. It checks faithfulness against retrieved sources. It tests adherence to scope against adversarial inputs. It monitors safety constraints against known attack patterns.
Without governance, evaluation has no criteria. Without evaluation, governance has no evidence. The organizations building truly trustworthy LLM applications understand this relationship and invest accordingly in both.
The practical implication is clear. If your organization is deploying LLM applications in production, you need more than good prompts and a capable model. You need a systematic evaluation practice that covers every layer of the system, runs continuously, and produces evidence that your AI systems meet the standards you have set for them.
Stop guessing and start measuring. The difference between the two is the difference between AI that you hope works and AI that you know works.


