Source-linked AI summary
The Emergence of Relevance Through Axiomatic Attention Patterns During LoRA Fine-Tuning
Matthew Perlman, Atharva Nijasure, James Allan
TL;DR
The paper examines where LoRA fine-tuning learns relevance in RankLLaMA and whether attention changes align with axiomatic IR patterns. Using targeted attention ablations and normalized feature-attention analysis, it finds that compact mid-network regions recover substantial ranking gains and overlap with interpretable attention changes. These changes, especially rarity sensitivity and document-query interaction, correlate with performance gains, while the evidence remains correlational and narrowly evaluated.
Problem
Where LoRA fine-tuning learns reranking relevance and whether its attention changes align with axiomatic IR patterns remain unclear.
Method
The paper combines head-, layer-, and window-level attention ablations with normalized feature-attention analysis in RankLLaMA-7B.
Results
Compact mid-network attention regions recover more than half of full-attention LoRA’s performance gain, and critical regions align with rarity-sensitivity and document-query-interaction changes.
Takeaways & Limitations
Rarity sensitivity, document-query interaction, and compositional features are strongly correlated with ranking gains, supporting an interpretable but correlational account of relevance emergence.
Takeaways & Limitations
The study uses direct lexical matching, one model, MS MARCO with small candidate sets and random negatives, and attention correlations do not establish causality.
Abstract
from arXiv · showhide
LoRA fine-tuning is standard for adapting LLMs to reranking, but it remains unclear where in the network task-specific relevance behavior is learned and what attention-level changes accompany that learning. Through ablation and attention experiments, we identify where LoRA attention updates to RankLLaMA improve performance and whether those gains coincide with interpretable relevance-oriented attention patterns such as lexical matching, rarity sensitivity, and query-document interaction. We find that given LoRA fine-tuned MLPs throughout the network, restricting LoRA attention updates to a compact mid-network region is sufficient for recovering over half of the performance gained by applying LoRA to all attention layers, and that omitting attention fine-tuning in this region hurts performance more than elsewhere in the network. Additionally, we show that regions where applying LoRA affects performance the most overlap with regions where fine-tuning increased attention to axiomatic IR features. Rarity sensitivity, document-query interaction, and several compositional features are highly correlated with gains in ranking performance. Our results support an interpretable, correlational account of how relevance-oriented behavior emerges during LoRA fine-tuning and point toward improved strategies for adapting rerankers.
1 Introduction
LoRA makes LLM adaptation efficient, but the network location and attention-level basis of learned relevance remain unclear. This study asks whether fine-tuning aligns reranking behavior with established axiomatic IR signals.
- LoRA reduces trainable parameters while often approaching full-fine-tuning effectiveness, motivating questions about where relevance behavior is implemented.
- The paper investigates which relevance signals are learned during fine-tuning and where they are implemented in the network.
- Axiomatic IR provides established relevance signals including lexical matching, rarity sensitivity, term-frequency weighting, and query-document interaction.
- Whether LoRA fine-tuning learns these axiomatic features, where it learns them, and whether their emergence improves performance remains unknown.
- The study combines attention ablations with analysis of attention shifts over token-pair categories to localize functional updates and characterize relevance-oriented patterns.
2 Related Work
Prior work shows that neural rerankers can encode classical IR signals and that fine-tuning can specialize attention components. This paper extends that literature by localizing LoRA attention contributions at finer granularities and relating them to axiomatic patterns.
- Neural Reranking and LoRA: RankLLaMA is a decoder-only language model adapted with LoRA for pointwise relevance scoring.
- Mechanistic Interpretability of Rerankers: Earlier studies identify semantic BM25-like attention, IDF-like embedding signals, query-term coverage, and term-frequency representations in neural rerankers.
- LoRA Ablations in IR: Prior LoRA ablations find stronger gains from MHA updates than MLP-only updates but use only coarse all-attention or all-MLP conditions.
- Attention Head Specialization: Attention-head research demonstrates specialized functions such as positional attention, syntactic tracking, rare-token routing, and match-and-copy circuits.
- Attention Head Specialization: Fine-tuning studies report systematic attention redistribution and newly emergent attention circuits that can be isolated through ablation.
- Axiomatic IR: Axiomatic IR formalizes properties including term-frequency weighting, rare-word sensitivity, and document-query interaction, which motivate the paper’s token-pair features.
3 Research Questions
The paper frames its investigation around where LoRA attention updates matter for reranking, whether they produce axiomatic IR attention patterns, and whether the two regions coincide.
- RQ1 asks where LoRA fine-tuning attention contributes most to reranking performance.
- RQ2 asks whether LoRA fine-tuning teaches attention heads to attend to axiomatic IR patterns.
- RQ3 asks whether performance-improving LoRA regions coincide with regions where axiomatic attention patterns emerge.
4 Ablation Experiments
The ablation experiments localize attention updates that support RankLLaMA reranking across head, layer, and contiguous-window granularities. Keep and omit analyses converge on a critical mid-network region, especially layers 10–18, with layer 29 as an outlier.
- Setup: The study compares fully fine-tuned RankLLaMA, its base model, and targeted attention-matrix ablations.
- Setup: RankLLaMA-7B has 32 transformer layers and 32 attention heads per layer, with LoRA adapters in every attention matrix and MLP while the base model remains frozen.
- Ablation Design: MLP LoRA updates remain active in every condition, isolating performance differences attributable to attention components.
- Ablation Design: Keep ablations retain LoRA only in the investigated component, whereas omit ablations remove LoRA from that component while retaining it elsewhere.
- Ablation Design: Keep ablations test sufficiency, omit ablations test necessity, and reverting to base parameters avoids conflating fine-tuning value with component destruction.
- Granularity: The experiments ablate individual heads, layers, and contiguous windows to measure specialization, layer concentration, and possible circuit-like regions.
- Evaluation: NDCG is the primary ranking metric, while mean score margin captures relevance separation even when granular ablations do not change document ordering.
- Results: Omitting layers 10–18 most consistently weakened performance, with layer 29 an isolated critical site; omitting the 13–18 window produced the largest NDCG drop.
5 Feature Attention Experiments
The experiments measure where LoRA-induced attention changes matter for reranking and how they alter axiomatic IR features. Mid-network ablations are especially important, while fine-tuning produces distinct layer-wise shifts in lexical matching, rarity sensitivity, document-query interaction, and compositional attention.
- Experimental setup: Ablation experiments localize the network regions where LoRA attention updates most affect reranking performance.The analysis uses head-wise, layer-wise, and window-wise comparisons, while MLP LoRA updates remain present throughout the network.
- Ablation results: Layers 10–18 and 25–32 contain many heads whose retained fine-tuning improves performance most.Figure 4 measures normalized mean score-margin differences per kept head; green denotes improvement and red denotes harm.
- Ablation results: Layers 14 and 29 yield notably higher performance improvements than most other individually retained layers.Other layers produce roughly uniform gains in the per-kept-layer mean score-margin analysis.
- Feature-attention methodology: Normalized Feature Attention excludes sink-token attention and measures the proportion of non-sink attention allocated to a specified token-pair feature.The metric averages attention from each head over feature-matching token pairs and evaluation examples.
- Feature-attention results: Fine-tuning generally decreases lexical-matching attention after layer 11, increases rarity sensitivity in layers 8–19, and increases document-query interaction in layers 8–22.Lexical matching increases in the final layer, rarity sensitivity decreases in layers 20–32, and per-head rarity changes fluctuate substantially.
- Feature-attention results: Compositional token-pair features combine multiple relevance conditions and show interpretable trends in learned attention.These features test whether fine-tuning attends to interdependent signals, such as rare document tokens attending to lexically matching query tokens.
6 Discussion
The results link performance-critical LoRA attention regions with interpretable attention changes, especially rarity sensitivity and document-query interaction. Compositional features show similarly strong or stronger correlations with ranking gains.
- Ablation findings: Layers 10–18 are necessary to match full LoRA performance and recover more than half its gain over the base model.This result assumes LoRA fine-tuned MLPs throughout the network.
- Attention patterns: Rarity sensitivity increases in layers 8–19, decreases in layers 20–32, and document-query interaction increases in layers 8–22.Lexical matching generally decreases after layer 11.
- Performance relationships: Performance-critical regions align with regions where LoRA most changes normalized attention to all three investigated axiomatic features.The alignment is especially strong for rarity sensitivity and document-query interaction.
- Performance relationships: Table 2 measures Spearman correlations between per-window NDCG ablation effects and changes in normalized feature attention.Keep correlations are positive, whereas omit correlations are negative for the same performance-relevant windows.
- Compositional features: Compositional features have matching or higher correlations with performance gains than individual features.This suggests interdependency among axiomatic properties is important and mirrors classical ranking strategies such as BM25.
7 Conclusion
The paper locates relevance-critical LoRA attention behavior in compact mid-network regions of RankLLaMA and relates those regions to axiomatic attention patterns. Compositional features are especially predictive of performance gains, supporting a correlational interpretation of relevance learning.
- Conclusion: RankLLaMA’s ranking gains are concentrated in compact mid-network regions identified through head-, layer-, and window-level keep/omit ablations.The ablations separately identify sufficient and necessary components.
- Conclusion: Critical regions strongly correlate with LoRA-driven attention to rarity sensitivity and document-query interaction.The study measures these patterns with normalized feature attention, which controls for attention sink mass.
- Conclusion: Compositional features combining axiomatic signals are more predictive of performance gains and mirror joint relevance signals in BM25.The conclusion frames these relationships as correlational rather than causal.
8 Limitations
The study leaves semantic matching unresolved and has limited generalizability because it evaluates one model and a restricted MS MARCO setting. The authors also caution that attention trends do not establish a causal relevance mechanism.
- Scope boundaries: Direct lexical comparison leaves semantic matching unresolved.The matching analysis does not address matches between nonidentical tokens.
- Scope boundaries: Experiments use RankLLaMA-7B on MS MARCO with small candidate sets and random negatives, limiting generalizability to other architectures and retrieval settings.The authors partially address generalization by replicating findings on a second reranking objective.
- Causal interpretation: Attention trends support an axiomatic mechanistic interpretation but do not constitute a causal relevance mechanism.The authors call for multiple models, harder negatives, more features, and causal interventions.
9 Ethical Considerations
The ethical discussion describes an interpretability study using public models and data without new data collection, human subjects, or sensitive information. A second reranking objective is used to assess whether the findings generalize beyond passage reranking.
- Ethical considerations: The study analyzes a publicly available neural reranking model trained on the widely used MS MARCO dataset.The model is RankLLaMA-7B.
- Ethical considerations: All experiments use publicly available models and data, with no new data collection, human subjects, or sensitive information.The authors report no foreseeable harm from the research.
- Generalization: The document variant tests generalization beyond the passage-reranking objective.It is a separately trained reranker optimized for document retrieval.
- Generalization: The document variant shows the same qualitative behavior, with critical attention updates approximately in layers 7–16 and over 70% recovery of the fully fine-tuned model’s NDCG gain.Document-query interaction again aligns strongly with the performance-critical region.
- Evaluation design: Layer- and window-wise ablations use 50 queries × 100 candidate documents, while head-wise ablations use 10 candidate documents per query.The different head-wise evaluation size reduces the computational cost of evaluating 32 × 32 model variants.
- Feature construction: The rare-token threshold is set near the IDF score of the 180th most frequent corpus word to exclude stopwords while retaining informative words.The threshold is estimated from 500k MS MARCO training documents.
F Compositional Feature Analysis
The analysis examines how compositional axiomatic features emerge during fine-tuning and how their attention changes relate to reranking performance. Learned document-query attention between rare words and lexical matches is especially predictive of performance gains.
- Compositional Features: Several compositional features show distinct trends in where they are learned during fine-tuning.The analysis focuses on features with strong correlation and interpretable meaning.
- Performance Correlations: Learned document-query attention between rare words and lexical matches is highly predictive of performance gains.These compositions can be more indicative of fine-tuned relevance-oriented learning than the individual features composing them.
- Core Features: Figures 10–12 compare lexical-match, rarity-sensitive, and document-query attention between the base and fine-tuned models.The figures provide model-level comparisons for the three core axiomatic features.
- Per-Head Attention: Figures 13–18 measure normalized attention to lexical matching, rare terms, and document-query segments per head in the base and fine-tuned models.These views compare the per-head distributions before and after fine-tuning.
- Window-Level Changes: Figures 19–21 track sliding-window changes in normalized attention for rare-token and lexical-match interactions between the base and fine-tuned models.The windows use size 6 and target several compositional feature pairings.
- Correlation Interpretation: Keep correlations are positive and omit correlations negative because stronger feature-learning windows yield larger gains when kept and larger drops when removed.This interpretation is stated for the per-window NDCG correlations.
G.1 Omit Ablations
Additional omit- and keep-window ablations test whether the main localization pattern persists across window sizes. The results consistently identify middle-network layers as especially important for performance.
- Omit Ablations: Fine-tuning for layers 6–18 is most necessary for performance across omit-window ablations with window sizes 3 and 4.These additional window sizes yield trends similar to the main omit-window results.
- Keep Ablations: Layers 9–18 recover optimal fine-tuning gains when kept in isolation across additional keep-window ablations.The pattern remains similar for window sizes 3 and 4.
- Robustness: Feature-attention and ablation-performance correlations remain consistent across window sizes 3 and 4.Correlations are slightly lower for smaller windows, attributed to redundant components absorbing finer-grained ablation effects.
- Implementation: The experiments use 7B-parameter models and require approximately 25 hours of compute on one NVIDIA A100 GPU.The authors also state that anonymized reproduction code is available.
- Supplementary Results: The additional ablation figures report omit-window results for window sizes 3 and 4 and keep-window results for window sizes 3 and 4.Figures 22–25 document the supplementary window-size comparisons.