﻿# Optuna trial states: pruned, failed and complete outcomes belong to different comparison populations

Analyze Optuna searches without mixing deliberately pruned intermediate evaluations, execution failures and complete objective results into one undifferentiated score distribution.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-optuna-pruned-failed-complete-outcome-population/
Language: en

## Define which outcomes answer the comparison question

An analyst exports a tuning study and averages every numeric trial value. Some candidates completed the evaluation, others were pruned early, and others failed after reporting an intermediate result. The [TrialState reference](https://optuna.readthedocs.io/en/stable/reference/generated/optuna.trial.TrialState.html) distinguishes these outcomes. A value's presence does not establish equal evaluation exposure. Decide whether the analysis concerns completed quality, pruning behavior or operational reliability before forming its comparison population.

## Preserve pruning as a deliberate search decision

The [Trial interface](https://optuna.readthedocs.io/en/stable/reference/generated/optuna.trial.Trial.html) separates reporting an intermediate value, asking whether pruning is suggested and ending with a pruning outcome. A pruning suggestion is not itself proof that the training loop stopped. Preserve the application's actual outcome and the progress reached. A pruned candidate may have consumed a different budget from a complete candidate, so treating its intermediate measurement as an interchangeable final score obscures how the search allocated evaluation effort.

## Keep execution failure distinct from poor quality

A dependency error, missing checkpoint or incompatible input shape can prevent a trial from producing its intended objective. Assigning an arbitrary bad score to all such cases may hide an infrastructure problem inside the apparent model-quality distribution. Record the failure reason separately and state any deliberate penalty policy. An unsuccessful computation can be relevant to feasibility, but its scientific interpretation differs from a valid completed evaluation that simply measured low quality under the declared objective.

## Filter exported history by explicit state

The [Study API](https://optuna.readthedocs.io/en/stable/reference/generated/optuna.study.Study.html) exposes trial history, state filtering and dataframe export. Retain state, candidate parameters and progress information when producing downstream reports. A finished-state predicate can include different terminal outcomes; it should not be used as a synonym for complete. Waiting and running records also describe unfinished work rather than missing final scores that can safely be filled by an aggregate from the completed population.

## Check the report with recognizable outcome cases

Construct a small controlled study containing a completed objective, a deliberate pruning event and an ordinary execution error. Inspect how each appears in the export and in the analysis population. Related guides discuss [evaluation task selection](/journal/mteb-mmteb-domain-task-selection/) and [variable-length loss reduction](/journal/variable-length-loss-reduction/). The fixture verifies that reporting preserves the intended distinctions. It does not establish an optimal pruning policy; it establishes which observations support each conclusion about model quality, budget use and execution reliability.
