Humans and artificial agents must often learn and switch between multiple tasks in dynamic environments. Success in such settings requires cognitive flexibility: the ability to retain prior knowledge (cognitive stability) while also transferring it to novel tasks (cognitive generalization). Cognitive flexibility research has largely focused on the role of model architecture to achieve these complementary goals. However, it is less well understood how the structure of the environment itself influences cognitive flexibility, and how it interacts with model architecture. To address this gap, we design a multi-task learning environment in which tasks are defined by a combination of two cue dimensions, allowing us to characterize the environment with graph-theory methods. We also introduce gating-based (multiplicative) and concatenation-based attention models that can decompose tasks into components and can sequentially allocate attention to them. We compare the attention-based models' performance in the multi-task learning environment to multilayer perceptrons. Generalization and stability are systematically evaluated across environments that vary in richness and task connectivity. We observe that richer environments improve both generalization and stability. In addition, a critical novel observation is that (graph theory based) connectivity between the tasks in the environment strongly modulates both stability and generalization, with especially pronounced benefits for attention-based models. These findings underscore the importance of considering not only cognitive architectures but also environmental structure and their interaction in shaping multi-task learning, generalization, and stability.
翻译:人类与人工智能体经常需要在动态环境中学习并在多个任务间切换。在此类情境中取得成功需要认知灵活性:既保留先验知识(认知稳定性),又能将其迁移至新任务(认知泛化)。认知灵活性研究主要关注模型架构在实现这些互补目标中的作用。然而,环境结构本身如何影响认知灵活性,及其与模型架构的交互机制尚不明确。为弥补这一空白,我们设计了一个多任务学习环境,其中任务由两个线索维度的组合定义,从而能够运用图论方法表征环境特征。我们还引入了基于门控(乘法型)与基于拼接的注意力模型,这些模型可将任务分解为子成分,并顺序性地分配注意力。我们将注意力模型在该多任务学习环境中的表现与多层感知机进行对比,系统评估了不同丰富度与任务连通性环境中的泛化能力与稳定性。实验发现,更丰富的环境能同时提升泛化能力与稳定性。更关键的是,我们首次观察到基于图论的环境任务连通性会显著调节稳定性与泛化能力,对注意力模型的促进作用尤为突出。这些发现强调了在塑造多任务学习、泛化能力与稳定性时,不仅要考虑认知架构,更需关注环境结构及其交互作用的重要性。