Understanding the inner workings of Transformers is crucial for achieving more accurate and efficient predictions. In this work, we analyze the computation performed by Transformers in the layers after the top-1 prediction has become fixed, which has been previously referred to as the "saturation event". We expand the concept of saturation events for top-k tokens, demonstrating that similar saturation events occur across language, vision, and speech models. We find that these saturation events happen in order of the corresponding tokens' ranking, i.e., the model first decides on the top ranking token, then the second highest ranking token, and so on. This phenomenon seems intrinsic to the Transformer architecture, occurring across different architectural variants (decoder-only, encoder-only, and to a lesser extent full-Transformer), and even in untrained Transformers. We propose an underlying mechanism of task transition for this sequential saturation, where task k corresponds to predicting the k-th most probable token, and the saturation events are in fact discrete transitions between the tasks. In support of this we show that it is possible to predict the current task from hidden layer embedding. Furthermore, using an intervention method we demonstrate that we can cause the model to switch from one task to the next. Finally, leveraging our findings, we introduce a novel token-level early-exit strategy, which surpasses existing methods in balancing performance and efficiency.
Beyond Higher Rank: Token-wise Input-Output Projections for Efficient Low-Rank Adaptation
Huazhong University of Science and Technology(华中科技大学);Shenzhen Technology University(深圳技术大学);City University of Hong Kong(香港城市大学);Shenzhen University(深圳大学)
AdaK-NER: An Adaptive Top-K Approach for Named Entity Recognition with Incomplete Annotations
最先进的命名实体识别(NER)模型严重依赖于大量的完全注释的训练数据。然而,可访问的数据往往是不完整的注释,因为注释者通常缺乏全面的知识,在目标领域。通常,默认情况下,未注释的标记被视为非实体,而我们强调这些标记可以是非实体或任何实体的一部分。本文研究了不完全标注数据下的NER建模问题,在不完全标注数据下,只有一小部分命名实体被标注,而未标注的标记被每个可能的标记等价地多标注,考虑到多标记,大量的可能路径会分散训练模型对黄金路径(ground truth label序列)的注意力,从而影响学习能力。在本文中,我们提出了AdaK-NER,称为自适应top-K方法,以帮助模型专注于一个较小的可行区域,在那里黄金路径更有可能被定位。通过在英文和中文数据集上的大量实验,我们证明了该方法的优越性,在CoNLL-2003和两个中文数据集上的F值与现有的最先进的方法相比平均提高了2%和10%以上。