feat: Halton low-discrepancy MaskGIT unmasking schedule#22
Open
tashapais wants to merge 1 commit into
Open
Conversation
Implements the Halton sequence scheduler from the MaskGIT scheduler TODO. The Halton schedule sorts the base-2 Halton sequence for T steps and uses each sorted value as the cumulative unmasking fraction at that step, giving more uniform coverage across the confidence range than exponential or cosine schedules. Enable with maskgit_schedule: "halton" in configs/training.yaml or configs/inference.yaml. Default remains "exp" for backward compatibility.
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.
Summary
Adds the Halton low-discrepancy sequence as a third MaskGIT unmasking schedule alongside the existing exponential schedule.
The Halton scheduler sorts the base-2 Halton sequence for
num_stepssteps and uses each sorted value as the cumulative unmasking fraction at that step. This distributes unmasking more uniformly across the confidence range compared to exponential or cosine schedules, avoiding over-commitment to the very first high-confidence tokens.Enable with
maskgit_schedule: "halton"inconfigs/training.yamlorconfigs/inference.yaml. Default remains"exp"so no existing runs are affected.Changes
models/dynamics.py:_haltonstatic helper,halton_schedule_torchmethod,scheduleparam onforward_inferenceutils/config.py:maskgit_schedulefield onDynamicsConfig,TrainingConfig,InferenceConfigconfigs/training.yaml,configs/inference.yaml: new field with defaultscripts/run_inference.py: passmaskgit_scheduletoforward_inferenceTest plan
halton_schedule_torchproduces monotonically increasing values ending atP_totalforward_inferencewithschedule="halton"produces correct output shape