Skip to content

twinflow: adversarial loss, doc updates - #2453

Merged
bghira merged 1 commit into
mainfrom
bugfix/missing-commit-for-twinflow
Jan 20, 2026
Merged

twinflow: adversarial loss, doc updates#2453
bghira merged 1 commit into
mainfrom
bugfix/missing-commit-for-twinflow

Conversation

@bghira

@bghira bghira commented Jan 20, 2026

Copy link
Copy Markdown
Owner

Closes #2452

This pull request adds support for the full self-adversarial training branch of TwinFlow, as described in the original paper, across all documentation and the core model helper code. It introduces new configuration options to enable and control adversarial and rectification losses (L_adv and L_rectify), and implements the corresponding loss computations and fake sample generation in the training pipeline. Documentation in English, Spanish, Portuguese, Hindi, Japanese, and Chinese is updated to explain these new features and settings.

TwinFlow adversarial branch support

  • Added new configuration options to enable adversarial training: twinflow_adversarial_enabled, twinflow_adversarial_weight, and twinflow_rectify_weight in _twinflow_settings within simpletuner/helpers/models/common.py.
  • Implemented methods in simpletuner/helpers/models/common.py for generating fake samples (_twinflow_generate_fake_samples) and computing the adversarial (_twinflow_compute_adversarial_loss) and rectification (_twinflow_compute_rectify_loss) losses, following the TwinFlow paper.

Documentation updates (all languages)

  • Updated English, Spanish, Portuguese, Hindi, Japanese, and Chinese documentation (documentation/distillation/TWINFLOW.md, .es.md, .pt-BR.md, .hi.md, .ja.md, .zh.md) to describe the new adversarial branch, configuration flags, and the behavior and purpose of L_adv and L_rectify losses. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]

These changes make it possible to optionally enable full self-adversarial training in TwinFlow, allowing for improved distribution matching and trajectory alignment without the need for an external discriminator, and ensure that documentation is clear and up-to-date in all supported languages.

@bghira
bghira merged commit 9ac4137 into main Jan 20, 2026
4 checks passed
@bghira
bghira deleted the bugfix/missing-commit-for-twinflow branch January 20, 2026 14:47
samzhang996-hue pushed a commit to samzhang996-hue/SimpleTuner that referenced this pull request Apr 27, 2026
…twinflow

twinflow: adversarial loss, doc updates
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.

TwinFlow training only support RCGM?

1 participant