Functional Abstraction of Knowledge Recall in Large Language Models
Zijian Wang, Chang Xu
TL;DR
The paper proposes that knowledge recall in large language models can be understood as a functional process, with activation vectors serving as input arguments, function bodies, and return values. It introduces a activation patching–driven framework to identify subject, relation, and object representations and validates their independent roles via counter-knowledge testing and vector interchange, grounded in causal mediation analysis. The authors then leverage this functional insight to improve contextual knowledge editing through targeted activation patches, enabling more reliable short-term memory updates for new facts. Overall, the work demonstrates localized, stage-wise encoding of knowledge and presents a promising path for both interpretability and rapid, non-parametric knowledge editing in LLMs.
Abstract
Pre-trained transformer large language models (LLMs) demonstrate strong knowledge recall capabilities. This paper investigates the knowledge recall mechanism in LLMs by abstracting it into a functional structure. We propose that during knowledge recall, the model's hidden activation space implicitly entails a function execution process where specific activation vectors align with functional components (Input argument, Function body, and Return values). Specifically, activation vectors of relation-related tokens define a mapping function from subjects to objects, with subject-related token activations serving as input arguments and object-related token activations as return values. For experimental verification, we first design a patching-based knowledge-scoring algorithm to identify knowledge-aware activation vectors as independent functional components. Then, we conduct counter-knowledge testing to examine the independent functional effects of each component on knowledge recall outcomes. From this functional perspective, we improve the contextual knowledge editing approach augmented by activation patching. By rewriting incoherent activations in context, we enable improved short-term memory retention for new knowledge prompting.
