Skip to main content
Merge validation is the gate between the MergeEngine and candidate registration. This page specifies every post-merge check, the decision flow, and the three possible outcomes: PASS, FAIL, and QUARANTINE.

Validation Pipeline

Validation Checks

NaN/Inf Scan

Iterate over every parameter in the merged state_dict. Detect NaN or Inf values. This is a hard fail: any NaN or Inf produces FAIL immediately.

Dtype Invariants

Verify that every parameter has the dtype declared in the merge config. Mixed dtypes are permitted only if the strategy explicitly declares them.

Norm Envelopes

Compare the L2 norm of each merged layer to the L2 norms of the source models. Flag outliers. Margin is configurable, default 20%.

Layer-wise Sanity

Verify that layer shapes match the expected architecture. Check that attention Q/K/V/O projections, MLP up/gate/down projections, and layernorm parameters all have the expected dimensions.

Tokenizer Round-trip

Encode and decode a fixed set of test strings. Verify that the output matches the input.

Small-batch Forward Pass

Run a small batch of synthetic input IDs through the merged model. Verify that the forward pass completes and produces finite logits.

Outcome Definitions