Skip to content

Preserve exact-zero SFT self-conditioning - #775

Open
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix-sft-zero-self-conditioning-v2
Open

Preserve exact-zero SFT self-conditioning#775
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix-sft-zero-self-conditioning-v2

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Addresses the self-conditioning semantics reported in #773.

Summary

Preserve an exact-zero self-conditioning embedding in the Hackable Diffusion SFT adapter when self-conditioning is disabled.

  • represent training-time self-conditioning enablement with an explicit per-example mask instead of replacing logits with zero logits
  • make the first SFT decoder pass produce a true zero self-conditioning embedding
  • mark diffusion sampling step 0 as non-self-conditioned and later steps as self-conditioned
  • add regression coverage for exact-zero and mixed enabled/disabled self-conditioning states

Why

The current adapter represents “no self-conditioning” using all-zero vocabulary logits and then passes them through encode_logits. Because encode_logits applies a softmax and embedding projection, zero logits produce a vocabulary-mean embedding rather than an exact zero self-conditioning signal.

The main DiffusionGemma sampler already initializes self-conditioning with an all-zero embedding tensor. This change makes the Hackable Diffusion SFT path consistent with that behavior without changing the meaning of actual previous-pass logits.

This intentionally addresses only the self-conditioning portion of #773; it does not change the separate multi-canvas cache/decode behavior discussed there.

Testing

  • targeted Hackable Diffusion SFT/state-handler tests: 38 passed
  • pyink --check passed on all five changed files

@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as draft August 15, 2026 17:29
@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review August 15, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant