AttnDiff: Attention-based Differential Fingerprinting for Large Language Models
summary
The gist
Post-hoc fingerprinting of Large Language Models (LLMs) is critical for provenance verification in open-weight forensics…
In short
ATTNDIFF is a white-box framework that fingerprints Large Language Models by analyzing how they route attention when faced with controlled semantic conflicts. It extracts differential attention patterns using minimally perturbed prompts, summarizes them into compact spectral descriptors, and compares models using centered linear CKA to verify provenance robustly against model laundering.
Key concepts
- Differential Attention Matrix (∆A)
- This matrix captures the difference in how a model's attention mechanism distributes focus between two slightly different prompts. By comparing the attention maps of an original prompt and a semantically conflicting version, it reveals the specific internal routing changes that serve as a unique signature for the model.
- Spectral Descriptors
- These are compact mathematical summaries derived from the Differential Attention Matrix using truncated Singular Value Decomposition (SVD). Instead of storing massive attention maps, these descriptors capture the most important structural information about how attention is re-routed across layers and heads in a compressed format.
- Centered Linear CKA (CKA)
- This metric measures the similarity between two model fingerprints by analyzing their underlying representation spaces. It is robust because it captures structural alignment between these spaces, even if the dimensions of the fingerprints are different, making it ideal for comparing models that have been transformed in various ways.
- Model Laundering Robustness
- The method proves resilient against common model manipulation techniques like fine-tuning (PPO/DPO), pruning, merging, and distillation. ATTNDIFF maintains high similarity for related derivatives while remaining clearly separated from unrelated architectures, ensuring reliable provenance verification.
Terminology used across episodes
This episode discusses
- AttnDiff: Attention-based Differential Fingerprinting for Large Language Models · Paper Radio
- Evolutionary Optimization of Model Merging Recipes
- Llemma: An Open Language Model For Mathematics
- Qwen Technical Report
- Constitutional AI: Harmlessness from AI Feedback
- UTF:Undertrained Tokens as Fingerprints A Novel Approach to LLM Identification
- Efficient and Effective Text Encoding for Chinese LLaMA and Alpaca
- DELLA-Merging: Reducing Interference in Model Merging through Magnitude-Based Sampling
- DeepSeek-V3 Technical Report
- Red Teaming Language Models to Reduce Harms: Methods, Scaling Behaviors, and Lessons Learned
- Gemma: Open Models Based on Gemini Research and Technology
- The Llama 3 Herd of Models · Paper Radio
- Invariant-based Robust Weights Watermark for Large Language Models
- Intrinsic Fingerprint of LLMs: Continue Training is NOT All You Need to Steal A Model!
- Mistral 7B
- Mixtral of Experts
- Double-I Watermark: Protecting Model Copyright for LLM Fine-tuning
- SeedPrints: Fingerprints Can Even Tell Which Seed Your Large Language Model Was Trained From
- WizardMath: Empowering Mathematical Reasoning for Large Language Models via Reinforced Evol-Instruct
- Are Robust LLM Fingerprints Adversarially Robust?
- Training language models to follow instructions with human feedback
The paper
AttnDiff: Attention-based Differential Fingerprinting for Large Language Models · Read on arXiv
Haobo Zhang, Zhenhua Xu, Junxian Li Shangfeng Sheng, Dezhang Kong Meng Han
Zhejiang University of Technology · Zhejiang University · Binjiang Institute of Zhejiang University · Shanghai Jiao Tong University · University of Science and Technology of China
Transcript
Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.
Nadia: We're looking at the paper: "AttnDiff: Attention-based Differential Fingerprinting for Large Language Models".
Elias: Here's the gist of the paper. Post-hoc fingerprinting of Large Language Models (LLMs) is critical for provenance verification in open-weight forensics, yet existing fingerprints are often brittle under realistic model laundering (e.g., alignment, pruning/compression, model merging, and distillation) The authors propose ATTNDIFF, a robust and data-efficient white-box framework that fingerprints models via intrinsic information-routing behavior Framework Overview ATTNDIFF is a robust and data-efficient white-box framework that fingerprints models via intrinsic information-routing behavior It probes models with minimally perturbed prompt pairs that induce controlled semantic conflicts to extract differential attention patterns as signatures The framework summarizes these patterns with compact spectral descriptors and compares models using centered linear CKA (CKA) Across Llama-2/3 and Qwen2.5 models, it retains high similarity for related derivatives across fine-tuning, pruning/compression, and merging while remaining well separated from unrelated architectures Mechanism of Differential Fingerprinting ATTNDIFF directly probes how a model re-routes attention when confronted with such prompts by constructing paired prompts that introduce small lexical pivots to flip the underlying entailment It then extracts the corresponding differential attention maps across layers and heads, compressing them into compact spectral descriptors using TopK(σ) from SVD The resulting fingerprints are compared in a feature space using centered linear CKA (CKA) which captures structural alignment between representation spaces and is invariant to isotropic reparameterization Robustness Against Model Laundering The method demonstrates robustness across various model laundering operations, including fine-tuning (PPO/DPO), merging, pruning, and distillation Specifically, ATTNDIFF maintains high similarity for related models under fine-tuning and model merging while remaining well separated from unrelated architectures with a margin of > 0.98 vs.
Nadia: < 0.22 with M = 60 probes Furthermore, the study shows that ATTNDIFF preserves high similarity across all structured and unstructured pruned suspects even when aggressive structured pruning causes parameter-based fingerprints to collapse Theoretical Guarantees and Limitations A theoretical analysis of ATTNDIFF centered on the centered linear CKA similarity justifies why CKA is suitable for comparing ATTNDIFF fingerprints even when the feature dimensions differ (D ̸= D′) Proposition 2 provides a coarse CKA perturbation bound showing that CKA remains close to 1 when the centered Gram matrices are close in Frobenius norm However, ATTNDIFF currently assumes a white-box setting requiring access to internal attention activations and lacks an end-to-end derivation framework for common laundering operations ATTNDIFF supports post-hoc provenance verification under common laundering pipelines while maintaining a clear separation margin from unrelated architectures It provides a practical and discriminative tool for model provenance and accountability with only 5–60 multidomain probes The method requires no training or gradient-based optimization, making probe refresh operationally feasible Page 1 --- ATTNDIFFfingerprints Large Language Models (LLMs) by capturing their differential attention dynamics under semantic conflict.
Elias: As shown in Figure 1, the pipeline comprises probe prompt construction and fingerprint extraction Given a victim model and a suspect model, we compute a similarity score s = CKA(F, F′) to quantify their functional similarity Probe Construction Pipeline The probe set is constructed across six domains: Code, Math, Economics, Medicine, Daily QA, and Safe Alignment For each origin prompt p we generate a corrupted prompt p˜i from the origin prompt pi via a single-word (lexical) pivot substitution The pivot substitutes a key token to invert semantic intent while preserving surface form Fingerprint Extraction Mechanism For each probe pair, we compute the Differential Attention Matrix ∆A = A˜ − A after aligning token lengths as described in Sec.
Nadia: 4.2.2 We then extract rank-K spectral descriptor by applying SVD and retaining the top-K singular values (σ1,..., σK) as a compact spectral descriptor Concatenating these descriptors across all layers and heads yields a fingerprint vector fi ∈ R D for the i-th probe pair, where D = L × H × K Similarity Measurement by CKA To compare two models, we compute fingerprints F and F′ on the same probe set and measure similarity using CKA We form linear Gram matrices K = F F ⊤ and K′ = F′F′⊤ ∈ RM×M that encode inter-probe relational geometry Centered linear CKA is computed via the HilbertSchmidt Independence Criterion (HSIC) where HSIC(K, K′) ∝ tr(K¯ K¯ ′): CKA(F, F′) = HSIC(K,K′√)HSIC(K,K') / HSIC(K,F')HSIC(F',F') Experiment Results The experiments evaluate ATTNDIFF under realistic model transformations and compare it against representative non-invasive baselines Table 1 indicates that largescale SFT can substantially alter model parameters/representations, causing parameter-based fingerprints (PCS/ICS) to drop sharply on heavily finetuned suspects (e.g., ∼0.5 on CodeLLaMA-7B and Llemma-7B) In contrast, ATTNDIFF maintains uniformly high similarity (> 0.985) across all SFT suspects and is comparable to the SOTA baseline REEF Discussion ATTNDIFF supports post-hoc provenance verification under common laundering pipelines while maintaining a clear separation margin from unrelated architectures The low per-model cost of ATTNDIFF makes probe refresh operationally feasible, enabling recomputation on demand without expensive retraining or large-scale data collection Page 2 --- Related Work 2.1 Invasive Fingerprints Invasive fingerprints embed ownership signals by modifying models during (pre-)training, typically via weight watermarks or backdoor triggers Weight watermark-based schemes encode verifiable patterns in parameter space but face capacity–utility trade-offs and may lose robustness under pruning, quantization, or strong fine-tuning Backdoor-based fingerprints use trigger datasets for black-box attribution yet require training-time control and can be removed by targeted erasure 2.2 Intrinsic Fingerprints Non-invasive (intrinsic) fingerprints do not inject external signals and instead mine model-inherent properties for provenance verification Representative families include parameterspace statistics in weight space, representation-based descriptors over hidden states/logits, semantic output traces, and adversarial-example-based triggers However, these signals can be brittle under realistic transformations like pruning/architecture edits or distillation or preference optimization (PO) fine-tuning Among intrinsic approaches ATTNDIFF departs from parameter-, representation-, and output-level signatures by fingerprinting models through their differential attention responses to controlled semantic conflicts Threat Model We study a post-hoc model forensics setting where a defender verifies the provenance of a released or seized suspect model while an attacker seeks to evade attribution after illicitly obtaining the model weights Attacker capabilities include supervised fine-tuning, alignment and PO, pruning, quantization, distillation to different architectures, and model merging or weight interpolation Defender capabilities allow inspection of internal states and computation of fingerprints for both models under the same probing protocol Design of ATTNDIFF ATTNDIFFfingerprints Large Language Models (LLMs) by capturing their differential attention dynamics under semantic conflict The pipeline comprises probe prompt construction and fingerprint extraction We construct a probe set of M prompts spanning six domains, with 10 prompts per domain Differential Fingerprint Extraction For the i-th probe pair (pi, p˜i) we generate a corrupted prompt p˜i from the origin prompt pi via a single-word (lexical) pivot substitution yielding a semantic conflict between pi and p˜i For each layer l ∈ L and head h ∈ H we extract the post-softmax causal self-attention probability matrix A(i)l,h for pi and the corresponding matrix A˜(i)l,h for p˜i We compute the Differential Attention Matrix ∆A = A˜ − A To obtain a compact, length-invariant signature we apply truncated SVD to ∆A and retain the top-K singular values as a spectral descriptor s(i)l,h ∈ R K Similarity Measurement by CKA To compare two models, we compute fingerprints F and F′ on the same probe set and measure similarity using CKA We form linear Gram matrices K = F F ⊤ and K′ = F'F'⊤ ∈ RM×M that encode inter-probe relational geometry Similarity Metric Implementations PCS is a parameter-space baseline that compares two models directly in weight space by computing the cosine similarity between aligned parameter vectors ICS follows Li et al.
Paper summary: Nadia: So we’re looking at a paper called "AttnDiff: Attention-based Differential Fingerprinting for Large Language Models." Essentially, they're trying to create a way to fingerprint models after they've already been used, which is really important for figuring out where a model came from in forensics.
Elias: Right. The core idea behind this paper is that existing fingerprints are often too fragile because models get changed through things like fine-tuning or pruning, and these new methods are brittle under those kinds of realistic changes.
Priya: So what they're proposing here is a white-box framework that fingerprints models by looking at how they route information intrinsically, rather than just looking at the weights or the final outputs.
Nadia: Exactly. They claim that this approach allows them to probe models using minimally perturbed prompt pairs that intentionally cause a semantic conflict, and then extract those differential attention patterns as a signature of what the model is doing internally.
Elias: Their central hypothesis is that this information-routing pattern constitutes a stable, intrinsic property of the model, which persists even when the model undergoes various attacks like fine-tuning or merging.
Priya: It’s interesting that they say this pattern is defined by how self-attention distributes attention weights over tokens that encode logical operators, factual priors, and safety signals.
Nadia: That sounds like they are focusing on the core logic of how the model processes different types of information. How does it decide what to pay attention to when things conflict?
Elias: They construct these paired prompts by introducing a single-word lexical pivot into an original prompt, which flips the underlying meaning while keeping the surface form mostly intact.
Priya: So instead of looking at the whole model's behavior, they’re isolating it to see how it re-routes attention when faced with that specific semantic conflict.
Nadia: And then they compress those differential attention maps into compact spectral descriptors using something called TopK sigma from singular value decomposition, which gives them a manageable fingerprint vector for each probe pair.
Elias: That fingerprint vector is what they compare between two models, and they use centered linear correlation on these vectors, which is called CKA.
Priya: Centered linear correlation seems like a way to measure the structural alignment between the representation spaces of the two models, and it’s supposed to be invariant to things like isotropic reparameterization.
Nadia: The results they show are pretty strong: across Llama two and three and Qwen two point five models, ATTNDIFF maintains high similarity for related derivatives even after fine-tuning or pruning <ref:2604.05502#pg1,high similarity for related derivatives>.
Elias: They report that for example, they maintained a similarity margin of greater than zero point nine eight versus less than zero point two two when using sixty probes.
Priya: And what they found is that this method preserves high similarity across all structured and unstructured pruned suspects even when aggressive structured pruning causes other parameter-based fingerprints to collapse.
Nadia: That’s a big deal because parameter-based methods seem to drop sharply on heavily finetuned models, like they did with Llama 7B and Llama 7B in their experiments <ref:2604.05502#pg3>.
Elias: And the study compares ATTNDIFF against baselines like PCS and ICS, and it shows ATTNDIFF maintains uniformly high similarity, over zero point nine eight five across all SFT suspects.
Priya: So for someone who just listens to the show, this means we’re talking about a fingerprinting method that stays stable even when models get heavily adapted or modified by attackers.
Nadia: It suggests this framework could be used for post-hoc provenance verification in a way that is robust against common laundering pipelines like alignment and pruning.
Elias: The authors also noted some theoretical guarantees, specifically proposition two, which provides a coarse correlation perturbation bound showing that CKA remains close to one when the centered Gram matrices are close in Frobenius norm.
Priya: But they did point out a limitation: this whole method requires white-box access to the suspect model during verification, meaning you need to be able to inspect its internal states.
Nadia: Right, so it’s not some black-box technique where you can only send prompts and get a score; you have to be able to look inside the model.
Elias: Also, they admit that ATTNDIFF currently lacks an end-to-end derivation framework for common laundering operations, which means they haven't fully shown how it handles every possible attack scenario from scratch.
Priya: It’s a practical tool because the cost per model is low, and you only need five to sixty multidomain probes to get this information.
Nadia: That low probe count makes the method operationally feasible for someone who needs to refresh those fingerprints on demand without retraining or massive data collection.
Elias: So, in conclusion of this paper, ATTNDIFF offers a way to fingerprint LLMs by capturing their differential attention dynamics under semantic conflict using spectral descriptors and centered linear correlation.
Priya: It yields model-agnostic fingerprints that remain stable for co-originated derivatives and are well separated from unrelated models across fine-tuning, pruning, compression, and model merging.
Nadia: This supports post-hoc provenance verification while maintaining a clear separation margin from completely unrelated architectures.
Elias: It’s a practical and discriminative tool for model provenance that doesn't need training or gradient-based optimization to run the fingerprint refresh operationally.
Conclusion: Nadia: So we’ve seen how this paper, "AttnDiff: Attention-based Differential Fingerprinting for Large Language Models," uses attention patterns to fingerprint AI models after they’ve been modified.
Elias: Exactly, it’s about looking at the internal routing behavior of a model when you give it slightly different prompts to see what that reveals about its underlying structure.
Priya: What this means in plain terms is that we can create a signature for an AI model based on how it processes information, not just by looking at its final answers or even the numbers inside the weights directly.
Nadia: Right, so the authors are proposing this white-box method where they use these differential attention patterns, summarized by spectral descriptors and centered linear correlation, to compare two models.
Elias: They’re showing that this technique keeps a high similarity score for models that come from the same source, even if you fine-tune them or merge them together.
Priya: It’s interesting because it suggests these attention patterns are a really stable property of the model, which is different from other fingerprints that might break apart when you apply heavy training or compression.
Nadia: The paper shows they test this across Llama and Qwen models and that it holds up pretty well against those laundering operations we talked about earlier.
Elias: And what they highlight is that this method doesn't need any kind of training or gradient optimization to run the fingerprint refresh operation, which makes it much more practical for real-world use.
Priya: But there are still limitations, as the authors admit they only have access to white-box settings where you can look inside the model’s activations.
Nadia: True, so while it’s a powerful way to verify provenance in a controlled setting, it’s not something you can just slap on any black-box system.
Elias: So the big implication here is that we have a new tool for post-hoc verification that’s robust against common model laundering pipelines.
Priya: It gives us a concrete way to check if a suspect model is related to a known source, provided we can get those internal states.
Nadia: Next up, we're going to look at how they actually built these probe sets and the specific math behind extracting those attention matrices.
More episodes
- 2608.27496-ROPE: Routed Origin Policy Enforcement against Indirect Prompt Injection
- Daily Summary for 2026-11-19
- 2607.07085-Is Randomness Necessary for Adaptive Data Analysis?
- The day in conversation for 2026-11-19
- Daily Summary for 2026-11-19
- 2609.10601-Threshold Choice, Not Sample Size, Bounds Trustless Verification of Nondeterministic Compound AI Workflows
- 2610.38786-Adversarial Process Disturbances at a Deployable Alarm Budget: Detector Evaluation on a Simulator and a Real Plant
- 2511.08660-Binary and Multiclass Cyberattack Classification on GeNIS Dataset
- 2604.27302-Static Attribution of Android Residential Proxy Malware Using Graph Kernels
- Daily Summary for 2026-11-18