Relational Knowledge Distillation Using Fine-tuned Function Vectors

Andrea Kang, Yingnian Wu, Hongjing Lu

TL;DR

Researchers from UCLA have demonstrated that fine-tuning the internal "function vectors" of large language models (LLMs) using as few as 20 word pairs dramatically improves their ability to understand abstract relations. By linearly combining these refined vectors into "composite function vectors," they enable models to solve challenging, cross-domain analogy problems (like those found on the SAT) without updating the underlying model weights.

What Problem Does This Paper Address?

While large language models excel at in-context learning (ICL)—learning tasks on the fly from a few examples—their ability to perform abstract analogical reasoning remains brittle. They particularly struggle with "far analogies" that bridge completely different semantic domains (e.g., blindness : sight :: poverty : wealth).

Furthermore, ICL is transient; the model does not store the distilled relational concept for long-term reuse or flexible composition. This paper addresses how to explicitly extract, refine, and compose internal representations of relations to give LLMs more robust, human-like, and controllable analogical reasoning capabilities.

Methods

The authors build on the concept of Function Vectors (FVs)—compact representations of a task encoded within a small set of attention heads, typically identified via causal mediation analysis. They introduce two key innovations:

  1. Fine-tuned Function Vectors (FFVs): Instead of relying solely on the raw vector extracted from causal mediation, they fine-tune the vector itself. Keeping the LLM parameters completely frozen, they optimize the vector coordinates using a tiny training set of word pairs via cross-entropy loss and an $L_2$ regularization term to preserve the vector's structure.
  2. Composite Function Vectors (CFVs): To handle novel, out-of-distribution relations in one-shot analogy tasks ($A:B :: C:?$), they create a weighted combination of multiple basis FFVs. They use the source pair ($A:B$) to calculate the likelihood of each basis relation, pass these through a trained affine transformation, and linearly sum the vectors to steer the model's activations during the target prediction.
Figure 2: Illustration of the training procedure for the fine-tuned function vector. For a relation z, the function vector vz is updated using its word pairs (e.g., A : B). The final loss incorporates the cross-entropy from this word pair as well as a weighted L2 norm of the vector for regularization.
Figure 3: Illustration of the composite function vector for a four-term analogy task (e.g., (nose : scent :: antenna : ?). The composite function vector, computed as the weighted sum of the fine- tuned function vectors v and the posterior distribution w given the source pair (e.g., nose : scent), is injected into the LLM to influence its output predictions for the target. (e.g., (antenna : ?).

Datasets

  • Basis Relation Training: A pool of 118 relations compiled from a simple-task dataset, SemEval-2012 Task 2 (79 abstract relations like cause-effect and part-whole), the Google dataset, and the Microsoft Research (MSR) syntactic dataset.
  • Analogy Evaluation:
  • Green’s Analogy Dataset: 80 problems split into semantically near and cross-domain "far" analogies.
  • BATS (Bigger Analogy Test Set): 2,000 problems across 40 syntactic and semantic relations.
  • SAT Analogy Dataset: 374 real-world college readiness analogy questions featuring advanced vocabulary.

Key Insights and Ideas

  • Frozen Models, Fluid Vectors: You don't need to retrain a massive LLM to teach it new relational concepts. Updating just the low-dimensional function vector makes the representation highly robust and stable across different layers.
  • Alignment with Human Cognition: When the authors analyzed the internal activations of FFV-steered models, they found that the representations aligned significantly better with human similarity judgments of abstract relations compared to standard ICL or raw FVs.
  • Linear Compositionality of Relations: The success of CFVs confirms the linear representation hypothesis for relations. Complex or novel relations can be effectively synthesized as a simple linear combination of primary basis relations.

Key Results

  • Zero-Shot Boost: For GPT-J, injecting the fine-tuned FV (FFV) achieved a 75.2% accuracy on simple relation tasks, vastly outperforming the initial FV (42.3%) and the baseline model (5.1%).
  • Conquering Far Analogies: On Green’s challenging far-analogy dataset, CFV injection boosted GPT-J's accuracy from 42.5% to 61.0%, and LLaMa-3.1's accuracy from 57.5% to 74.0%.
  • SAT Performance: The approach generalized well to advanced vocabulary; CFVs improved SAT analogy solving across all tested models, including a +18.6% absolute gain for GPT-J and +6.1% for LLaMa-3.1.
Comparison of zero-shot accuracies against other activation steering baselines

Limitations and Future Work

  • Restricted to Four-Term Analogies: The current framework only addresses standard $A:B :: C:D$ word problems. Real-world analogical reasoning often involves complex narratives, stories, or structural mappings.
  • Hierarchical Relations: Human relational knowledge is deeply hierarchical (e.g., whole-part relations have sub-types like object-component or mass-portion). It remains unclear if LLMs naturally capture this hierarchy or if more explicit structural alignment is required.
  • Future Directions: The authors suggest expanding this framework to sentence-level contexts to enable analogical reasoning across full stories and narratives.

Summary updated

BibTeX
@misc{kang2026relational,
  author = {Andrea Kang and Yingnian Wu and Hongjing Lu},
  title = {{Relational Knowledge Distillation Using Fine-tuned Function Vectors}},
  year = {2026},
  eprint = {2601.08169},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.08169},
}
Figure