Plug-and-Play Guidance for Discrete Diffusion Models via Gradient-Informed Logit Correction#3
Draft
remyx-ai[bot] wants to merge 1 commit into
Conversation
…ormed Logit Correction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this paper for this team
While the iteration thread focuses on
AnyFlowfor video,diffusers' 'Modular Pipelines' (Stage 2) and general model integration (Stage 1) imply a broad interest in controllable generation across modalities. This paper,GILC, offers a plug-and-play, training-free framework for controllable generation with discrete diffusion models, directly applicable to models like LLaDA2. It provides an efficient way to estimate guidance signals for both differentiable and non-differentiable reward functions. This is a natural next step that aligns withdiffusers' 'Training and Fine-tuning' research interest, enabling users to exert fine-grained control over discrete outputs without expensive retraining or complex setups, enhancing the utility of discrete models within the library.Why this candidate (selected from the lookback pool)
The repo ships a LLaDA2 discrete-diffusion pipeline whose refinement loop produces per-step token logits and commits confident tokens — exactly the substrate GILC operates on. GILC is a training-free, plug-and-play logit-correction step (logits in → reward-guided logits out, same shape) that slots between logit production (L466) and
scheduler.step(L468) with no contract change to the model or scheduler; the existing call site stays and the new guidance module is wired in. No existing guidance lives in the discrete path (theguiders/module only serves continuous-diffusion CFG variants), so this is a net-new module anchored on a verified existing forward path rather than a speculative add-alongside.License & code availability
🟡 No code repository surfaced — couldn't fetch a LICENSE to evaluate. Worth confirming the paper has an open release before investing in adoption.
(none detected)(class:no-code-link, compat: 0.30)Suggested experiment
Integrate
GILCas a plug-and-play guidance mechanism for theLLaDA2 Discrete Diffusion Pipelineindiffusers. Implement its Jacobian-free logit correction for a specific controlled generation task (e.g., generating sequences with desired length or specific syntactic properties). Compare its performance against unguided generation or simpler inference-time guidance methods, verifying its training-free nature.What this PR delivers
Call site:
LLaDA2Pipeline.__call__ in src/diffusers/pipelines/llada2/pipeline_llada2.py — the newlogit_guidanceis applied toblock_logitsinside the refinement loop, beforeself.scheduler.step.Delivers (from the paper):
scheduler.step, with no contract change to model or scheduler.RewardLogitGuidanceimplementing the Jacobian-free correction in two modes:gradient(one ascent step on expected reward,l_v + g*p_v*(r_v - E_p[r])) andtilt(exponential reward-tilt,l_v + g*(r_v - E_p[r])), accepting differentiable OR non-differentiable per-candidate rewards.LLaDA2Pipeline.__call__via a newlogit_guidancekwarg (accepts aRewardLogitGuidanceor any[B,L,V]->[B,L,V]callable;Nonedisables) — so unguided generation is unchanged and guidance is opt-in at the pipeline's public entry point.from_token_rewardsconvenience constructor for sparsetoken_id -> rewardcontrol (e.g. boosting EOS for shorter outputs or penalizing disallowed tokens), the concrete length/syntax-control use case the spec suggested.active_onlymasking so the correction touches only still-masked positions, leaving already-committed context untouched.Intentionally out of scope (not needed for this contribution):
This delivers GILC's core in-pipeline value: a training-free, plug-and-play logit-correction step that lets a user steer LLaDA2 discrete-diffusion generation toward a per-token reward (e.g. length/syntax control) with no retraining, via a Jacobian-free correction that supports non-differentiable rewards. It is reachable from the product: the pre-existing
LLaDA2Pipeline.__call__now invokes it through a new optionallogit_guidancekwarg, and behavior is identical to before when guidance isNone. Intentionally scoped out as unnecessary for that result are the paper's multi-step variational proxy (extra denoiser passes), its domain-specific reward models (DNA/protein/molecule scorers), and a quantitative eval harness — all of which are deliberate boundaries, with the reusable correction core kept reward-agnostic so those can be layered on later.Test results
ℹ️ Tests could not run in CI — the runner lacks this repo's dependencies (a collection/import error, not a code failure). Run the suite locally to validate.
Opened by the Remyx Recommendation orchestrator.