Abstract
Fine-tuning is a standard technique for adapting pre-trained models to new tasks, yet the nature of the knowledge it imparts remains poorly understood. This study introduces Empirical Influence Functions (EIFs) to analyze how individual training samples affect model behavior. Our findings suggest that while fine-tuning can appear to teach new facts, it often lacks logical consistency—such as transitivity—compared to in-context learning. We demonstrate these effects across simple CNNs and large language models (LLMs), highlighting a fundamental difference in how weight updates and prompting process information.
Introduction
The prevailing view of fine-tuning is that it "teaches" a model new knowledge. However, the logical structure of this learning is often opaque. For instance, if a model is fine-tuned on the facts "A is a part of B" and "B is a part of C," does it infer that "A is a part of C"? Traditional influence functions, which use the inverse Hessian to estimate sample impact, are often computationally prohibitive and unstable for deep neural networks.
To address this, we propose Empirical Influence Functions (EIFs). EIFs provide a direct, experimental method to measure how fine-tuning on a single sample alters a model's output across a broader test set. This approach allows us to evaluate whether fine-tuning adheres to logical desiderata like semantic distance, sparsity, and consistency.
Methodology: Empirical Influence Functions
The EIF methodology follows a straightforward "fine-tune and observe" pipeline:
- Baseline Measurement: Measure the model's loss on a set of test points before any intervention.
- Intervention: Fine-tune the model on exactly one new training sample.
- Empirical Influence Calculation: Re-measure the loss on the test set. The change in loss ($\Delta$ Loss) represents the empirical influence of the training sample on each test point.
Experimental Setup
We evaluated EIFs across two distinct architectures and datasets:
- Computer Vision (CNNs): Models were pre-trained on FashionMNIST and fine-tuned on single MNIST samples. This setup allowed us to observe how visual similarity drives influence in a controlled environment.
- Large Language Models (Phi-3): We used Phi-3 (3.82B parameters) to test logical properties. To prevent data leakage, we generated synthetic "nonsense" facts (e.g., "a klarbu is a pimjon") across three domains:
belongs_to(set containment),chain_induces(causal chains), andtransitivity(ordered relationships).
Analysis of Influence and Logic
The Symmetry Trap in Simple Models
In CNNs, influence is largely symmetric: if learning a "7" helps the model recognize a "1," then learning a "1" helps it recognize a "7" to a similar degree. This symmetry indicates that the model cannot distinguish between high-quality data and noise; both influence the model's internal representations equally. As shown in the heatmaps in the figure above, introducing noise into the fine-tuning sample preserves this symmetric influence pattern, suggesting a "kernel-like" behavior where influence is driven by raw similarity rather than learned logic.
Diffusivity and the Logic Gap in LLMs
In contrast to CNNs, LLMs exhibit asymmetric influence, which is a prerequisite for directed logic. However, this asymmetry does not always follow logical rules. When an LLM is fine-tuned on a fact, the influence is often "diffuse," spreading across many irrelevant tokens rather than targeting logically related concepts. Crucially, fine-tuning fails to respect logical transitivity. Training on a chain of facts (A→B, B→C) does not necessarily increase the model's belief in the conclusion (A→C). The model appears to treat these as isolated memorization tasks.
Prompting as a Logical Rescue
A key finding is that providing the same facts via a prompt (In-Context Learning) significantly improves logical consistency. Unlike weight updates, prompting respects transitivity and ontology. In the chain_induces domain, prompting yielded a much higher symmetry measure (indicating directed logic) than the flat, undirected influence observed during fine-tuning.
Conclusion and Future Work
Our results suggest that fine-tuning and in-context learning operate on fundamentally different principles. While fine-tuning is effective for memorization, it often fails to integrate new information into a logically consistent framework. Future research should address the scalability of EIFs, as the current $O(|P|^2)$ complexity limits their application to massive datasets. Additionally, developing "meta-learning" systems that explicitly optimize for logical influence functions could lead to models that integrate new facts into a coherent logical world model.
Summary updated