Relational Knowledge Distillation Using Fine-tuned Function Vectors
Andrea Kang, Yingnian Wu, Hongjing Lu
TL;DR
This work tackles how relational knowledge can be distilled and manipulated inside LLMs by turning implicit task representations into explicit vectors. It introduces fine-tuned function vectors (FFV) to refine relation representations with minimal data, and a composite function vector (CFV) that linearly combines FFVs to transfer relational knowledge to novel tasks, all through activation-steering without updating the base model. FFVs yield substantial gains in zero-shot relation tasks and align more closely with human relational similarity judgments, while CFVs enable one-shot and cross-domain analogy solving, including challenging far-analogy and SAT-style problems, across multiple models. The results demonstrate that activation patching and linear vector representations can enhance interpretability and reasoning in LLMs, suggesting a scalable path toward explicit, human-aligned relational knowledge in AI systems.
Abstract
Representing relations between concepts is a core prerequisite for intelligent systems to make sense of the world. Recent work using causal mediation analysis has shown that a small set of attention heads encodes task representation in in-context learning, captured in a compact representation known as the function vector. We show that fine-tuning function vectors with only a small set of examples (about 20 word pairs) yields better performance on relation-based word-completion tasks than using the original vectors derived from causal mediation analysis. These improvements hold for both small and large language models. Moreover, the fine-tuned function vectors yield improved decoding performance for relation words and show stronger alignment with human similarity judgments of semantic relations. Next, we introduce the composite function vector - a weighted combination of fine-tuned function vectors - to extract relational knowledge and support analogical reasoning. At inference time, inserting this composite vector into LLM activations markedly enhances performance on challenging analogy problems drawn from cognitive science and SAT benchmarks. Our results highlight the potential of activation patching as a controllable mechanism for encoding and manipulating relational knowledge, advancing both the interpretability and reasoning capabilities of large language models.
