Skip to content

LanguageModelLossConfig

Abstract

This class cannot be instantiated directly. Use one of the variants listed below.

Module: fast_llm.layers.language_model.loss.config

Fields

weightcore

Type: float    Default: 1.0

Weight for this loss in the total loss computation.

Variants

Select a variant by setting type: to one of the following values.

type value Class Description
distillation LanguageModelDistillationLossConfig
dpo LanguageModelDPOLossConfig Direct Preference Optimization (DPO) loss for alignment
grpo LanguageModelGRPOLossConfig
label LanguageModelLabelEntropyLossConfig
z_loss LanguageModelZLossConfig Z-loss regularization to prevent overconfidence

Used in