Skip to main content
LLM-as-a-judge evaluators leverage the capabilities of large language models to evaluate the quality of responses from your LLM applications. This approach is particularly useful for subjective assessments that are difficult to capture with code-based evaluators, such as helpfulness, accuracy, or adherence to specific guidelines.

LLM-as-a-judge evaluators

LLM-as-a-judge evaluators are natural language prompts that are run against an LLM, using the input and output from a span, trace, or session. When the span, trace, or session is logged, all the details including inputs and outputs are sent to the LLM along with a prompt, and the response from the prompt is used to score the evaluator. The response needs to be a fixed type for the evaluator to be measured correctly. Currently the following output types are supported: You can create and manage LLM-as-a-judge evaluators from the Splunk Agent Observability UI, or in code.

Create a new LLM-as-a-judge evaluator in the UI

1

Navigate to the evaluators section

Use the Splunk Agent Observability main menu to select Evaluators. Select the Create evaluator button.Create a new evaluator
2

Select the LLM-as-a-Judge evaluator type

From the dialog that appears, choose the LLM-as-a-judge evaluator type. This allows you to create evaluators that use an LLM to evaluate responses based on criteria you define.
3

Give your evaluator a name and description

If you are planning to use this evaluator in an experiment, then the name you set here is the name of the evaluator that you pass to the run experiments function.Create a custom LLMAJ evaluatorFor example, if you have an evaluator named "Compliance - do not recommend any financial actions", you would pass this to an experiment like this:
4

Define what this evaluator applies to

In the Apply to box, select what level this evaluator applies to.
5

Configure the evaluator

In the Prompt editor, configure the following fields:
  • LLM model - select the model from the available integrations that you want to use to test this evaluator.
  • Step-by-step reasoning - turn this on to see evaluator explanations, giving a reasoning behind the score. This will use more LLM tokens, and have a corresponding increase in cost.
  • No of judges - select the number of judges to use. The evaluator is run against each judge, and an average score is returned. The more judges you use, the more accurate the score, but with a higher cost.
6

Configure the evaluator prompt

In the Prompt editor, enter your prompt. Ensure your prompt defines a clear rubric with explicit scoring criteria. For example:
In this example, the rubric clearly defines the scoring criteria:
This establishes a clear evaluation rubric where “completely followed” is the criterion for a passing grade, while any deviation from the guidance results in a failing grade.Also we recommend not to write any instructions in the prompt regarding the response format.Avoid statements like:
See our prompt engineering guide to learn more about writing an effective prompt, and what happens behind the scenes with your prompts.
7

Optional - get help writing a prompt using Help me write

To help you create an evaluator prompt, you can use the Help me write feature. This allows you to define how you want the evaluator to work in natural language, and Splunk Agent Observability will create the evaluator prompt for you.Once done, select the Generate prompt button to generate the evaluator prompt.
8

Test your evaluator

When you have your evaluator configured, it is important to test the evaluator against multiple inputs and outputs. You can then use the results of the tests to iterate on the evaluator prompt and configuration, for example experimenting with different models, or number of judges.To test your evaluator, head to the Test Evaluator tab. You can either test the evaluator by passing in a manual input, or by using logged sessions, traces, spans, or experiments.Testing an evaluatorDue to the complex structure of sessions and traces, manual input is only supported for evaluators that apply to spans only. To test session and trace level evaluators, you need to test with existing logged sessions or traces, or experiments.For manual input testing, select Manual input and provide the input and output you want to test against, then select the Test button. You will see the result of the evaluator, and an explanation if you have step-by-step reasoning turned on.To test against current logs or experiments, select the project, then select the source type, then select the relevant Agent Stream or experiment.You can then run your evaluator against the last 5 logged sessions, traces, spans, or experiments by selecting the Test Evaluator button. The evaluator will be calculated, along with an explanation if you have step-by-step reasoning turned on.A test evaluator runAfter the evaluators are calculated, select each row to see more details on the explanation if available.
9

Save your evaluator

Once you are happy with your evaluator, select the Create evaluator button to save your evaluator. You can now enable this evaluator for your Agent Streams.

Create a new LLM-as-a-judge evaluator in code

In addition to creating custom LLM-as-a-judge evaluators through the Splunk Agent Observability UI, you can also create these in code.

Create a custom evaluator

When you create a custom evaluator, you need to provide a name and the prompt to use. You can optionally also provide the output type, what it applies to, span, trace, or session, the model to use, if reasoning should be generated, the number of LLM judges to use, and any tags.

Delete a custom evaluator

You can also delete an evaluator by name.

Evaluator versions

As you use your evaluator against real-world data, you may want to iterate over the prompt or configuration to improve how it works when running against real user data. Every time you update the evaluator, a new version is created. This new version becomes the default. You can see the version history and select the default version from the Version History tab. From the version history, you can select the actions menu (…) to tag different versions as the default or restore a version. Version history for a custom evaluator When you add an evaluator to an Agent Stream, you can configure which version is used - either the default, or a specific version. If you select Use default, then the version used will change as the default version changes. If you select a specific version, then only that version will be used.

Best practices for LLM-as-a-Judge evaluators

When to use LLM-as-a-Judge evaluators

LLM-as-a-Judge evaluators are particularly valuable for:
  • Subjective evaluations: Assessing qualities like helpfulness, creativity, or appropriateness
  • Complex criteria: Evaluating adherence to multiple guidelines or requirements
  • Nuanced feedback: Getting detailed explanations about strengths and weaknesses
  • Human-like judgment: Approximating how a human might perceive the quality of a response

Understanding the number of AI judges

The “Number of AI Judges” setting allows you to configure how many independent LLM evaluations to run in a chain-poll approach. This feature balances evaluation accuracy with processing efficiency:
  • Using more judges generally produces more consistent and reliable evaluations by reducing the impact of individual outlier judgments
  • However, increasing the number of judges also increases processing time and associated costs
Consider your specific evaluation needs when configuring this setting, weighing the importance of evaluation consistency against performance and cost considerations.

Limitations and considerations

While powerful, LLM-as-a-Judge evaluators have some limitations to keep in mind:
  • Potential bias: The LLM judge may have inherent biases that affect its evaluations
  • Consistency challenges: Evaluations may vary slightly between runs
  • Cost considerations: Using LLMs for evaluation incurs additional API costs
  • Prompt sensitivity: The quality of evaluation depends heavily on how well the prompt is crafted

Next steps

LLM-as-a-Judge Prompt Engineering Guide

Learn best practices for prompt engineering with custom LLM-as-a-judge evaluators.

Evaluators overview

Explore Splunk Agent Observability’s comprehensive evaluators framework for evaluating and improving AI system performance across multiple dimensions.

Custom code-based evaluators

Learn how to create, register, and use custom code-based evaluators to evaluate your LLM applications.

Run experiments

Learn how to run experiments in Splunk Agent Observability using the Splunk Agent Observability SDKs and custom evaluators.