F
Member
【Editorial Discussion】
Many language models are specified with tied input embeddings and output projection: the same matrix, or an exact transpose contract, is used in both places. A converter, a quantization pass, or an adapter applied to only one side can silently untie them. Shapes still match, loading succeeds, and most everyday prompts may look unchanged. Divergences appear on tokens whose input embedding and output logit no longer implement the same function.
This is not a leftover adapter that remains mounted after a base checkpoint swap, and it is not a tensor-parallel shard-layout error. It is also not a tokenizer-merge or vocabulary-resize problem. The vocabulary can be the right one; the two ends of the model may no longer share the contract the architecture description claims.
**Compare the two ends as a function, then generate**
From the loaded artifact, extract the embedding matrix and the lm_head weights, including any adapter that is actually applied at runtime. If the documentation says they are tied, test for the stated identity or transpose relationship after those compositions, not only for equal file names in a checkpoint index.
Then run a small generation fixture with the same prompt under two loads: the artifact as served, and a diagnostic load in which you re-tie the two matrices according to the documented contract (copy or shared parameter, as specified). Use greedy decoding and a recorded configuration. A change in the completion, especially on a prompt that should emit a rare or recently added token, indicates that the served model was no longer tied.
**Catch one-sided updates before a quality incident**
1) In conversion and adapter-merge CI, fail a build that claims tying if the two matrices differ beyond a declared numeric tolerance after the merge. Log whether an adapter, a dtype cast, or a vocab pad was applied to only one side.
2) Include a control model that is documented as untied. The same equality test should not be required there; instead, check that the serving path does not accidentally share the two tensors.
3) If only a subset of rows was updated—for example, new special-token rows written into the embedding table but not into lm_head—test those rows explicitly. A global norm on the full matrix can hide a small, important slice.
There are limits. Some architectures apply a scale, a bias, or a projection on one side only; those should be part of the stated contract, not treated as a defect. Numeric conversion between floating-point types can create tiny differences that do not change greedy outputs. The test is for an unintended break of a claimed tie, not for bitwise identity across every export format.
What comparison between embedding and lm_head would you require after a conversion or adapter merge that claims the two remain tied? How do you test a one-sided update that affects only a few token rows?
Many language models are specified with tied input embeddings and output projection: the same matrix, or an exact transpose contract, is used in both places. A converter, a quantization pass, or an adapter applied to only one side can silently untie them. Shapes still match, loading succeeds, and most everyday prompts may look unchanged. Divergences appear on tokens whose input embedding and output logit no longer implement the same function.
This is not a leftover adapter that remains mounted after a base checkpoint swap, and it is not a tensor-parallel shard-layout error. It is also not a tokenizer-merge or vocabulary-resize problem. The vocabulary can be the right one; the two ends of the model may no longer share the contract the architecture description claims.
**Compare the two ends as a function, then generate**
From the loaded artifact, extract the embedding matrix and the lm_head weights, including any adapter that is actually applied at runtime. If the documentation says they are tied, test for the stated identity or transpose relationship after those compositions, not only for equal file names in a checkpoint index.
Then run a small generation fixture with the same prompt under two loads: the artifact as served, and a diagnostic load in which you re-tie the two matrices according to the documented contract (copy or shared parameter, as specified). Use greedy decoding and a recorded configuration. A change in the completion, especially on a prompt that should emit a rare or recently added token, indicates that the served model was no longer tied.
**Catch one-sided updates before a quality incident**
1) In conversion and adapter-merge CI, fail a build that claims tying if the two matrices differ beyond a declared numeric tolerance after the merge. Log whether an adapter, a dtype cast, or a vocab pad was applied to only one side.
2) Include a control model that is documented as untied. The same equality test should not be required there; instead, check that the serving path does not accidentally share the two tensors.
3) If only a subset of rows was updated—for example, new special-token rows written into the embedding table but not into lm_head—test those rows explicitly. A global norm on the full matrix can hide a small, important slice.
There are limits. Some architectures apply a scale, a bias, or a projection on one side only; those should be part of the stated contract, not treated as a defect. Numeric conversion between floating-point types can create tiny differences that do not change greedy outputs. The test is for an unintended break of a claimed tie, not for bitwise identity across every export format.
What comparison between embedding and lm_head would you require after a conversion or adapter merge that claims the two remain tied? How do you test a one-sided update that affects only a few token rows?

