Abstract
Large Language Models (LLMs) have demonstrated strong performance in handlingcomplex tasks requiring both extensive knowledge and reasoning abilities.However, the existing LLM inference pipeline operates as an opaque processwithout explicit separation between knowledge retrieval and reasoning steps,making the model's decision-making process unclear and disorganized. Thisambiguity can lead to issues such as hallucinations and knowledge forgetting,which significantly impact the reliability of LLMs in high-stakes domains. Inthis paper, we propose a new inference paradigm that decomposes the complexinference process into two distinct and clear actions: (1) memory recall: whichretrieves relevant knowledge, and (2) reasoning: which performs logical stepsbased on the recalled knowledge. To facilitate this decomposition, we introducetwo special tokens memory and reason, guiding the model to distinguish betweensteps that require knowledge retrieval and those that involve reasoning. Ourexperiment results show that this decomposition not only improves modelperformance but also enhances the interpretability of the inference process,enabling users to identify sources of error and refine model responseseffectively. The code is available athttps://github.com/MingyuJ666/Disentangling-Memory-and-Reasoning.