#1343·xformers

Support for differentiable soft attention masks (float mask in [0,1], not in log-space)

Author: enszhouCreated Oct 7, 2025Updated Sep 28, 2026

❓ Questions and Help

Hi, I’d like to use a soft attention mask (floating-point values between 0 and 1) that is not in log-space, mainly for numerical stability reasons. I also need the operation to be differentiable w.r.t. the mask, so gradients can flow through it. Does the current implementation support this? If not, is there any recommended workaround or efficient way to achieve it? Thanks!

Source: facebookresearch/xformers