mart attention that knows when to zoom in and when to zoom out.
It's like teaching AI to use a spotlight instead of floodlights.
This paper introduces Selective Self-Attention (SSA), enhancing transformer models by adding temperature scaling to control attention sparsity and relevance dynamically based on query embeddings and positions.
-----https://arxiv.org/abs/2411.12892
π€ Original Problem:
β Standard transformer attention treats all queries uniformly, making it difficult to control contextual sparsity and relevance for different types of tokens.
β Current models struggle with attention dilution in longer sequences and have trouble suppressing irrelevant tokens.
-----
π§ Solution in this Paper:
β SSA introduces a temperature scaling mechanism that adapts to both query embeddings and token positions.
β The method applies different temperatures to query and value embeddings through a learnable function.
β Position-aware scaling helps mitigate attention dilution in longer sequences using logarithmic scaling.
β Weight sharing strategy reduces parameter overhead to <0.5% while maintaining benefits.
-----
π‘ Key Insights:
β Temperature scaling helps decouple semantic similarity from contextual sparsity
β Position-aware scaling effectively counters attention dilution
β Value temperature scaling enhances model's ability to suppress irrelevant tokens
β SSA improves training efficiency, achieving similar performance with 1.45x fewer steps
-----
π Results:
β Consistent improvements across GPT-2, Pythia, Llama, and Llama3 models
β Enhanced passkey retrieval performance from 56.9% to 74.4%
β Reduced parameter overhead to <0.5% through weight sharing
β Improved perplexity scores across multiple benchmarks










