Skip to main content
Merge math is the shared notation and shape conventions that every strategy in EMEP uses. This page defines the symbols, weight tensor shapes, and precision rules that appear in all per-strategy math pages.

Notation

Weight Tensor Shapes for LLMs

For a transformer with hidden size H, vocab size V, intermediate size I, attention heads A, and KV heads K:

Parameter Deltas and Task Vectors

A parameter delta is the difference between two parameter sets:
A task vector is a parameter delta between a fine-tuned model and its pre-trained base:
Task vectors are central to Task Arithmetic (Ilharco et al. 2022), TIES (Yadav et al. 2023), and DARE (Yu et al. 2023).

Norms

The L2 norm of a flattened parameter tensor:
The infinity norm:
Norms are used for normalization, envelope checks, and magnitude-based trimming.

Precision Effects

All merge operations should accumulate in fp32 and cast to the target dtype at the end. This is an engineering assumption: fp16 accumulation causes measurable drift in merged models.