Evaluation Overview
Evaluation is a critical aspect of developing and deploying LLM applications. Usually, teams use a multitude of different evaluation methods to score the performance of their AI application depending on the use case and the stage of the development process.
Watch this walkthrough of Langfuse Evaluation and how to use it to improve your LLM application.
Why use LLM Evaluation?
LLM evaluation is crucial for improving the accuracy and robustness of language models, ultimately enhancing the user experience and trust in your AI application. Here are the key benefits:
- Quality Assurance: Detect hallucinations, factual inaccuracies, and inconsistent outputs to ensure your AI app delivers reliable results
- Performance Monitoring: Measure response quality, relevance, and user satisfaction across different scenarios and edge cases
- Continuous Improvement: Identify areas for enhancement and track improvements over time through structured evaluation metrics
- User Trust: Build confidence in your AI application by demonstrating consistent, high-quality outputs through systematic evaluation
- Risk Mitigation: Catch potential issues before they reach production users, reducing the likelihood of poor user experiences or reputational damage
Online & Offline Evaluation
Offline Evaluation involves
- Evaluating the application in a controlled setting
- Typically using curated test Datasets instead of live user queries
- Heavily used during development (can be part of CI/CD pipelines) to measure improvements / regressions
- Repeatable and you can get clear accuracy metrics since you have ground truth.
Online Evaluation involves
- Evaluating the application in a live, real-world environment, i.e. during actual usage in production.
- Use Evaluation Methods that track success rates, user satisfaction scores, or other metrics on live traffic
- Advantage of online evaluation is that it captures things you might not anticipate in a lab setting
- Can include collecting implicit and explicit user feedback, and possibly running shadow tests or A/B tests
In practice, successful evaluation blends online and offline evaluations. Many teams adopt a loop-like approach. This way, evaluation is continuous and ever-improving.
Adapted from: “How to continuously improve LLM products?”, Evidently
Core Concepts
Concept | Description |
---|---|
Scores | Scores are a flexible data object that can be used to store any evaluation metric and link it to other objects in Langfuse. |
Evaluation Methods | Evaluation methods are functions or tools to assign scores to other objects. |
Datasets | Datasets are a collection of inputs and, optionally, expected outputs that can be used during Experiments (formerly Dataset runs). |
Experiments / Dataset Runs | Experiments (formerly Dataset runs) are used to run a dataset through your LLM application and optionally apply evaluation methods to the results. |
Evaluation Methods
Evaluation methods are functions or tools to assign evaluation Score
s to other objects. Langfuse uses the Scores to store evaluation metrics, it is meant to be flexible to represent any evaluation metric.
Langfuse currently supports: automatic scoring through LLM-as-a-Judge, manual Human Annotations or fully Custom Scoring via API/SDKs. We keep adding more evaluation methods fast, so stay tuned!
Learn more about the Scores Data Model.
Experiments
Experiments are used to loop your LLM application through Datasets (local or hosted on Langfuse) and optionally apply Evaluation Methods to the results. This lets you strategically evaluate your application and compare the performance of different inputs, prompts, models, or other parameters side-by-side against controlled conditions.
In Langfuse we differentiate between Experiments via SDK vs. Experiments via UI. Experiments via UI rely on Dataset, Prompts and optionally LLM-as-a-Judge Evaluators all being on the Langfuse platform and can be thus triggered and executed directly on the platform. Experiments via SDK are fully flexible and can be triggered from any external system.
For the best experiment run comparison experience, we recommend managing the underlying Datasets on the Langfuse platform.
Learn more about the Experiments Data Model.