d$^2$p: Structured Soft Attention Is All You Need
Abstract
Lay Summary
Many problems in science and language come down to lining things up and finding their correspondences: matching sequences of text, matching the parts of two proteins to measure how similar their shapes are, or finding the grammatical structure hidden inside a sentence. For decades these have been handled by classic step-by-step algorithms that work well but depend on settings a person has to choose in advance, often arbitrarily, such as how harshly to penalize a gap when two things do not quite match. This paper shows that these classic algorithms are closely related to the "attention" mechanism that powers modern AI systems, and works out the mathematics needed to let a neural network learn those previously hand-chosen settings on its own, instead of leaving them fixed. We find that letting the system learn its own settings matters. When comparing the three-dimensional shapes of proteins, a model that learns its settings is far more accurate than one using textbook defaults, and choosing the right underlying algorithm can matter more than simply making the AI model larger. We also show the same approach can uncover the structure of sentences, including computer code, without ever being shown correct answers to imitate. To make these tools usable by others, we release fast, open-source software that runs efficiently on modern hardware.