Decoupling Knowledge and Reasoning in Transformers: A Modular Architecture with Generalized Cross-Attention
Zhenyu Guo, Wenguang Chen
TL;DR
This work tackles the entanglement of knowledge and reasoning in Transformer models by proposing a modular architecture that decouples these components via a globally shared knowledge base $E$ and layer-specific transformations. It provides a rigorous theoretical result showing that the standard FFN is a closure of a generalized cross-attention to an implicit knowledge base, validating the proposed mechanism and offering a unified memory-based interpretation of FFNs. The model introduces a three-phase cross-attention for knowledge retrieval: sparse activation, knowledge-specific thresholding with $B1^l(E)$, and a transformation bias $b2^l$ to bridge semantic gaps. Together, these contributions lay a foundation for enhanced interpretability, adaptability, and scalable knowledge integration, including future work on external pluggable KBs and the associated computational trade-offs.
Abstract
Transformers have achieved remarkable success across diverse domains, but their monolithic architecture presents challenges in interpretability, adaptability, and scalability. This paper introduces a novel modular Transformer architecture that explicitly decouples knowledge and reasoning through a generalized cross-attention mechanism to a globally shared knowledge base with layer-specific transformations, specifically designed for effective knowledge retrieval. Critically, we provide a rigorous mathematical derivation demonstrating that the Feed-Forward Network (FFN) in a standard Transformer is a specialized case (a closure) of this generalized cross-attention, revealing its role in implicit knowledge retrieval and validating our design. This theoretical framework provides a new lens for understanding FFNs and lays the foundation for future research exploring enhanced interpretability, adaptability, and scalability, enabling richer interplay with external knowledge bases and other systems.
