Skip to content
The Chat Archive
llama-4-maverick-03-26-experimental· Meta LMArena Human Preference 140K

write loss function description as text we expect (sin,cos) direction + (sin,cos)…

  1. User

    write loss function description as text we expect (sin,cos) direction + (sin,cos) half-fov we pass as tartget expect (sin,cos) direction + (sin,cos) half-fov but also we expect FoV contains target expect (sin,cos) direction so rules: if half-fov is higher/much less than expected penalty, if fov doesnt contain penalty and direction is not same most less penalty param

  2. Assistant

    Here's a detailed, formal description of the loss function:

    Loss Function: Field of View (FoV) Alignment and Containment

    Overview

    The loss function L\mathcal{L} is designed to optimize the prediction of two critical components:

    1. Direction (d=(sin⁡(θd),cos⁡(θd))\mathbf{d} = (\sin(\theta_d), \cos(\theta_d))): The unit vector indicating the central direction of the Field of View (FoV).
    2. Half-Field of View (h=(sin⁡(θh),cos⁡(θh))\mathbf{h} = (\sin(\theta_h), \cos(\theta_h))): The angular extent of the FoV, represented as a unit vector.

    The input consists of:

    • Predicted values: (dpred,hpred)(\mathbf{d}_{\text{pred}}, \mathbf{h}_{\text{pred}}), where:
      • dpred=(sin⁡(θd,pred),cos⁡(θd,pred))\mathbf{d}_{\text{pred}} = (\sin(\theta_{d,\text{pred}}), \cos(\theta_{d,\text{pred}})) is the predicted direction.
      • hpred=(sin⁡(θh,pred),cos⁡(θh,pred))\mathbf{h}_{\text{pred}} = (\sin(\theta_{h,\text{pred}}), \cos(\theta_{h,\text{pred}})) is the predicted half-FoV.
    • Target (ground-truth) values: (dgt,hgt)(\mathbf{d}_{\text{gt}}, \mathbf{h}_{\text{gt}}), where:
      • dgt=(sin⁡(θd,gt),cos⁡(θd,gt))\mathbf{d}_{\text{gt}} = (\sin(\theta_{d,\text{gt}}), \cos(\theta_{d,\text{gt}})) is the expected (ground-truth) direction.
      • hgt=(sin⁡(θh,gt),cos⁡(θh,gt))\mathbf{h}_{\text{gt}} = (\sin(\theta_{h,\text{gt}}), \cos(\theta_{h,\text{gt}})) is the expected (ground-truth) half-FoV.

    Loss Function Objectives

    The loss function enforces three hierarchical constraints:

    1. Half-FoV Accuracy (LFoV\mathcal{L}_{\text{FoV}}):

      • Penalty Condition: If the predicted half-FoV (θh,pred\theta_{h,\text{pred}}) deviates significantly from the ground-truth half-FoV (θh,gt\theta_{h,\text{gt}}).
      • Mathematical Formulation: LFoV=∣arcsin⁡(hpred[0])−arcsin⁡(hgt[0])∣\mathcal{L}_{\text{FoV}} = \left| \arcsin(\mathbf{h}_{\text{pred}}[0]) - \arcsin(\mathbf{h}_{\text{gt}}[0]) \right|
      • Rationale: Encourages the model to predict a half-FoV that matches the ground truth. Larger deviations (either larger or smaller θh\theta_h) incur higher penalties.
    2. FoV Containment (Lcontain\mathcal{L}_{\text{contain}}):

      • Penalty Condition: If the ground-truth direction (dgt\mathbf{d}_{\text{gt}}) does not lie within the predicted FoV defined by dpred\mathbf{d}_{\text{pred}} and θh,pred\theta_{h,\text{pred}}.
      • Mathematical Formulation: 0, & \text{if } \mathbf{d}_{\text{gt}} \cdot \mathbf{d}_{\text{pred}} \geq \cos(\arcsin(\mathbf{h}_{\text{pred}}[0])) \\ 1, & \text{otherwise} \end{cases}$$
      • Rationale: Ensures that the predicted FoV "covers" the target direction. Failure to contain dgt\mathbf{d}_{\text{gt}} results in a fixed, high penalty.
    3. Direction Alignment (Lalign\mathcal{L}_{\text{align}}):

      • Penalty Condition: If the predicted direction (dpred\mathbf{d}_{\text{pred}}) is misaligned with the ground-truth direction (dgt\mathbf{d}_{\text{gt}}).
      • Mathematical Formulation: Lalign=1−dpred⋅dgt=1−(sin⁡(θd,pred)sin⁡(θd,gt)+cos⁡(θd,pred)cos⁡(θd,gt))\mathcal{L}_{\text{align}} = 1 - \mathbf{d}_{\text{pred}} \cdot \mathbf{d}_{\text{gt}} = 1 - (\sin(\theta_{d,\text{pred}}) \sin(\theta_{d,\text{gt}}) + \cos(\theta_{d,\text{pred}}) \cos(\theta_{d,\text{gt}}))
      • Rationale: Promotes precise alignment between predicted and ground-truth directions. The penalty is smallest when dpred=dgt\mathbf{d}_{\text{pred}} = \mathbf{d}_{\text{gt}} (dot product = 1) and largest when they are orthogonal or opposite (dot product ≤0\leq 0).

    Total Loss Function

    The final loss is a weighted sum of the three components:

    Ltotal=λ1LFoV+λ2Lcontain+λ3Lalign\mathcal{L}_{\text{total}} = \lambda_1 \mathcal{L}_{\text{FoV}} + \lambda_2 \mathcal{L}_{\text{contain}} + \lambda_3 \mathcal{L}_{\text{align}}

    where λ1,λ2,λ3\lambda_1, \lambda_2, \lambda_3 are hyperparameters balancing the importance of:

    1. Half-FoV accuracy (λ1\lambda_1): Ensures θh,pred≈θh,gt\theta_{h,\text{pred}} \approx \theta_{h,\text{gt}}.
    2. FoV containment (λ2\lambda_2): Hard constraint that dgt\mathbf{d}_{\text{gt}} must lie within the predicted FoV.
    3. Direction precision (λ3\lambda_3): Fine-tunes dpred≈dgt\mathbf{d}_{\text{pred}} \approx \mathbf{d}_{\text{gt}}.

    Behavioral Hierarchy:

    1. Highest Priority: FoV containment (Lcontain\mathcal{L}_{\text{contain}}). If dgt\mathbf{d}_{\text{gt}} is not within the predicted FoV, a large penalty is incurred regardless of other factors.
    2. Moderate Priority: Half-FoV accuracy (LFoV\mathcal{L}_{\text{FoV}}). The model is discouraged from predicting FoVs that are too narrow or too wide.
    3. Lowest Priority: Direction alignment (Lalign\mathcal{L}_{\text{align}}). Ensures the central direction is accurate but tolerates minor misalignments if containment is satisfied.

    Optimization Goal: Minimize Ltotal\mathcal{L}_{\text{total}} to train the model to predict:

    • A half-FoV (θh,pred\theta_{h,\text{pred}}) close to θh,gt\theta_{h,\text{gt}}.
    • A direction (dpred\mathbf{d}_{\text{pred}}) aligned with dgt\mathbf{d}_{\text{gt}}.
    • An FoV that always contains dgt\mathbf{d}_{\text{gt}}.

    By structuring the loss in this way, the model learns to balance angular precision, FoV coverage, and directional accuracy.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.