Attribution and Training-Data Transparency
Learn how data statements, provenance manifests, and influence functions build a chain of evidence linking training data to model behavior.
Language AI HandbookAll chapters Attribution and Training-Data Transparency
Suppose a language model produces a distinctive phrase, a factual claim, or a stylistic tic. You ask the obvious question: where did that come from? The honest answer has several layers. The phrase may be common in ordinary language or recur across several training documents, leaving its origin uncertain. Transparency is the practice of making those layers inspectable. Attribution is the narrower act of connecting a model behavior or output to training data with evidence.
For example, suppose a model card says only that a corpus contains web text. The card establishes the category the developer disclosed. To connect an answer to a particular page, look for an example identifier and evidence about that answer. Use an influence score to discuss its stated model and target. Questions about legal attribution require the relevant records and legal analysis. Treat a near-duplicate match as evidence of overlap.
The gap between "here is what is in the training data" and "here is why the model said that" is where most of the intellectual and practical difficulty lives. It is tempting to collapse the gap with a single tool: publish a list of URLs, or compute an influence score, or run a plagiarism checker, and call the problem solved. Each of those artifacts answers a different question, and none of them answers all of them. A serious transparency effort is therefore less like a single measurement and more like building a chain of evidence, where each link is only as strong as the link beneath it.
This chapter follows Dataset Lineage and Provenance and Licensing, Consent, and Data-Use Signals in Data Governance, Provenance, and Synthetic Ecosystems. Those chapters asked what data exists and what its terms permit. Here we ask a different question: what evidence can we produce about the relationship between training data and model behavior? We will cover data statements, source disclosure, influence estimation, the limits of attribution, and how to communicate uncertainty without pretending that a gradient score is a legal deposition.
Provenance is the lineage of data: where it came from, how it was collected, and what transformations it underwent.
Disclosure is the act of publishing or sharing information about data sources, terms, and limitations.
Influence is an estimated effect of a training example on a model parameter, prediction, loss, or behavior.
Attribution is the broader evidentiary claim that connects an output or behavior to training data. Influence estimates are one kind of attribution evidence, not the definition of attribution.
A note on vocabulary before we proceed. The callout gives each term a distinct question to answer in an audit or public report. Provenance is about lineage. Disclosure is about what an organization chooses to reveal. Influence is a quantitative estimate of effect. Attribution is the umbrella evidentiary claim that may draw on all three. When you read a claim like "this model was trained on that author's work," it helps to ask which of these four things the writer established.
The Transparency Stack
It helps to think of training-data transparency as a stack. Each layer answers a different question, and some questions require evidence from several layers.
| Layer | Typical artifact | Question it answers |
|---|---|---|
| Dataset documentation | Data statement, datasheet, dataset card | What is this corpus, and what are its known limits? |
| Source manifest | Provenance ledger, URL list, contract metadata | Where did each component come from? |
| Example index | Document IDs, hashes, token spans, dedup cluster IDs | Which training items exist, and how are they identified? |
| Training record | Checkpoints, data order, hyperparameters, mixture weights | How was this model produced? |
| Behavioral attribution | Influence estimates, ablation, retrieval, memorization tests | What connects the behavior to particular training items? |
| Communication | Model card, transparency report, audit response | What should a reader believe, and with what confidence? |
Which layers you need depends on the claim. A summary may omit the detail required to trace a specific example. Suppose an exported score table contains only scores and ranks. To map those ranks to sources, recover the example IDs or an equivalent join. Suppose a data statement lists only “web crawl.” To identify dates and licenses, consult the original source manifest or equivalent records. Reproducing checkpoint-specific attribution also requires the relevant versioned training artifacts.
Think of a library. A catalog card tells you the title, author, and subject. A shelf list tells you exactly where the physical object sits. An acquisition record tells you who bought it, when, and under what terms. A circulation log tells you who read it. If you destroy the shelf list, the catalog card no longer helps you find the book. If you destroy the acquisition record, you cannot answer a question about provenance or rights. A similar problem arises when an influence map survives but its data manifest is overwritten. You need the original mapping or an equivalent record to verify which sources the ranked examples came from.
This is especially important for large language models because the training pipeline is long and lossy. Raw web pages can be extracted, normalized, filtered, deduplicated, language-identified, toxicity-filtered, scrubbed for personally identifiable information, packed into sequences, shuffled, and mixed with other sources. By the time the model is trained, a “document” may be a fragment, a deduplicated cluster representative, or a sequence packed with text from several sources. Define the intervention at the unit you score, which may be a packed sequence.
Consider an extractor that writes only page text and a deduplicator that writes only the kept item. To trace the source later, preserve the URL and the representative-to-members mapping separately. Byte normalization also affects exact matching. For example, replacing a carriage return and line feed with a line feed changes the SHA-256 digest for the string example followed by that line ending. A language identifier can drop text below its confidence threshold. Packing can put unrelated documents next to each other. Preserve the original boundaries with separator tokens or equivalent metadata, and keep transformation logs with enough detail for downstream checks.
Data Statements: Documenting the Dataset
Data statements were proposed for natural language processing as a way to document the social and linguistic context of a dataset, not just its size. The original framing by Bender and Friedman emphasized fields such as curation rationale, language variety, speaker and annotator demographics, speech situation, text characteristics, recording quality when relevant, and a provenance appendix for component datasets. Bender and Friedman (2018), section 5. The exact schema has evolved, but the motivation remains stable: a dataset is not self-describing, and unstated assumptions about representation, language varieties, and collection can lead to unsupported claims about who a model serves.
The core insight behind data statements is that a corpus carries an implicit argument about the world. It implies that these are the languages worth modeling, these are the speakers worth representing, these are the registers worth treating as normal, and these are the annotations worth trusting. When that argument stays implicit, it becomes invisible to the people who inherit the dataset and dangerous to the people the dataset describes. A data statement makes the argument explicit so that it can be examined, criticized, and revised. It is a form of documentation aimed at accountability, not just reproducibility.
Data statements also respond to a specific failure pattern in machine learning. A release that gives only a name, a size, a download link, and a citation leaves basic questions about its data unanswered. Years later, a downstream user cannot tell whether the corpus was scraped from forums, licensed from publishers, translated by volunteers, or generated by an earlier model. They cannot tell which languages are well represented and which are present in name only. They cannot tell whether the annotations were produced by experts, crowd workers, or a heuristic. A data statement is a structured attempt to pre-answer those questions before they become a problem.
For an LLM pretraining corpus, a data statement should answer a practical set of questions:
- What is the corpus? Name, version, release date, maintainers, and contact point.
- What is in it? Source categories, domain mix, language distribution, modality, and approximate token counts.
- How was it collected? Crawling, licensing, user contributions, synthetic generation, or aggregation.
- When was it collected? Crawl dates and temporal coverage, because language and facts drift.
- What was removed? Deduplication, quality filtering, toxicity filtering, PII removal, and opt-out handling.
- What are the known gaps? Underrepresented languages, dialects, domains, and communities.
- What are the legal and ethical terms? Licenses, consent basis, redistribution constraints, and known disputes.
- How can someone ask questions or request removal? Contact and governance process.
Naming a contact point gives users a route to ask questions when responsibility for a dataset changes. Recording crawl dates matters because a model trained on data from one period can confidently state facts that have since changed. Recording what was removed matters because the absence of a category is itself information. A corpus can cover many source categories while disproportionately removing text associated with some dialects. Dodge et al. (2021), section 5.3 found this pattern when comparing C4 variants with and without blocklist filtering. Before redistributing data, check the underlying terms. Verify how a process was carried out using the relevant records behind the data statement.
A data statement summarizes the corpus. Check the license or other underlying terms separately when you need to establish permission. A statement that says only “web text” gives readers little to work with when a question depends on crawl dates, domains, filters, or source categories. Use the source manifest when you need to trace an item.
Extending data statements for LLM corpora
The original data-statement schema describes source datasets, language varieties, and how data were collected and annotated. LLM pretraining adds questions about mixing and sequence construction. A useful LLM data statement should also document:
- Source mixture: proportions of web crawl, books, code, academic text, licensed databases, user data, and synthetic data.
- Collection signals: robots directives, terms of service, contractual restrictions, and opt-out registries.
- Pipeline decisions: extraction method, language identification thresholds, quality classifier thresholds, deduplication method, and PII detection strategy.
- Sequence construction: context length, packing strategy, document boundary markers, and whether examples cross document boundaries.
- Synthetic data share: which generator models, prompts, decoding settings, and filters produced synthetic examples.
- Evaluation contamination controls: benchmark decontamination methods and known residual risks.
Use the source mixture to prioritize provenance questions. For example, in an audit of a corpus that is 90% web crawl and 10% licensed books, start by checking the crawl and its filtering records. When synthetic examples are central to the audit, ask for the generator and its source records. Report proportions so readers can make that judgment for their own question.
Record the applicable robots directives, terms of service, contractual restrictions, and opt-out signals. When checking what happened, compare those terms or signals with the collection logs and the pipeline’s decisions.
Pipeline decisions matter because filters are where behavior gets shaped invisibly. A quality classifier that scores text by perplexity under a reference model can favor text that resembles its reference corpus. A language identification threshold can drop code-switched text when the classifier scores it below the cutoff. The scope, processing order, and representative-selection rule can affect which copy survives deduplication. For the released FineWeb dataset, MinHash deduplication ran separately within each Common Crawl snapshot. In a separate global trial, the researchers processed snapshots from newest to oldest. Their MinHash procedure formed connected duplicate clusters and kept one randomly selected document per cluster. Penedo et al. (2024), section 3.4 Recording the pipeline is what allows a critic to ask whether the surviving corpus represents the intended population.
Sequence construction determines what an example is. Packing can place fragments from several documents in one fixed-length example. Treat a single score for that example as sequence-level evidence. A claim about one fragment calls for a finer intervention. If preprocessing kept only the first four tokens of a six-token document, mark the final two tokens as outside that particular training input even if the manifest lists the whole document.
For a synthetic example, record the generator and ask what parts of the upstream lineage can be traced. Synthetic Data Pipelines and Recursive Training and Model Collapse take up these questions later in this part. A useful statement identifies the generator where records permit it.
Source disclosure and provenance manifests
Source disclosure is the layer between a prose data statement and a full document-level index. At minimum, a provenance manifest should record, for each corpus component:
- A stable component identifier and version.
- Source type, such as web crawl, licensed corpus, user contribution, or synthetic generation.
- Collection method and date range.
- License, contract identifier, or terms-of-use reference.
- Language identification results and confidence.
- Preprocessing steps and filter decisions.
- Deduplication cluster identifiers and hashes.
- PII removal status and retention policy.
- For web data, URL or domain, crawl timestamp, HTTP status, canonical URL, and robots directive where available.
- For synthetic data, generator model, prompt template, decoding configuration, seed, and filter outcome.
Keep a stable identifier across preprocessing so an auditor can join the raw and processed records. For byte-level matching, specify which representation was hashed. The line-ending example above gives two different SHA-256 values. If your unit is a near-duplicate group, keep its cluster ID and the mapping to member records.
Choose disclosure access according to the evidence readers need and the sensitivity of the records. A public report could give source categories, domain counts, dates, and licenses. An approved audit could provide hashes and document IDs. An internal system could retain raw documents, training order, and checkpoints. Before publishing URLs, inspect them for private identifiers and undisclosed paths. Give readers enough information to check the claim while controlling access to sensitive records.
Tailor disclosure to the audience. For example, a regulator could receive source categories and a process attestation. A researcher measuring memorization could use a controlled environment with document hashes and IDs. Give affected individuals a route to ask whether their material was included or to request removal.
Versioning is part of disclosure. A manifest for corpus version 1.2 does not describe version 1.3. Changing source-mixture weights changes the training protocol, even when the underlying sources overlap. The Dolma study illustrates this with 1B-model ablations across different proportions of the same source collection. Soldaini et al. (2024), figure 12 Attribution claims should always name the data version, model checkpoint, tokenizer, and preprocessing configuration. Without those, a claim may be true for one model and false for the next.
Influence Estimation: From Documentation to Evidence
Documentation tells us what data exists. Influence estimation asks how the model’s behavior would change if a training example were removed, downweighted, or added. Refitting on the changed data gives a direct comparison under a specified training protocol. At large model scales, repeating that refit for every training example can be prohibitively expensive. Some objectives admit exact deletion updates. In ridge least squares with a fixed positive penalty and the original sample divisor, the normal equations use the sum of feature outer products and the sum of features times their targets. Subtract the removed row’s contribution from each sum and solve the updated system with the same penalty. Guo et al. (2020), sections 3.1–3.2 derive a one-step Newton removal approximation for a convex linear-model loss with strongly convex L2 regularization. The step uses the remaining-data objective. Their gradient-residual bound also assumes a Lipschitz second derivative and bounded features and gradients.
The framing here is deliberately causal. Documentation is a statement about the contents of a dataset. Influence estimation is an attempt to answer a counterfactual question about the training process: what would have happened if this example had not been there? That question is well defined in principle and very expensive in practice. The rest of this section is about how far we can get with approximations, and what those approximations cost us.
The counterfactual question
Let the training set be , where each is an input-output pair or, for language modeling, a token sequence and its next-token targets. Define the empirical risk
where is the per-example loss and is an L2 regularization strength. Let
be the trained parameters. For a test example , define the test loss . The leave-one-out effect of training example is
where is the model retrained without example . A positive means removing the example increases test loss, so the example was helpful for this test point. A negative means removing the example decreases test loss, so the example was harmful for this test point.
It is worth dwelling on the direction of the inequality, because this is where most readers first get lost. The quantity compares two models: the model trained on the full data, and the same model retrained without example . If the test loss goes up when we remove the example, the full model was better at this test point because of that example, so we describe the example as helpful. If the test loss goes down when we remove the example, the example was actively hurting the full model at this test point, so we describe it as harmful. "Helpful" and "harmful" are always relative to a chosen test point and a chosen loss. The same example can be helpful for one test point and harmful for another, which is the target-specificity theme that runs through the whole chapter.
Directly evaluating by separate refits uses one optimization run per removed example. Influence functions approximate with gradients and a Hessian.
Repeated refits cost time, and training randomness can make their results hard to compare. Hold the training protocol fixed, pair the seeds where possible, and repeat the comparison if the target is an effect across training runs. Influence estimation uses a local linear approximation at the fitted model to estimate the effect of changing an example’s weight without another refit.
The influence function approximation
Set the weight of example to zero, leaving the original divisor and regularization strength fixed. This is the deletion convention used in the worked refits. Averaging over the remaining examples rescales the data term relative to the fixed penalty when ; if , the two objectives differ only by an overall positive scale.
At the trained parameters , the gradient of the full risk is zero:
Therefore the gradient of the leave-one-out risk at is
Let
be the Hessian of the regularized empirical risk at the optimum. Write , with the separate regularizer held fixed, and let be the stationary branch through at . Differentiating at zero gives there. The first-order response in , evaluated at , gives
In the approximation, removal displaces the parameters along the example gradient after preconditioning by the inverse Hessian. At a positive-definite optimum, gradient components along eigenvectors with small eigenvalues are amplified more.
The Hessian deserves an intuition, because it tends to appear as an opaque matrix. The Hessian describes curvature: how quickly the gradient changes as you move through parameter space. Along a Hessian eigenvector, the displacement needed to offset an added gradient component scales inversely with the corresponding positive eigenvalue. Small positive eigenvalues permit larger displacements for the same gradient component. Multiplying by is therefore a way of rescaling each gradient direction by how "stiff" the loss surface is there. In flat directions, the example's gradient has a lot of leverage. In stiff directions, it has little.
Now approximate the change in test loss:
The upweighting score differentiates the test loss along this stationary branch at , using the chain-rule construction from Koh and Liang (2017), section 2.1.
So
A positive predicts higher test loss under a sufficiently small upweighting of example . A negative value predicts lower test loss. The first-order removal estimate flips these signs. A finite deletion can move far enough that its direct refit has a different sign, even in a smooth convex example.
The reason this sign convention is so treacherous is that two natural questions point in opposite directions. "What happens to test loss if I remove this example?" and "What happens to test loss if I upweight this example?" point in opposite directions to first order. The size of the weight change is for removal from the objective above, so the derivative and estimated removal effect also differ by that factor. A table that lists "influence" without saying whether it is upweighting influence or leave-one-out effect is ambiguous to a reader who cannot see the code. The safest practice is to report the quantity you care about, state whether positive means helpful or harmful, and check the sign against a tiny worked case like the one later in this chapter.
The derivative assumes a smooth local branch near a stationary fit and a nonsingular Hessian there. Using it for deletion also assumes the local expansion stays accurate over the finite change. A smooth convex objective with a well-conditioned Hessian is a favorable setting. A nonconvex objective can have a suitable local minimum, but an SGD checkpoint may be far from stationary or have poorly conditioned curvature.
Practical approximations
Materializing a dense Hessian inverse is usually impractical for large models. For a model with parameters, a dense Hessian has entries. Practical methods avoid materializing it:
- Damping: replace with , where is a small positive scalar. For positive semidefinite , positive damping can improve conditioning. For indefinite , check the shifted spectrum before drawing that conclusion.
- Hessian-vector products: use automatic differentiation to compute without forming , then use an iterative linear solver. Use standard conjugate gradient for a fixed symmetric positive-definite system.
- Checkpoint gradients: TracInCP estimates influence using gradient dot products evaluated at saved model checkpoints.
- Random projections: project gradients into a lower-dimensional space before estimating influence. This is the strategy behind TRAK and related scalable methods.
- Model ensembles: train many models on different subsets and fit a surrogate from data inclusion to outputs. This is the datamodels approach.
- Retrieval and similarity: use embeddings, BM25, or exact matching to locate training examples that resemble the output. Use these matches to choose items for closer inspection.
Adding shifts every eigenvalue by . With an indefinite Hessian, a small shift can bring a negative eigenvalue closer to zero, making the inverse more sensitive. A shift larger than the magnitude of the most negative eigenvalue makes the matrix positive definite. Damping changes the inverse used by the estimator, and its signed dot products may increase or decrease in magnitude or change rank.
When the operator is symmetric positive definite, conjugate gradient approximates the solution of with one operator application per ordinary iteration. Automatic differentiation can compute each Hessian-vector product without storing the dense Hessian. A full-risk product may still require accumulating contributions from many batches. Keep the checkpoint, damping, and data defining the operator fixed across iterations, including when using a fixed subset to approximate the full-risk curvature. Changing the sampled batch can change the operator even when every batch Hessian is positive definite. When reporting a solve cost, specify the batches, differentiation implementation, operator conditioning, and residual tolerance.
TracInCP uses saved model parameters from the training trajectory. At each checkpoint, it computes the training-example and test-example loss gradients, takes their dot product, and weights it by the learning rate for the interval ending at that checkpoint. The sum approximates the training example’s contribution to reducing the test loss along the trajectory. In the original derivation, each example is visited once per interval and the learning rate is constant within the interval. The checkpoint approximation can also serve as a heuristic when those conditions fail. It uses first derivatives. Pruthi et al. (2020), section 3.3
TRAK projects model-output gradients into a smaller space before using them in its kernel calculation. With a suitable projection dimension, the sketch approximately preserves gradient inner products with high probability. Approximation error can change the order of scores that are close together. Park et al. (2023), section 3
A datamodel uses predictions from models trained on many subsets of a fixed dataset. It fits a surrogate that predicts the model’s output on a chosen target using only which examples the subset contains. You can use it to estimate the effect of adding a candidate from that fixed dataset to a subset or removing one from it. Accuracy depends on which subsets were sampled, how many fits were available, and the choice of surrogate. Ilyas et al. (2022), sections 2 and 3
Retrieval scores similarity. Given a model output, retrieve the most similar training documents and use the matches to prioritize inspection. An influence method estimates how a specified change to the training data affects a target. A causal attribution claim needs evidence from a training-data intervention.
Each approximation answers a slightly different question. Influence functions estimate a local parameter effect. TracIn estimates a path-dependent gradient alignment. Datamodels use many trained models to predict outcomes under different choices of training examples. Retrieval estimates similarity. Name the method and target in the report.
Variants and tradeoffs
| Method | What it estimates | Main cost | Strengths | Important limits |
|---|---|---|---|---|
| Influence functions | Local effect of upweighting an example on a target | Hessian-vector products | Grounded in a clear counterfactual | Requires suitable local curvature near a stationary fit; finite refits can disagree |
| TracIn | Gradient alignment across training checkpoints | Checkpoint storage and gradient computation | Uses training trajectory; no Hessian | Path-dependent; sensitive to checkpoint choice |
| Datamodels | Predicted effect of changing which examples from a fixed dataset are included in training | Many trained models | Can score subsets that were not among the surrogate’s training inputs | Expensive, and the surrogate’s accuracy can vary across interventions |
| TRAK | Scalable approximation to influence | Random projections and trained models | Designed for large models | Approximate; assumptions about model and target |
| Data Shapley | Fair credit allocation among training examples | Exponential exact cost; sampling approximations | Axiomatic fairness properties | Utility function choice changes the answer |
| Similarity search | Nearest training examples by embedding or lexical match | Building and querying an index | Retrieves candidates for inspection | Measures similarity |
| Ablation and retraining | Target change under the specified data intervention | Separate refits, which can be costly | Compare fits under the same training protocol | Repeat stochastic fits to estimate an average effect |
| Memorization and extraction tests | Whether an output reproduces training text | Prompt generation and matching | Direct evidence of overlap | Does not measure general influence |
Use the question to choose a method. Similarity search can give you candidates to inspect. A controlled ablation can measure what changes under a specified intervention.
Two rows deserve special comment because they are often confused. Data Shapley is appealing because it comes with fairness axioms: it credits examples according to their marginal contribution to a chosen utility function, and it satisfies properties like symmetry and additivity. The catch is that the utility function is a modeling choice. Two teams can run Data Shapley on the same corpus and get different rankings because they defined "utility" differently, and neither is wrong. A Shapley attribution is always an attribution with respect to a stated utility, not an attribution in the abstract.
Memorization tests ask whether a model can reproduce training text, for example when prompted with a prefix. Use the resulting match to report overlap. To measure an effect on wider behavior, choose a target for that behavior and run an intervention. A training example can affect a target without being memorized verbatim.
Worked Example: A Tiny Sentiment Classifier
To make influence estimation concrete, we will use a bag-of-words logistic regression classifier with a convex objective. Use this example to check the sign convention and see where a local approximation can disagree with a direct refit.
The choice of logistic regression is not accidental. The loss is convex, L2 provides positive curvature for the word weights, and the data provide positive curvature for the unpenalized intercept at finite fitted logits. This is precisely the regime in which the influence function derivation is on its firmest footing. If the approximation misbehaves even here, we would have reason to worry about the method in general. And if it behaves here, we get a clean baseline against which to interpret the messier deep-learning case.
Our training corpus contains short positive and negative movie reviews. The test sentence is "this movie is great." We will estimate the leave-one-out effect of each training document on the test loss. A positive effect means removing the document increases test loss, so the document is helpful for this test sentence. A negative effect means removing the document decreases test loss, so the document is harmful for this test sentence.
The positive test sentence contains both a sentiment cue, “great,” and common words such as “this” and “movie.” Two training reviews can overlap equally with the sentence while carrying opposite labels. The worked example measures whether each review lowers or raises loss on the chosen target.
Building the toy corpus
We start with a fixed vocabulary and binary bag-of-words features. Binary features keep the example simple and avoid count-scaling effects. We append a bias feature to every document vector.
PythonIn [2]Expand
import re
import pandas as pd
import torch
import torch.nn.functional as F
raw_docs = [
("i love this movie", 1),
("this movie is good", 1),
("i hate this movie", 0),
("this movie is boring", 0),
("great film love it", 1),
("bad film hate it", 0),
("wonderful story and great acting", 1),
("terrible story and bad acting", 0),
("i really love the acting", 1),
("i really hate the acting", 0),
]
def tokenize(text):
return re.findall(r"[a-z']+", text.lower())
vocab = sorted({token for text, _ in raw_docs for token in tokenize(text)})
word_to_idx = {word: i for i, word in enumerate(vocab)}
def vectorize(text):
features = torch.zeros(len(vocab), dtype=torch.float64)
for token in tokenize(text):
if token in word_to_idx:
features[word_to_idx[token]] = 1.0
return torch.cat([features, torch.ones(1, dtype=torch.float64)])
X = torch.stack([vectorize(text) for text, _ in raw_docs])
y = torch.tensor([float(label) for _, label in raw_docs], dtype=torch.float64)ConsoleOut [3]Expand
Vocabulary size: 19 Feature matrix shape: (10, 20) Positive examples: 5 Negative examples: 5
The feature matrix has one row per training document and one column per vocabulary item plus a bias column. The labels are binary: 1 for positive sentiment, 0 for negative sentiment. For a neural loss, the same local derivative requires a smooth stationary branch through the fitted point and a nonsingular risk Hessian there. Approximating the Hessian can change the numerical estimate.
One small detail matters for interpretation. The vectorize function appends a final column of ones, which is the bias. The bias is not tied to any token, so when we later regularize only the word weights, the bias remains free to absorb the base rate of positive versus negative labels. An example can still affect the fitted intercept even when it shares no words with the test sentence.
Training the classifier
We train with full-batch LBFGS and a small L2 penalty. Each step uses all ten reviews in this fixture. In larger runs, sources of variation can include minibatch sampling, shuffling, dropout where used, and nondeterministic numerical operations across devices.
Determinism is doing real work here. Each optimizer step uses the full dataset. With the same objective, initialization, optimizer settings, and numerical environment, repeated CPU runs of this fixture return the same scores. If we used stochastic minibatches, two runs could stop at different parameter estimates and produce different scores. The objective would still have the same unique minimizer if the loss, data, and penalty were held fixed. We are isolating the influence approximation from the optimization noise on purpose.
Key Parameters
The key parameters for this linear influence example are:
- L2: Strength of the L2 penalty on word weights. Logistic loss is convex. Positive L2 gives curvature to the word weights, and logistic loss gives the unregularized bias positive curvature at finite logits. Adding positive damping increases each Hessian eigenvalue.
- max_iter: Maximum LBFGS iterations. Enough iterations are needed to reach a converged optimum, which the influence approximation assumes.
- damping: Regularization added to the Hessian diagonal. A positive shift improves conditioning for the positive-definite Hessian used here and can change the magnitude or ordering of the signed scores.
- vocabulary: The vocabulary size plus one intercept coordinate sets the size of the parameter vector and Hessian. Each review uses a binary bag-of-words representation.
L2 shrinks the word weights. A smaller penalty can leave little curvature in low-variance directions, while a larger penalty can suppress useful coefficients. max_iter limits the optimizer’s work. Check the reported gradient norm because the derivation assumes a stationary fit. Damping changes the linear system and its conditioning, and the vocabulary sets the feature dimension. For an attribution report, name the corresponding choices and give the diagnostics you used to check them.
PythonIn [4]Expand
L2 = 0.1
def total_loss(theta):
logits = X @ theta
data_loss = F.binary_cross_entropy_with_logits(logits, y, reduction="mean")
reg = 0.5 * L2 * torch.sum(theta[:-1] ** 2)
return data_loss + reg
def per_example_loss(theta, x, target):
logit = torch.dot(theta, x)
return F.binary_cross_entropy_with_logits(logit, target, reduction="sum")
theta = torch.zeros(X.shape[1], dtype=torch.float64, requires_grad=True)
optimizer = torch.optim.LBFGS(
[theta],
lr=1.0,
max_iter=300,
line_search_fn="strong_wolfe",
)
def closure():
optimizer.zero_grad()
loss = total_loss(theta)
loss.backward()
return loss
optimizer.step(closure)ConsoleOut [5]Expand
Final training loss: 0.4874 Training gradient norm: 2.10e-06
The model has now learned a linear decision boundary. The L2 penalty contributes a diagonal matrix with on each word-weight coordinate and zero on the intercept coordinate. The damping shift adds 0.001 to every diagonal entry, including the intercept. The undamped objective is convex and the damped Hessian is positive definite.
The loss reports the fitted objective. The gradient norm checks how close the fit is to a stationary point, which is the condition used in the derivation.
Computing influence on the test sentence
We now compute the gradient of the test loss, the Hessian of the training objective, and the gradient of each training example's loss. The influence of upweighting example on the test loss is the negative dot product of the training gradient with times the test gradient. After damping the Hessian, we estimate the leave-one-out effect by dividing by the number of training examples and flipping the sign.
The code below performs three computations in sequence. First, it computes the gradient of the test loss with respect to the parameters; this is the direction in which the test loss changes as the parameters move. Second, it computes the Hessian of the full regularized training objective and adds a small damping term. Third, it solves the damped system once, which means each training example's influence is a single dot product rather than a separate matrix inversion. This is the same trick that makes Hessian-vector-product methods feasible in larger models: solve for a vector once, then reuse it.
PythonIn [6]Expand
x_test = vectorize("this movie is great")
y_test = torch.tensor(1.0, dtype=torch.float64)
grad_test = torch.autograd.grad(per_example_loss(theta, x_test, y_test), theta)[
0
]
H = torch.autograd.functional.hessian(total_loss, theta)
damping = 1e-3
H_damped = H + damping * torch.eye(H.shape[0], dtype=torch.float64)
# Solve the damped system once and reuse its solution for each example.
v = torch.linalg.solve(H_damped, grad_test)
grad_train = torch.stack(
[
torch.autograd.grad(per_example_loss(theta, X[i], y[i]), theta)[0]
for i in range(len(raw_docs))
]
)
# Effect of upweighting a training example on the test loss.
influence_up = -(grad_train @ v)
# Approximate change in test loss if the example is removed.
loo_effect = -influence_up / len(raw_docs)PythonIn [7]Expand
influence_df = pd.DataFrame(
{
"document": [text for text, _ in raw_docs],
"label": [
"positive" if label == 1 else "negative" for _, label in raw_docs
],
"influence_up": influence_up.detach().numpy(),
"loo_effect": loo_effect.detach().numpy(),
}
).sort_values("loo_effect", ascending=False)ConsoleOut [8]Expand
Most helpful for this test sentence (removal increases loss):
document label loo_effect
this movie is good positive 0.165365
wonderful story and great acting positive 0.072263
i love this movie positive 0.056143
great film love it positive 0.055221
Most harmful for this test sentence (removal decreases loss):
document label loo_effect
i really love the acting positive -0.009122
i hate this movie negative -0.064995
this movie is boring negative -0.165365Read the table by sign. Removing a review with positive estimated effect raises the positive test sentence's loss. Removing a review with negative estimated effect lowers it.
“This movie is good” and “this movie is boring” share three of their four tokens with the test sentence and have opposite estimated effects. The labels differ while the overlap score is identical.
Use the next figure to compare lexical overlap with estimated influence. It plots token-set Jaccard overlap against the same leave-one-out effects used above. It includes all ten training reviews, including ties.
VisualizationOut [10]Expand

Read 0.02 as an estimated change in loss under the local approximation, in the units of the loss function. In the comparison below, inspect ranking agreement and agreement in effect size separately.
The next comparison refits the classifier ten times, once for each removed review, and compares the numerical test-loss change with the damped influence estimate. Each direct refit keeps the original divisor of ten, vocabulary, L2 penalty, zero initialization, and optimizer settings. The refit values are subject to numerical convergence tolerance.
VisualizationOut [12]Expand

In this example the two methods agree on the sign for all ten reviews. Their Spearman rank correlation is about 0.988. The “this movie is good” review shows why rank agreement does not establish magnitude agreement. Its estimated removal effect is about 0.165 in test-loss units, compared with 0.373 after refitting.
Visualizing the ranking
The following figure ranks the training documents by their estimated leave-one-out effect. Positive bars are helpful for the test sentence; negative bars are harmful. The figure uses the model's precomputed influence values. It does not retrain the model.
Plotting the ranking rather than reading it from a table makes the target-specificity visible at a glance. The bars fan out from zero, and the ordering is a claim about which documents the model would miss if they were gone. Because the figure is generated from the same precomputed scores as the table, it does not add any new evidence by itself. Its value is in communication: a reader who will not parse a column of numbers will often read a bar chart correctly.
VisualizationOut [13]Expand

The chart ranks the reviews for the positive test sentence. The estimate for “i really hate the acting” is about +0.00027 loss units, which is barely visible at this scale. For a target-sensitivity check, use the negative review “this movie is boring,” one of the training rows. Recompute its target loss and gradient and reuse the fitted model and training Hessian. In this fixture, the two score rankings have a Spearman correlation of about −0.903.
Attribution Limits and Practical Impact
An influence estimate depends on the target, model, data version, and approximation.
The influence derivative describes a smooth local change around a stationary fit. Using it for finite deletion requires the local approximation to stay accurate over that change. A large language model’s checkpoint may sit away from a stationary point, and a single Hessian may capture curvature poorly away from that point.
Local approximations in a nonconvex world
The influence formula uses local curvature. A transformer’s high-dimensional Hessian can have negative eigenvalues, and data order, batch composition, dropout, and hardware nondeterminism can affect the final checkpoint. A stopped checkpoint need not minimize the empirical risk. Before using the formula, check whether stationarity and the curvature approximation are reasonable for the chosen checkpoint.
A simple example makes the basin issue precise. At zero perturbation, the objective has two equally good minima. Adding favors the left basin for a small positive and the right basin for a small negative . Both local minima vary smoothly near zero. A derivative along one branch describes that branch, and a full refit may choose the other.
Check the sensitivity of a deep-network influence ranking to the checkpoint, seed, and damping. Basu et al. (2021) found that accuracy varied with network architecture and regularization in their experiments. If an important decision depends on a ranking, record how much it changes and compare it with a controlled refit where feasible.
Inspect examples with unusually large influence scores. For example, with an identity Hessian and a unit test gradient, a training gradient of magnitude ten along that direction contributes ten times as much to the score as an aligned gradient of magnitude one. A perpendicular gradient contributes zero in both cases. In a corpus with repeated documents, record exposure counts before interpreting a score as evidence about a particular copy.
For a small sanity check, plant a label error and measure its removal effect with a direct refit under the same protocol and target loss. Then compare the estimator with that measured effect. A mislabeled document can still help a particular target, and a clean document can have a large effect. The refit gives the expected sign for the chosen case.
The unit of attribution is ambiguous
Choose the attribution unit before running the method. In the derivation above, the perturbation changes the weight of one indexed loss term. In language modeling, that unit can be a packed sequence with fragments from different documents. Keep the mapping to the original documents if you plan to interpret sequence-level results at the document level.
Choose the target with the same care. In the toy example, changing the test sentence and its label changes the review ranking. If you want to assess style, content, or the recall of a particular fact, choose an evaluation target for that behavior. Keep a loss-based claim bounded to the target, and use the relevant records to assess authorship.
Benchmark exposure and its effect on evaluation are separate questions. A verified exact or near-duplicate match in the fitted training data is evidence of exposure. To estimate the change in benchmark score, specify an intervention. You can use a benchmark item as the evaluation target for removing a separate, confirmed training record. An estimate for removing the benchmark item itself presupposes its inclusion. For a candidate of unknown membership, an addition-sensitivity score represents a hypothetical intervention. Check actual inclusion separately using provenance or training records.
Ask first whether the material was present in the training data, which can sometimes be checked with exact or near-duplicate matching. Then ask whether its inclusion changed the chosen target. Test the second question with evidence about the intervention and its outcome.
Duplicates, aggregates, and missing sources
Near-duplicates complicate the attribution unit. Deduplication can reduce the number of retained copies, with the result depending on the method and scope. Suppose a fact appears in a hundred near-identical pages and ten versions survive preprocessing. Inspect the cluster assignments before treating a single highly ranked copy as distinct evidence about the content.
Name the intervention unit in the report. A claim about removing a whole cluster concerns a different set of records from a claim about removing a single member. Keep the membership map so an auditor can reproduce the intervention.
Distinguish the exposure history from the current disclosure. If a record was removed after training, check an archived manifest for the relevant version. When ranking a fixed index, report the candidate set. A search restricted to that set gives evidence about the records it could retrieve.
This is also why "the model learned X from Y" is usually too strong. A more accurate claim is "Y is one of the sources present in the training mix, and under method M it is estimated to have a positive influence on behavior X for prompt P." That sentence is less satisfying, but it is closer to what the evidence supports.
Privacy, security, and legal boundaries
Review training records for sensitive content before release. Start with aggregates when they answer the question. For an approved audit that requires item-level evidence, restrict access and record exactly which documents or identifiers were released.
Suppose a URL manifest lists the address of a page that once contained sensitive text. Trace the address to the retrieved version, the preprocessing result, and the packed training unit. To say that the text was used to train a particular checkpoint, check loader logs or equivalent run records showing that the run consumed that unit before reaching the checkpoint. Share item-level records only when the question requires them.
Use the statistical result for its stated target. For questions about copying, authorship, licensing, or consent, check the relevant documents and obtain legal advice where needed. Record documentary and legal conclusions separately from model influence scores.
When a claim concerns a person, community, or author, use the attribution result to inform the relevant review. Bring questions about consent, compensation, and community governance to the processes that can address them. Data Audits and Release Governance returns to the evidence needed for release decisions.
Versioning and synthetic data
Record the checkpoint, tokenizer, data manifest, training mixture, and decoding configuration. If you change the training data, recompute the ranking before carrying it forward. When comparing tokenizers or decoding settings, check how the changes affect the input sequence or output.
The tokenizer point surprises people. Two models trained on the same raw text but with different tokenizers see different sequences, different context boundaries, and sometimes different effective document lengths. The same passage can fit a fixed token budget under one tokenization and exceed it under another. The model and preprocessing set the budget and determine whether excess tokens are truncated. For attribution, this means that "the same document" can be a different training example in two otherwise similar models.
For synthetic data, record the link from the evaluated output to the synthetic example, the link from the example to its generator, and any available records for the generator’s training data. State what you can verify for each link. Preserve mappings through filtering, rewriting, and mixing so a later audit can follow those transformations. Synthetic Data Pipelines examines how this lineage is recorded. Recursive Training and Model Collapse examines what changes when generated data enters later generations.
What attribution can support
Attribution is most useful when it is matched to a decision. The following table gives some examples.
| Use case | Appropriate evidence | What is not enough |
|---|---|---|
| Data audit | Influence estimates plus source manifests plus retrieval | A single top-1 influence score |
| Contamination check | Exact match, near-duplicate match, benchmark hashes | Semantic similarity alone |
| Debugging a bad output | Influence ranking plus small-scale ablation | Influence ranking alone for high-stakes action |
| License and consent triage | Source manifest plus license metadata plus legal review | An influence score |
| Public explanation | Tiered claim plus method plus uncertainty | "The model learned X from Y" |
| Legal analysis | Legal analysis plus documentary evidence | Technical influence alone |
Build a chain of evidence that fits the decision. Use data statements for context, manifests for traceability, indices for mapping, and influence scores for prioritization. To check a proposed counterfactual, run the corresponding ablation under a specified training protocol. Record the data version so a reader can identify which run the result describes.
Choose reviewers whose expertise fits the claim. A data auditor can check the statistical result, a legal reviewer can examine the relevant rights, a privacy reviewer can assess disclosure risk, and a communications lead can make sure the public wording reflects the evidence.
Communicating Uncertainty
State the target, method, scope, and uncertainty. Damping alone can change the sign of a score. For example, take Hessian diagonal entries 1 and 4, test gradient , and example gradient . Their inverse-Hessian dot product is with zero damping and with damping of one.
Choose precision after checking stability across the settings relevant to the claim. If plausible settings give both signs, report that uncertainty. If the sign holds but the magnitude varies, report a range and round to a precision the checks support.
Claim tiers
Use the table to match each claim with the evidence it needs. The first three rows concern declared corpus composition, text overlap, and similarity. For causal questions, an influence estimate can guide a controlled intervention, and replication can test whether the measured effect recurs.
| Tier | Claim | Typical evidence | Appropriate language |
|---|---|---|---|
| 0 | A source category is listed in the declared mixture | Data statement, versioned manifest | “The declared mixture lists web text from these categories.” |
| 1 | A training document is an exact or near-duplicate of an output span | Hash match, MinHash, suffix match | "A near-duplicate of this span was found in the training data." |
| 2 | A training document is similar to the output or prompt | Embedding similarity, BM25, lexical overlap | "The output is similar to this document; similarity is not causation." |
| 3 | A training document is estimated to influence a target | Influence function, TracIn, TRAK | "Under method M at checkpoint C, this document is estimated to..." |
| 4 | Removing a document or cluster changes the behavior | Ablation, retraining | "Removing the cluster changed the behavior in this experiment." |
| 5 | The effect replicates across models, seeds, or data versions | Repeated ablations, multi-model studies | "The effect replicated across three seeds and two checkpoints." |
Use the tier to bound the wording. Describe the measured target when reporting an ablation, and list the models, checkpoints, or seeds in a replication. A reader can then see which settings were tested.
When writing a claim, choose wording that matches its evidence. For example, describe a near-duplicate match as overlap. Reserve a statement about an effect of removal for a comparison that tests removal.
A reporting checklist
An attribution report should include enough context for a reader to evaluate the claim:
- Claim: What exactly is being claimed, in one sentence?
- Target: Which output, prompt, behavior, benchmark item, or capability?
- Model: Which model, checkpoint, and decoding configuration?
- Data: Which data version, manifest, and preprocessing pipeline?
- Tokenizer: Which tokenizer and special-token configuration?
- Method: Influence function, TracIn, TRAK, datamodels, ablation, retrieval, or a combination?
- Hyperparameters: Damping, regularization, checkpoint selection, random projections, and sample sizes.
- Uncertainty: Rank stability, seed variation, sensitivity to method choices, and known failure modes.
- Limitations: What the method cannot establish, including legal and privacy limits.
- Review: Who reviewed the claim for privacy, security, and legal risk?
- Contact: Who can answer follow-up questions or receive correction requests?
Use this checklist before sharing an attribution report. Fill in the fields needed to interpret and reproduce the claim.
Use missing fields to guide the next check. Identify the target so the direction of effect is interpretable. Record the hyperparameters that affect the computation, such as damping in the example above.
Language for uncertainty
Compare the claims in each pair.
-
Too strong: "The model copied this fact from Document X."
-
Better: "Document X contains a near-duplicate of the output span. This is evidence of overlap, but it does not establish that the model copied the fact from this document rather than from other sources."
-
Too strong: "This training example caused the model to learn the bias."
-
Better: “Under an influence-function approximation at checkpoint C, removing this example is estimated to increase next-token loss on the target continuation. The estimate has yet to be checked with a direct refit and may differ at another checkpoint.”
-
Too strong: "The model was trained on this author's work."
-
Better: "The source manifest lists a work by this author in the training mix. The manifest does not establish that the model reproduces the work or that the work influenced a particular output."
These statements distinguish presence, similarity, influence, and causation. They also leave room for correction.
Uncertainty also comes from decoding. With stochastic decoding, different draws can produce different outputs for the same prompt. Temperature and top-p control a sampling distribution, and a seed controls the pseudorandom draws. Specify the decoding settings and seed policy, and evaluate a distribution of outputs when feasible. A claim that is true for one sample may be false for the next.
A useful habit is to phrase attribution claims as conditionals that name their conditions. "If the decoding configuration was the one reported, and if the data version matches the manifest, then under method M the document is estimated to..." This sounds cumbersome, but it makes the claim much harder to misread, because it names the assumptions that would have to be true for the claim to hold. Readers who cannot verify those assumptions will at least know what to ask about.
Summary
Attribution and training-data transparency are not a single tool. They are a stack of evidence:
- Data statements document the corpus context, collection process, limitations, and known gaps.
- Source manifests make individual components traceable through URLs, hashes, licenses, and preprocessing records.
- Example indices connect training items to documents, deduplication clusters, and token spans.
- Influence functions estimate local changes for a specified training perturbation and evaluation target.
- Ablation and replication test a specified intervention and check whether its effect recurs under stated conditions.
- Uncertainty communication keeps claims proportional to the evidence.
State the target and method in the conclusion. For the toy classifier, a change of target alters the estimated ranking. Report overlap as overlap, and use the corresponding license record for a claim about permission.
Quiz
Ready to test your understanding? Take this quick quiz to reinforce what you've learned about attribution and training-data transparency.
Attribution and Training-Data Transparency
Join the discussionAsk a question or share what you learned.
Keep exploring
Reference
Citation details
Cite or share this article.


Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!