AttenMIA: Membership Inference Attacks on LLMs Using Attention SignalsAttenMIA: LLM Membership Inference Attack through Attention Signals
AttenMIA performs white-box membership inference; on WikiMIA-32 and LLaMA-13B, TPR@1%FPR is 87.9%.
White-box and reference-free. The attacker can read the target LLM's attention for each layer and head, has no training data or optimizer state, and does not use shadow models; the goal is to determine whether a sample is in the training set. Assumes no differential privacy, output perturbation, or attention masking. The extraction experiment still has no training corpus and ranks continuations for GPT-2.
- Open-source LLMs memorize training data; membership inference can compromise confidentiality and support data extraction. The authors state that output-confidence-based methods have overlapping boundaries and are fragile under distribution shift.
- AttenMIA reads the attention of each layer and head in a white-box setting, computes inter-layer consistency and centroid drift, as well as KL shifts caused by token dropping, replacement, and prefix insertion, and then trains an MLP.
- On WikiMIA-32, the Perturbed variant of LLaMA-13B has an AUC of 99.6 and TPR@1%FPR of 87.9%. The authors state that on MIMIR it outperforms RECALL and PETAL on average; the Pearson r between GPT-2 extraction scores and ROUGE-L is 0.480.
- The conclusion hopes for future research on privacy-preserving training and auditing tools for the responsible use of attention. The paper does not have a dedicated section on limitations. Experiments include WikiMIA, MIMIR, deduplication, and GPT-2 extraction; it does not report numbers under defenses such as differential privacy, nor does it report sample sizes.
- Evaluated models
- Pythia-1.4BPythia-2.8BPythia-6.9BLlama2-13BLLaMA-30BGPT-NeoX-20BOPT-6.7BOPT-66BPythia-dedup-1.4BPythia-dedup-2.8BPythia-dedup-6.9BGPT-2
- Benchmarks
- WikiMIAMIMIRCommon Crawl
- Metrics
- ROC AUCTPR@1%FPRHellinger DistancePearson rROUGE-L
The researchers propose AttenMIA, a membership inference attack framework that uses Transformer self-attention patterns to determine whether a sample belongs to the training set. Existing membership inference attacks on LLMs mainly rely on output confidence or embedding features, which are relatively weak signals; AttenMIA trains a classifier by combining cross-layer attention head information with perturbation-based divergence metrics. On open-source models such as LLaMA-2, Pythia, and Opt, attention features consistently outperform the baselines, achieving up to 0.996 ROC AUC and 87.9% TPR@1%FPR on Llama2-13b on the WikiMIA-32 benchmark. The authors state that attention signals generalize across datasets and architectures, and provide an analysis of the layers and heads with the most pronounced leakage; after replacing other membership inference attacks in a data extraction framework with it, training data extraction outperforms the current state-of-the-art method.
Related events and news
1 events · 1 news mentions
News that mentions this paper
Mindgard发布成员推理攻击技术指南
- Mindgard Blogcites the paper's id or link成员推理攻击:攻击者如何得知模型用了哪些训练数据
Attention signals (AttenMIA) 2026 White-box attention maps Self-attention patterns across layers 0.996 AUC, 87.9% TPR at 1% FPR, WikiMIA-32 on Llama-2-13B
Paper analysis
What problem does this paper attempt to solve?
The authors propose AttenMIA, which uses attention transitions and perturbation features for white-box membership inference.
Under white-box conditions, how to use transformer self-attention to determine whether a sample is in the LLM training set.
- Scenario: The authors state that LLM corpora are large and models memorize training data; Carlini et al. can extract verbatim samples from GPT models, and Kandpal et al. report leakage of personally identifiable information. Membership inference breaks confidentiality and can also serve as a component for gradually recovering training data.
- Limitations: The authors state that existing LLM membership inference mainly uses log-likelihood, perplexity, or token confidence; member and non-member boundaries overlap, performance degrades at low false-positive rates, and it is fragile under distribution shift. The introduction states that LiRA and semantic MIA are more accurate but computationally expensive and have limited interpretability; gradients and hidden representations have been used, but attention has not been systematically studied.
- Hypotheses: H1: members have more consistent attention transitions across layers and heads; non-members are noisier. H2: perturbation turns members into non-members, and attention shift should be larger than for non-members.
- Proposal: AttenMIA (also written as ATTEN MIA in the paper) extracts transition features and perturbation features, trains a classifier, and replaces the membership scoring in the data extraction pipeline.
- Threat model:
- Goal: Given a generative model fθ and a sample x, infer whether m(x) is 0 or 1, distinguishing training members from non-members.
- Knowledge: White-box, can read attention matrices for each layer and head; no original training data, no optimizer state. Corresponds to open-source weight release; the paper cites Llama2 as an example.
- Capability: Extract attention from input; does not train shadow models; the authors state the attack is reference-free. In the extraction setting, there is no training corpus; short prefixes are used to generate continuations and then rank them.
- Assumptions: No differential privacy, output perturbation, or attention masking is applied.
What related research exists?
Related work covers membership inference, data extraction, and attention-based attacks and defenses; the authors state that attention has not previously been systematically used for LLM membership inference.
Section 7 is divided into three groups; the experimental section also lists baselines.
Membership Inference
- Output statistics: Shokri et al. (2017) proposed membership inference; Yeom et al. (2018) used loss; Carlini et al. (2021) treated low perplexity as a sign of memorization. Min-K% (Shi et al., 2023) and Min-K%++ (Zhang et al., 2024) use the lowest top-K% token probabilities. The introduction criticizes these output signals: overlapping boundaries and fragility under distribution shift.
- Shadow models: LiRA (Carlini et al., 2022) and Truth Serum (Tramèr et al., 2022) use shadow models to approximate the target. The authors state that training dozens of shadow models is computationally expensive for LLMs. The introduction also groups semantic MIA with LiRA as computationally expensive and limited in interpretability.
- Direct probing of the target: RECALL (Xie et al., 2024) looks at conditional log-likelihood changes; neighborhood (Mattern et al., 2023) and semantic MIA (Mozaffari and Marathe, 2024) do not train additional auxiliary models; PETAL (He et al., 2025) approximates output probabilities using token semantic similarity and then computes perplexity. Related Work writes the latter group as not requiring auxiliary training, differing from the introduction's grouping.
Internal States and Poisoning
- Nasr et al. (2019) use gradients, Song et al. (2019) use internal representations for membership leakage. The paper lists these as feature-based approaches.
- Chen and Pattabiraman (2024), Chaudhari et al. (2023) first poison the dataset and then look at outputs to determine membership.
- Mireshghallah et al. (2022), Fu et al. (2024) discuss memorization in fine-tuned autoregressive models and membership leakage after fine-tuning.
Training Data Extraction
- Carlini et al. (2019, 2021, 2023) use prompts to extract training text and quantify memorization; Nasr et al. (2023) extract several MB of training data from ChatGPT. Section 6 uses Carlini et al. (2021)'s scoring as the extraction baseline.
- Mamun et al. (2023), Yu et al. (2023) use prompts and decoding parameters to improve extraction; Lee et al. (2023) compare top-k and top-p. Kandpal et al. (2022) discuss deduplication reducing privacy risk; Section 5.3 tests deduplication along these lines.
Attention and Security
- The authors state that, although attention is responsible for information flow (Vaswani et al., 2017), most adversarial attacks against transformers do not exploit attention.
- The authors state that no attention-based privacy attacks have been seen; existing work uses attention for jailbreaks (Zaree et al., 2025; Pandya et al., 2025) or jailbreak detection (Pu et al., 2025).
Baselines and Benchmarks: Experimental baselines are PPL, Loss, Ref, Zlib, Neighbor, Min-K%, Min-K%++, PETAL, RECALL. Table 1 also has LIRA. Table 3 also has WS, RS, BT; the main text does not define these three. Benchmarks are WikiMIA and MIMIR.
The authors state that, to their knowledge, AttenMIA is the first framework to systematically extract attention features for LLM membership inference; the introduction states it is the first attention-based white-box MIA for LLMs.
How does the paper address this problem?
AttenMIA concatenates inter-layer consistency, barycenter drift, and three perturbation shifts, then trains an MLP.
AttenMIA reads self-attention from the target LLM, splits into transition and perturbation pathways, concatenates into a vector z, trains an MLP, and outputs membership probability (Figure 1, Algorithm 1).
Setting and Assumptions
- The background section writes m(x, y) as 1 if and only if (x, y) is in the training set. The threat model for generated samples writes m(x)∈{0,1}, where 1 indicates membership.
- The attacker only extracts attention weights {A^(l,h)} from fθ and does not train shadow models. The authors state this is reference-free, distinguishing it from frameworks that rely on reference models.
- H1: Training samples induce more consistent inter-layer and inter-head transitions; non-members are noisier and less structured. H2: Perturbation turns members into non-members, and attention shift is larger than for samples that remain non-members.
- Section 5.1 still uses dataset gold labels to supervise classifier training. The paper does not explain how this training condition and "no original training corpus" hold simultaneously.
Transition Features
- Aℓ,h is the T×T attention for layer ℓ, head h. Adjacent layers compute three consistency measures: vectorized correlation (Consistency–Corr), Frobenius distance divided by T squared (Consistency–Frob), and the average of row-wise KL (Consistency–KL).
- The authors state that the three measures respectively describe whether the overall structure is similar, the magnitude of differences, and how token-level distributions move; together they are more complete than a single metric.
- Barycenter: the weighted position of each row of attention, then the mean and variance of absolute displacement between adjacent layers (Barycenter–Mean, Barycenter–Var).
- Figure 3 shows kernel densities of these five feature types, members in blue, non-members in orange. The authors state the two groups are separable, with less overlap than previous output statistics. The text does not give peak coordinates.
Perturbation Features
- Three heuristics: drop a fixed number of tokens at predetermined positions; replace selected tokens with unrelated vocabulary items; prepend an unrelated non-member prefix. The main experiments do not specify the number dropped or replaced. The intuition setting in Figure 2b drops 7 tokens at fixed positions.
- The shift for each head is the average KL of attention rows before and after perturbation. The paper defines it as Δκℓ,h=1/T∑i=1TKL(Aℓ,hi,:‖ A′ℓ,hi,:), i.e., the degree to which perturbation pushes that head's attention away from its original distribution.
- The authors give two intuitions: members are more deeply embedded in parameters, or perturbation has asymmetric effects on members. Figure 4, on MIMIR's Arxiv subset and Pythia-1.4B, the authors state that kernel densities of head-level correlations separate across multiple layers and perturbations.
Aggregation and Decision
- For each sample, concatenate the five types of transition statistics and the Δκ for three perturbations. The authors state that the perturbations are complementary, and merging yields higher ROC AUC and TPR@1%FPR; all layers have information, and concatenation across depths outperforms single layers or layer groups.
- The classifier is a lightweight MLP, with labels Member=1, Non-Member=0. Algorithm 1 has three steps: extract features, train, predict, and writes n-fold; the experimental section sets it to 5-fold. The paper does not report network width, learning rate, decision threshold, or number of queries.
- Two metrics from prior work are used: ROC AUC, and true positive rate at 1% false positive rate (TPR@1%FPR). Membership labels come from dataset gold labels, not LLM evaluation.
What experiments did the paper conduct?
On WikiMIA-32 and LLaMA-13B, Perturbed AUC is 99.6 and TPR@1%FPR is 87.9.
Experimental Setup
- Models: Released weights, no fine-tuning. Table 2 lists Pythia-6.9B, LLaMA-13B, NeoX-20B, LLaMA-30B, OPT-66B. The abstract writes 0.996 and 87.9% on Llama2-13b, corresponding to LLaMA-13B in Table 2. Table 3 lists Pythia-1.4B, 2.8B, 6.9B. Figure 2 uses OPT-6.7B. Deduplication uses Pythia-dedup 1.4b, 2.8b, 6.9b. Extraction target is public GPT-2; scoring baselines use GPT-2 XL and GPT-2 Small.
- Data: WikiMIA, lengths 32, 64, 128. MIMIR seven subsets: Wikipedia, GitHub, Pile CC, PubMed Central, arXiv, DM Mathematics, HackerNews, all with gold labels. The paper does not report sample sizes. Extraction prefixes come from Common Crawl, length 5–10 tokens, fixed decoding generates 256 tokens, totaling 14,000 pairs.
- Protocol: 5-fold cross-validation, reporting the mean across folds. The classifier is trained with gold labels.
- Baselines: PPL, Loss, Ref, Zlib, Neighbor, Min-K%, Min-K%++, PETAL, RECALL. Table 1 also has LIRA. Table 3 also has reference, neighborhood, WS, RS, BT. Extraction baselines are PPL-XL, S/XL perplexity ratio, lowercase/XL ratio, zlib, and zlib/XL ratio.
- Metrics: ROC AUC and TPR@1%FPR. No LLM judge. Table 2 AUC is written on a scale like 64.1, 99.6; Table 3 is written as 0.62, 0.99. The abstract's 0.996 and Table 2's 99.6 correspond to the same cell. Extraction uses Pearson r between scores and reference continuation ROUGE-L.
- Repetitions: Only 5-fold means are reported. The paper does not report repetitions beyond folds, nor the reference model name used for Ref.
Main Results
WikiMIA length 32 AUC / TPR@1%FPR (from Table 2):
Swipe horizontally to read the table
Model Transitional Perturbed RECALL Pythia-6.9B 98.9 / 86.4 98.2 / 66.0 91.6 / 28.5 LLaMA-13B 99.3 / 84.8 99.6 / 87.9 92.2 / 13.3 NeoX-20B 99.4 / 86.8 98.9 / 86.4 90.5 / 25.3 LLaMA-30B 99.7 / 94.1 99.7 / 94.7 90.7 / 18.4 OPT-66B 97.6 / 84.2 97.8 / 84.6 85.1 / 8.3 Average 99.0 / 87.3 98.8 / 83.9 90.1 / 17.5 - The authors state that both variants are best across all models and lengths, and claim a new state of the art on WikiMIA-32 and Llama2-13b in the low false-positive regime. Table 2 for length 128 has exceptions: Pythia-6.9B Perturbed is 91.5 / 17.5, lower than RECALL's 92.6 / 33.3; NeoX-20B Perturbed AUC is 86.6, lower than RECALL's 91.7 (TPR is 36.5, RECALL is 30.3).
- The authors state that as sequences lengthen, memorization signals weaken, and low FPR is more sensitive to long contexts. Table 2 average TPR: Transitional at lengths 64 and 128 is 70.1 and 48.9; Perturbed is 70.6 and 45.4. The authors state that NeoX-20B at length 32, transitional, has AUC and TPR close to 100%; in the same table, that cell has TPR 86.8 and AUC 99.4.
- In Table 3, Perturbed average ROC AUC is 0.83, 0.86, 0.87 (Pythia-1.4B, 2.8B, 6.9B); RECALL is 0.55, 0.54, 0.56; PETAL is 0.67 for all. The authors state it is 55% higher than RECALL and 27% higher than PETAL, and state average TPR@1%FPR is 47.8%, RECALL 19.6%, PETAL 13.3% (pointing to Table 7; that table's Perturbed average column is 41.6, 50.4, 51.4). Transitional is not always higher than PPL: on Wikipedia, Pythia-6.9B is 0.61, PPL is 0.64. On Pile CC, Pythia-1.4B Perturbed TPR is 3.7, lower than zlib's 4.4.
Layers, Length, and Perturbations
- Layers: Pythia-1.4B has 24 layers, PubMed Central, perturbation features (Figure 5). The figure marks 0.954 and 0.862; the caption states it marks the best single-layer value and states that using all layers reaches the peak. The authors state that single layers have membership information, and layer-group aggregation outperforms single layers.
- Length: Figure 6 x-axis is 32, 64, 128; y-axis is ROC AUC and TPR@1%FPR; models are Pythia-6.9B, LLaMA-13B, NeoX-20B, split into transitional and perturbed. The text does not list endpoint values; quantitative results are based on Table 2.
- Perturbations: Table 4 uses each of the three perturbations individually on Pythia-1.4B and each MIMIR subset. Average ROC AUC is 0.77 for all; average TPR@1%FPR is 35.1 (non-member prefix), 35.9 (drop), 35.8 (replace). The authors state that merging is strongest; the merged result is not in Table 4 but in Table 3's Perturbed column.
Deduplication Defense
- Table 5 compares ROC AUC for deduplicated and non-deduplicated Pythia. The authors state differences are mostly 0.00–0.03. On GitHub, Perturbed is 0.99 (0.00), 0.99 (0.00), 0.99 (-0.01); on HackerNews, it is 0.70 (0.00), 0.71 (-0.01), 0.71 (-0.01).
- Table 8 TPR@1%FPR: Perturbed on GitHub is 92.8% (+1.5%), 97.3% (+1.7%), 94.7% (-0.7%); on HackerNews, 15.1% (+1.3%), 16.5% (+3.5%), 16.5% (-2.4%). Transitional, GitHub, Pythia-6.9b is 43.0% (-17.1%). The authors state that deduplication only slightly reduces the attack, not enough to remove the signal AttenMIA exploits; Appendix C states that coarse-grained deduplication is insufficient, and fine-grained deduplication may discard useful knowledge.
Training Data Extraction
- Setup: Public GPT-2, white-box, no training corpus. 14,000 prefix–continuation pairs; source document continuations serve as references, using ROUGE-L instead of the manual verification mentioned in the text. AttenMIA uses perturbed attention features, passed through an MLP to get a [0,1] score. Correlation analysis takes the top and bottom 1,000 by ROUGE-L.
- Results: In Table 6, Pearson r between AttenMIA and ROUGE-L is 0.480; ratio zlib xl is 0.321; ppl xl, ppl lower, ppl s are -0.206, -0.238, -0.256. The table labels 0.480 as Strong correlation and 0.321 as Moderate correlation. Figure 7 shows two example scores: ROUGE-L 0.901, AttenMIA 1.0, and 0.843, 0.783. The paper does not report verbatim hit rate.
- Authors' interpretation: The authors state that attention perturbation features correspond more directly to training data familiarity than perplexity or compression ratios, so swapping them into the extraction framework yields higher extraction success. The authors write that experiments use only public models and non-sensitive internet text, aiming to audit memorization.
Other Ablations and Analyses
- Table 1 (MIMIR GitHub, Pythia-1.4B, only Consistency–Corr/Frob/KL): Hellinger Distance is 0.704, 0.663, 0.701; LIRA and Zlib are 0.557, LOSS and MIN-K% are 0.532, Neighbor is 0.545, MIN-K%++ is 0.506. The text states that several heads have HD between 0.60 and 0.70, with baselines at 0.506–0.557.
- Figure 2 (OPT-6.7B): The authors state that members have higher KL in deeper layers with relatively uniform distribution; after dropping 7 tokens, members show larger inter-layer changes. Per-layer numerical values are not listed.
- Figures 3, 4: The authors state that member and non-member kernel densities are separable. Peak coordinates are not given in the text.
- Appendix PCA: The authors state that masking the earliest token alone causes large displacement; cumulative masking up to about 6 or 7 tokens yields maximum displacement. Coordinate values are not given.
- Figure 9: Pythia-1.4B, 5-fold mean ROC and PR, shading is standard deviation across folds. The authors state that arXiv and DM Math are near-perfect separation, while GitHub and HackerNews are lower. The text lists seven subsets; the figure's subplot titles are arXiv, DM Math, GitHub, Pile CC, PubMed Central, Wikipedia.
What are some points that can be further explored?
The conclusion hopes for privacy-preserving training and attention auditing; the paper does not have a dedicated section discussing limitations.
Limitations and Future Directions Noted by the Authors
- The paper does not specifically discuss limitations; there is no dedicated Limitations section.
- Conclusion Section 8 writes: hope for future research on privacy-preserving training strategies, and auditing tools that responsibly use attention pathways.
Experimental Coverage
- Membership inference models are Pythia-1.4B, 2.8B, 6.9B, LLaMA-13B, LLaMA-30B, NeoX-20B, OPT-66B; OPT-6.7B is used for Figure 2; three sizes of Pythia-dedup are used for deduplication; extraction target is GPT-2, scoring baselines are GPT-2 XL and GPT-2 Small (Sections 5, 6, Tables 2, 3, 5).
- Benchmarks are WikiMIA with gold labels (lengths 32, 64, 128) and seven MIMIR subsets; the classifier uses 5-fold cross-validation and reports the mean (Section 5.1). The paper does not report sample sizes for each subset.
- Defense experiments use deduplicated Pythia, subsets GitHub and HackerNews (Tables 5, 8, Appendix C). Section 3 assumes no differential privacy, output perturbation, or attention masking; the paper does not report numbers under these three.
- Extraction experiments have 14,000 256-token continuations; Pearson analysis uses the top and bottom 1,000 by ROUGE-L (Section 6). The paper does not report verbatim hit rate, number of queries, the reference model name for the Ref baseline, or MLP width, learning rate, and repetitions beyond 5-fold.
- Perturbations are non-member prefix, token dropping, and token replacement (Section 4.3, Table 4). Dropping 7 tokens is only written in the intuition experiment of Figure 2b; the main experiments do not specify the number dropped.
Summarize the main content of the paper
AttenMIA uses white-box attention for membership inference, and the authors state that it outperforms output-based baselines at low false-positive rates.
AttenMIA is a white-box, reference-free membership inference method for open-weight LLMs: it reads internal attention rather than only output confidence to determine whether a sample is in the training set.
- Problem: The authors believe that pretraining makes attention more concentrated for members, inter-layer transitions more stable, and shifts under perturbation different. Output-based methods are insufficient under low false-positive rates and distribution shifts, and the shadow model route is expensive for LLMs.
- Approach: Compute correlation, Frobenius distance, row-level KL, and centroid drift between adjacent layers; then compute attention KL shifts for token dropping, replacement, and non-member prefixes. After feature concatenation, train an MLP with dataset gold labels. Experiments use 5-fold. The threat model states that the attacker does not have the original training corpus.
- WikiMIA: With length 32, LLaMA-13B, Perturbed has an AUC of 99.6 and TPR@1%FPR of 87.9% (Table 2; abstract writes 0.996 and 87.9%). In the same table, LLaMA-30B Perturbed is 99.7 / 94.7. Length 128 is not uniformly higher than RECALL: Pythia-6.9B Perturbed TPR is 17.5, while RECALL is 33.3.
- MIMIR and deduplication: On Pythia-6.9B, Perturbed has an average ROC AUC of 0.87 (Table 3). The authors state that the average TPR@1%FPR across scales is 47.8%. On GitHub, Pythia-6.9B Perturbed is 1.0; after deduplication it remains 0.99 on GitHub (Table 5). The authors state that deduplication is insufficient to remove these signals. TPR is lower on Pile CC, with Pythia-1.4B Perturbed at 3.7.
- Extraction and conclusion: On GPT-2, the Pearson r between AttenMIA scores and ROUGE-L is 0.480, and the zlib/XL ratio is 0.321 (Table 6, 2,000 entries). The paper does not report verbatim hit rates. The authors state that plugging this score into an extraction framework outperforms existing scoring, and that attention used for interpretability also poses privacy risks; the conclusion hopes for future work on privacy-preserving training and auditing tools.
Related papers
Show 1 more papers
- LLM Dataset Inference: Did you train on my dataset?Analysis / interpretabilityarXiv