Conditioning is injected additively only, with no FiLM/AdaLN alternative #34

Open
opened 2026-08-13 15:07:03 +02:00 by lars · 0 comments
Owner

ResBlock (giant/model/layers.py:60-76) injects conditioning exactly one way:

h = self.linear1(h) + self.cond_proj(cond)

That's a conditional bias — the weakest of the standard options. FiLM
(per-channel scale and shift) and AdaLN-Zero (the DiT standard: modulate the
normalisation, zero-init the residual branch) are both drop-in replacements at
the same block interface, cost one extra Linear, and are consistently stronger
for exactly this problem shape — a small MLP whose entire job is to be
conditional.

This is worth flagging beyond its size: GIANT is a conditional generative model
end to end, and every failure mode recorded in the roadmap is a
conditioning-fidelity failure (the router experts not separating by energy;
secondary species collapsing to one class; shower shape diverging while bulk
energy matches). An additive bias may not be the cause of any of those, but it
is the least expressive way the model could be reading its conditioning, and
it's currently not a variable.

Proposal: BLOCK_REGISTRY + blocks.conditioning = "add" | "film" | "adaln" (and, nearly free once the factory exists, blocks.norm /
blocks.activation). Default stays "add" so existing checkpoints are
bit-identical.


Migrated from issues.md (v0.3.0 branch review, 2026-08-13), Issue 9.

`ResBlock` (`giant/model/layers.py:60-76`) injects conditioning exactly one way: ```python h = self.linear1(h) + self.cond_proj(cond) ``` That's a conditional *bias* — the weakest of the standard options. FiLM (per-channel scale **and** shift) and AdaLN-Zero (the DiT standard: modulate the normalisation, zero-init the residual branch) are both drop-in replacements at the same block interface, cost one extra `Linear`, and are consistently stronger for exactly this problem shape — a small MLP whose *entire job* is to be conditional. This is worth flagging beyond its size: GIANT is a conditional generative model end to end, and every failure mode recorded in the roadmap is a conditioning-fidelity failure (the router experts not separating by energy; secondary species collapsing to one class; shower shape diverging while bulk energy matches). An additive bias may not be the cause of any of those, but it is the least expressive way the model could be reading its conditioning, and it's currently not a variable. **Proposal:** `BLOCK_REGISTRY` + `blocks.conditioning = "add" | "film" | "adaln"` (and, nearly free once the factory exists, `blocks.norm` / `blocks.activation`). Default stays `"add"` so existing checkpoints are bit-identical. --- Migrated from `issues.md` (v0.3.0 branch review, 2026-08-13), Issue 9.
lars added the architecturemodularity labels 2026-08-13 15:07:03 +02:00
Sign in to join this conversation.