分枝协同注意力机制让模型同时学好长距离和局部语言结构。
FiLM-Coordinated Dual-Branch Transformer for Global-Local Dependency Modeling in Language Modeling
- 双分支结构分别处理全局与局部依赖,用FiLM动态协调。
- 在TinyShakespeare等数据集上优于同规模单分支模型。
- 适合追求高效精准建模的轻量级语言模型研究者。
标准Transformer使用单一自注意力路径同时建模全局依赖和局部模式,导致长距离结构推理与细粒度表示学习之间的矛盾。本文提出一种基于FiLM协同的双分支Transformer,每层显式包含全局分支和局部分支,通过特征通道线性调制(FiLM)实现动态跨分支协调,而非简单的拼接或静态相加。核心思想是两个分支代表同一输入的不同依赖视角,通道级校准比复杂的令牌级交互更合适。因此设计了双向FiLM模块,使每个分支生成通道级缩放与偏移参数以调控另一分支。在多个小规模语言建模设置下,所提结构在固定轻量配置中持续优于同宽单分支基线及弱化双分支变体。在TinyShakespeare和WikiText-2的100万字符子集上,全双分支FiLM模型在同宽度结构中表现最佳。多种子结果支持收益稳定性,机制分析显示FiLM学习输入相关、层相关且通道选择性的调制模式,而非静态缩放。参数匹配的扩展单分支基线也表明当前设计在参数效率方面仍有提升空间。
原文摘要 · Abstract (English)
Standard Transformers use a single self-attention pathway to model both global dependencies and local patterns, creating tension between long-range structural reasoning and fine-grained local representation learning. We propose a FiLM-coordinated dual-branch Transformer for language modeling, where each layer explicitly contains a global branch and a local branch, and feature-wise linear modulation (FiLM) is used for dynamic cross-branch coordination instead of simple concatenation or static addition. The key idea is that the two branches represent different dependency views of the same input, making channel-wise calibration more suitable than heavy token-level interaction. We therefore design a bidirectional FiLM module in which each branch generates per-channel scaling and shifting parameters to condition the other. Experiments on multiple small-scale language modeling settings show that the proposed structure consistently outperforms same-width single-branch baselines and weakened dual-branch variants under a fixed lightweight configuration. On TinyShakespeare and a 1M-character subset of WikiText-2, the full dual-branch FiLM model achieves the best results among same-width structural baselines. Multi-seed results support the stability of the gains, while mechanistic analyses show that FiLM learns input-dependent, layer-dependent, and channel-selective modulation patterns rather than static scaling. Parameter-matched widened single-branch baselines also indicate that the current design still leaves room for improvement in parameter efficiency.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。