For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview

Arbiter hyperparameter optimization for DL4J — architecture, search strategies, configuration, and usage.

What Is Arbiter?

Arbiter is the hyperparameter optimization module in the Eclipse Deeplearning4j ecosystem. It automates the search for optimal neural network configurations by systematically evaluating candidate architectures across a user-defined hyperparameter search space.

Neural networks require many decisions before training begins: learning rate, number of layers, layer sizes, regularization strength, batch size, activation functions, and more. Choosing these manually is time-consuming and often suboptimal. Arbiter replaces manual search with automated strategies — random search or grid search — that explore many candidates and report the best ones.

When to use Arbiter:

  • You have a rough idea of the right architecture but want to tune precise hyperparameter values.

  • You are willing to spend more compute time in exchange for better model performance.

  • You want a reproducible, principled way to document which hyperparameter configurations you tried.

When not to use Arbiter:

  • You already have a known-good architecture from a published paper or prior work. Tuning costs time.

  • Your compute budget is very small. Random search needs at least 10–20 candidates to be useful.

  • Your search space is poorly defined. Arbiter cannot find good models if the search space does not include any good configurations.


Maven Dependency

<!-- Core hyperparameter optimization -->
<dependency>
    <groupId>org.deeplearning4j</groupId>
    <artifactId>arbiter-deeplearning4j</artifactId>
    <version>1.0.0-M2.1</version>
</dependency>

<!-- UI visualization (optional) -->
<dependency>
    <groupId>org.deeplearning4j</groupId>
    <artifactId>arbiter-ui_2.11</artifactId>
    <version>1.0.0-M2.1</version>
</dependency>

Architecture Overview

An Arbiter optimization run is described by an OptimizationConfiguration that ties together five components:

Component
Interface
Purpose

Candidate generator

CandidateGenerator

Generates candidate hyperparameter configurations

Data source

DataSource

Provides training and test data to each candidate

Model saver

ResultSaver

Persists results from each candidate evaluation

Score function

ScoreFunction

Produces a single numeric score for each candidate

Termination conditions

TerminationCondition[]

Stops the optimization run

The OptimizationConfiguration is then passed to an IOptimizationRunner which executes the candidates.


Setting Up an Optimization Run

1. Define the Hyperparameter Search Space

Use MultiLayerSpace (for MultiLayerNetwork models) or ComputationGraphSpace (for ComputationGraph models) to define the range of valid hyperparameter values. These mirror DL4J's MultiLayerConfiguration and ComputationGraphConfiguration builders, with each hyperparameter taking either a fixed value or a ParameterSpace<T>.

See Parameter Spaces and Layer Spaces for the full reference.

2. Choose a Candidate Generator

Random search (recommended for most cases):

Random search samples hyperparameter configurations uniformly at random from the search space. It is typically more efficient than grid search for high-dimensional spaces because it does not waste evaluations on redundant combinations.

Grid search:

discretizationCount = 4 converts a continuous range like [0.0001, 0.01] into four discrete values. Mode.Sequential evaluates them in order; Mode.RandomOrder shuffles the order. Grid search is only practical for small, low-dimensional search spaces.

3. Implement a DataSource

DataSource provides data to each candidate model during training and evaluation. It must have a no-argument constructor. Optional configuration can be injected via Properties.

4. Choose a Model Saver

Save to disk:

Results are saved under baseDir/0/, baseDir/1/, etc., indexed by OptimizationResult.getIndex(). Each directory contains the model configuration, parameters, and score.

In-memory (small models only):

5. Choose a Score Function

The score function assigns a single scalar to each candidate. Arbiter selects the candidate with the best score.

Classification accuracy:

Available Evaluation.Metric values: ACCURACY, F1, PRECISION, RECALL, GMEASURE, MCC.

ROC AUC:

Regression (MSE):

For regression, Arbiter minimizes the score (lower MSE is better). For classification, it maximizes the score (higher accuracy is better).

6. Set Termination Conditions

7. Build the OptimizationConfiguration

8. Run with the OptimizationRunner

For MultiLayerNetwork candidates:

For ComputationGraph candidates:

LocalOptimizationRunner runs all candidates sequentially in the current JVM. It is the only runner available in 1.0.0-M2.1.


Inspecting Results

After the run completes:


Variable-Depth Networks

Arbiter can vary the number of layers in a MultiLayerSpace:

The layers created within a repeated stack are identical (stacked). Arbiter does not support independent configuration of each layer within a variable-depth stack.


JSON Serialization

OptimizationConfiguration, MultiLayerSpace, and ComputationGraphSpace can be serialized to JSON for storage and reproducibility:


  1. Use random search over grid search. Random search is more efficient for high-dimensional spaces because it covers the space more evenly and is less likely to waste evaluations on unimportant dimensions.

  2. Search from coarse to fine. Run a short coarse search (1–2 epochs per candidate, wide ranges) to find promising regions. Then run a fine search in the promising region with more epochs.

  3. Use log-uniform distributions for scale-sensitive parameters. Learning rate and regularization parameters span multiple orders of magnitude. Use ContinuousParameterSpace with the LogUniformDistribution for these.

  4. Watch for boundary clustering. If the best candidates repeatedly cluster near the boundary of a search range, expand that range in the next search.

  5. Allocate more candidates than you think you need. With random search, approximately 60 candidates are needed to have 95% probability of finding a configuration in the top 5% of the space.


Last updated

Was this helpful?