> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-patchr-1773857969-df0cef9.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to compare experiment results

When you are iterating on your LLM application (such as changing the model or the prompt), you may want to compare the results of different [*experiments*](/langsmith/evaluation-concepts#experiment).

LangSmith supports a comparison view that lets you identify key differences, regressions, and improvements between different experiments.

## Open the comparison view

1. To access the experiment comparison view, navigate to the **Datasets & Experiments** page.
2. Select a dataset, which will open the **Experiments** tab.
3. Select two or more experiments and then click **Compare**.

<div style={{ textAlign: 'center' }}>
  <img className="block dark:hidden" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/YW-RBMymAcah3n05/langsmith/images/compare-select-light.png?fit=max&auto=format&n=YW-RBMymAcah3n05&q=85&s=b38f9d62abc49a3a19d0423415f3b57a" alt="The Experiments view in the UI with 3 experiments selected and the Compare button highlighted, in light mode." width="2558" height="1668" data-path="langsmith/images/compare-select-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/YW-RBMymAcah3n05/langsmith/images/compare-select-dark.png?fit=max&auto=format&n=YW-RBMymAcah3n05&q=85&s=465650c62e26b31b1ad3e63293d28ac4" alt="The Experiments view in the UI with 3 experiments selected and the Compare button highlighted, in dark mode." width="2552" height="1664" data-path="langsmith/images/compare-select-dark.png" />
</div>

## Adjust the table display

You can toggle between different display options on the right-hand-side bar of the **Comparing Experiments** page.

<img className="block dark:hidden" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/2jr_mPT4vBt8u4Pi/langsmith/images/comparison-table-display-options-light.png?fit=max&auto=format&n=2jr_mPT4vBt8u4Pi&q=85&s=9b174cb6dda4486b75b65ee344388de4" alt="Table display options, in light mode." width="564" height="187" data-path="langsmith/images/comparison-table-display-options-light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/2jr_mPT4vBt8u4Pi/langsmith/images/comparison-table-display-options-dark.png?fit=max&auto=format&n=2jr_mPT4vBt8u4Pi&q=85&s=59174182c8b9ebfd64a1a0b08572940c" alt="Table display options, in dark mode." width="551" height="130" data-path="langsmith/images/comparison-table-display-options-dark.png" />

### Filters

You can apply filters to the experiment comparison view to narrow down specific examples. Common examples for filters include:

* Examples that contain specific `input` / `output`.
* Runs with status `success` or `error`.
* Runs that take more than x seconds in `latency`.
* Specific `metadata`, `tag`, or `feedback`.

In addition to applying filters on the overall experiment view, you can apply filters on individual columns as well. Select the <Icon icon="dots-vertical" /> icon at the top of any column to view the available filters for that column's data.

### Columns

You can select and hide individual feedback keys or individual metrics in the **Columns** settings to isolate the information you need in the comparison view.

### **Full** vs. **Compact** view

* **Full**: Toggling **Full** will show the full text of the input, output, and reference output for each run. If the output is too long to display in the table, you can click on **Expand** to view the full content.
* **Compact**: **Compact** view displays a preview of the experiment results for each example.

### Display types

There are three built-in experiment views that cover several display types: **Default**, **YAML**, **JSON**.

## View regressions and improvements

In the comparison view, red highlights runs that *regressed* on any feedback key against your source experiment, while green highlights runs that *improved*. At the top of each feedback column, you can see how many runs did better or worse than your source experiment.

Click the regression or improvement buttons at the top of each column to show only runs that regressed or improved in that experiment.

<img className="block dark:hidden" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/m9h3Fn9MszJQa9Qq/langsmith/images/regression-view-light.png?fit=max&auto=format&n=m9h3Fn9MszJQa9Qq&q=85&s=dc6e96aa199f617fd7330106a3b8d868" alt="The comparison view comparing 4 experiments with the regressions and improvements in red and green respectively." width="1294" height="777" data-path="langsmith/images/regression-view-light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/m9h3Fn9MszJQa9Qq/langsmith/images/regression-view-dark.png?fit=max&auto=format&n=m9h3Fn9MszJQa9Qq&q=85&s=551d8d59a9d6bd0b945ed79446e384cc" alt="The comparison view comparing 4 experiments with the regressions and improvements in red and green respectively." width="1294" height="766" data-path="langsmith/images/regression-view-dark.png" />

## View side-by-side diffs

When comparing two experiments, for JSON and YAML display styles, you can toggle on the experiment diff mode to compare experiment outputs. The diff mode highlights modifications between outputs, and can be particularly useful for structured output comparisons.

<div style={{ textAlign: 'center' }}>
  <img className="block dark:hidden" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/YW-RBMymAcah3n05/langsmith/images/comparison-diff-view-light.png?fit=max&auto=format&n=YW-RBMymAcah3n05&q=85&s=01e37f15129f9610eda7e945ecdb05bc" alt="The comparison diff mode in light." width="2298" height="1256" data-path="langsmith/images/comparison-diff-view-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/YW-RBMymAcah3n05/langsmith/images/comparison-diff-view-dark.png?fit=max&auto=format&n=YW-RBMymAcah3n05&q=85&s=2ab02fd2af42890aa28466aee2222961" alt="The comparison diff mode in dark." width="2292" height="1252" data-path="langsmith/images/comparison-diff-view-dark.png" />
</div>

## Update source experiment and metric

To track regressions across experiments, you can:

1. At the top of the **Comparison** view, hover over an experiment icon and select **Set as source experiment** from the dropdown. You can also add or remove experiments from this dropdown. By default, the first selected experiment is set as the source.

   <img className="block dark:hidden" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/YGiy52GBknkdl-n3/langsmith/images/set-source-experiment-light.png?fit=max&auto=format&n=YGiy52GBknkdl-n3&q=85&s=762abab7d25ff42fe88ad0af3890ff8b" alt="Setting a source experiment from the experiment icons at the top of the Comparison view." width="873" height="484" data-path="langsmith/images/set-source-experiment-light.png" />

   <img className="hidden dark:block" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/YGiy52GBknkdl-n3/langsmith/images/set-source-experiment-dark.png?fit=max&auto=format&n=YGiy52GBknkdl-n3&q=85&s=9d0e25cb331685d8824de0d6b55b4de1" alt="Setting a source experiment from the experiment icons at the top of the Comparison view." width="892" height="489" data-path="langsmith/images/set-source-experiment-dark.png" />

2. Within the **Feedback** columns, you can configure whether a higher score is better for each feedback key. This preference will be stored. By default, a higher score is assumed to be better.

   <img className="block dark:hidden" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/2jr_mPT4vBt8u4Pi/langsmith/images/comparison-feedback-score-light.png?fit=max&auto=format&n=2jr_mPT4vBt8u4Pi&q=85&s=9854367033c73518972c81f4e990c8a8" alt="Dropdown for feedback metric column, configuring whether a higher score is better, in light mode." width="621" height="233" data-path="langsmith/images/comparison-feedback-score-light.png" />

   <img className="hidden dark:block" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/2jr_mPT4vBt8u4Pi/langsmith/images/comparison-feedback-score-dark.png?fit=max&auto=format&n=2jr_mPT4vBt8u4Pi&q=85&s=4d89e178c2e40ade03d9c9807db7852c" alt="Dropdown for feedback metric column, configuring whether a higher score is better, in dark mode." width="602" height="188" data-path="langsmith/images/comparison-feedback-score-dark.png" />

## Open a trace

If the example you're evaluating is from an ingested [run](/langsmith/observability-concepts#runs), you can hover over the output cell and click on the trace icon to open the trace view for that run. This will open up a trace in the side panel.

<div style={{ textAlign: 'center' }}>
  <img className="block dark:hidden" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/kM9ZiNmjnMMEUZ5d/langsmith/images/open-trace-light.png?fit=max&auto=format&n=kM9ZiNmjnMMEUZ5d&q=85&s=f8c38100d1c69a677fffdd821fb5d18d" alt="The View trace icon highlighted from an ingested run, light mode." width="1970" height="565" data-path="langsmith/images/open-trace-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/kM9ZiNmjnMMEUZ5d/langsmith/images/open-trace-dark.png?fit=max&auto=format&n=kM9ZiNmjnMMEUZ5d&q=85&s=35b80540677d0d30b0248d92a6b3aa54" alt="The View trace icon highlighted from an ingested run, dark mode." width="1970" height="558" data-path="langsmith/images/open-trace-dark.png" />
</div>

## Expand detailed view

You can click on any cell to open up a detailed view of the experiment result on that particular example input, along with feedback keys and scores.

<img className="block dark:hidden" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/2jr_mPT4vBt8u4Pi/langsmith/images/expanded-view-light.png?fit=max&auto=format&n=2jr_mPT4vBt8u4Pi&q=85&s=8d1083ab3aa6272e8d9d8ceb3926df7a" alt="An example in the expanded Comparing Experiments view, in light mode." width="1979" height="728" data-path="langsmith/images/expanded-view-light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/2jr_mPT4vBt8u4Pi/langsmith/images/expanded-view-dark.png?fit=max&auto=format&n=2jr_mPT4vBt8u4Pi&q=85&s=1e3ddceedc5560f77ba305940e756b78" alt="An example in the expanded Comparing Experiments view, in dark mode." width="1920" height="614" data-path="langsmith/images/expanded-view-dark.png" />

## Use experiment metadata as chart labels

You can configure the x-axis labels for the charts based on [experiment metadata](/langsmith/filter-experiments-ui#background-add-metadata-to-your-experiments).

Select a metadata key from the **Charts** dropdown at the top-right of the **Comparison** view to change the x-axis labels.

<img className="block dark:hidden" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/kM9ZiNmjnMMEUZ5d/langsmith/images/metadata-in-charts-light.png?fit=max&auto=format&n=kM9ZiNmjnMMEUZ5d&q=85&s=e78e30453b846cbe6142702570cb2b73" alt="x-axis dropdown highlighted with a list of the metadata attached to the experiment, in light mode." width="426" height="513" data-path="langsmith/images/metadata-in-charts-light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/langchain-5e9cc07a-preview-patchr-1773857969-df0cef9/kM9ZiNmjnMMEUZ5d/langsmith/images/metadata-in-charts-dark.png?fit=max&auto=format&n=kM9ZiNmjnMMEUZ5d&q=85&s=a1ec36ee062611f360f3ac7769bb5842" alt="x-axis dropdown highlighted with a list of the metadata attached to the experiment, in dark mode." width="406" height="478" data-path="langsmith/images/metadata-in-charts-dark.png" />

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/compare-experiment-results.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
