Current research efforts are focused on enhancing the thinking and reasoning capability of large language model (LLM) by prompting, data-driven emergence and inference-time computation. In this study, we consider stimulating language model's thinking and cognitive abilities from a modular perspective, which mimics the human brain architecture. We select a specific intermediate attention layer with newly implemented language heads. We conduct dual-layer fine-tuning by annotated (query, thought, answer) samples and show that the intermediate layer can also learn to decode fluent and reasonable language tokens. A two-pass inference mechanism is designed to generate thoughts then formal responses. The entire framework is called modularized thinking language model (MeTHanol) which can enhance LLM's cognitive behaviors as indicated by Theory of Mind (ToM) and Vignette-based experiments. Case studies also show that MeTHanol can plan and self-reflect and generate human-like thoughts and answers, even on unseen and open-domain tasks. MeTHanol can also adapt to a personalized prompt and behave as the specified character. Our study holds promise for significant cognitive gains from a modular perspective. Our code, model and data are available at https://bachozean.github.io/methanol-page
翻译:当前研究致力于通过提示、数据驱动的涌现及推理时计算来增强大语言模型的思考与推理能力。本研究从模块化视角出发,模拟人脑结构,探索刺激语言模型思考与认知能力的路径。我们选取特定的中间注意力层,并植入新实现的语言头。通过标注的(查询、思考、答案)样本进行双层微调,实验表明中间层同样能学习解码出流畅且合理的语言标记。我们设计了一种两遍推理机制,先生成思考过程,再生成正式响应。整套框架称为模块化思考语言模型(MeTHanol),心理论(ToM)及基于小故事实验均表明,该模型能增强大语言模型的认知行为。案例研究进一步显示,即使在未见过的开放领域任务中,MeTHanol也能进行规划、自我反思并生成类人的思考与答案。此外,MeTHanol还能适配个性化提示并按照指定角色行为。本研究有望从模块化视角实现显著的认知提升。相关代码、模型及数据访问地址为:https://bachozean.github.io/methanol-page