Table of Contents

Class ReinforcementTuningHyperParameters

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Hyperparameters for Reinforcement Tuning.

public record ReinforcementTuningHyperParameters : IEquatable<ReinforcementTuningHyperParameters>
Inheritance
ReinforcementTuningHyperParameters
Implements
Inherited Members

Properties

AdapterSize

Adapter size for Reinforcement Tuning.

[JsonPropertyName("adapterSize")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AdapterSize? AdapterSize { get; set; }

Property Value

AdapterSize?

BatchSize

Batch size for the tuning job. How many prompts to process at a train step. If not set, the batch size will be determined automatically.

[JsonPropertyName("batchSize")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? BatchSize { get; set; }

Property Value

int?

CheckpointInterval

How often (in steps) to save checkpoints during training. If not set, one checkpoint per epoch will be saved.

[JsonPropertyName("checkpointInterval")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? CheckpointInterval { get; set; }

Property Value

int?

EpochCount

Number of training epochs for the tuning job.

[JsonPropertyName("epochCount")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonConverter(typeof(StringToNullableLongConverter))]
public long? EpochCount { get; set; }

Property Value

long?

EvaluateInterval

How often (in steps) to evaluate the tuning job during training. If not set, evaluation will run per epoch.

[JsonPropertyName("evaluateInterval")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? EvaluateInterval { get; set; }

Property Value

int?

LearningRateMultiplier

Learning rate multiplier for Reinforcement Learning.

[JsonPropertyName("learningRateMultiplier")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? LearningRateMultiplier { get; set; }

Property Value

double?

MaxOutputTokens

The maximum number of tokens to generate per prompt. If not set, defaults to 32768.

[JsonPropertyName("maxOutputTokens")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? MaxOutputTokens { get; set; }

Property Value

int?

SamplesPerPrompt

Number of different responses to generate per prompt during tuning.

[JsonPropertyName("samplesPerPrompt")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? SamplesPerPrompt { get; set; }

Property Value

int?

ThinkingLevel

Indicates the maximum thinking depth. Use with earlier models shall result in error.

[JsonPropertyName("thinkingLevel")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ReinforcementTuningThinkingLevel? ThinkingLevel { get; set; }

Property Value

ReinforcementTuningThinkingLevel?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a ReinforcementTuningHyperParameters object.

public static ReinforcementTuningHyperParameters? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

ReinforcementTuningHyperParameters

The deserialized ReinforcementTuningHyperParameters object, or null if deserialization fails.