Elamur Research

Layered Insights: Generalizable Analysis of Human Authorial Style by Leveraging All Transformer Layers

Paper · 2025 · Milad Alshomary, Nikhil Reddy Varimalla, Vishal Anand et al.

Summary

A system trained to recognize writers from product reviews may later have to judge writing from an online discussion or a work of fiction. People can change their vocabulary, sentence structure, and ways of organizing ideas when they write for a different purpose. A comparison that worked well on reviews may therefore lose some of its value on comments or stories. Layered Insights asks whether an authorship system can make the transition more successfully by drawing on several stages of text processing. The task is to score pairs of writing collections. Each collection contains material by a single author, and the score is used to rank candidates for a match. The ability to make useful comparisons on unfamiliar writing matters in settings such as forensic investigation and intellectual property.

The authors develop LIGHT, an approach that gives an authorship system access to the starting token vectors as well as the output of each successive Transformer layer. The systems they extend ordinarily derive their comparisons from the encoder’s last layer. LIGHT trains a separate representation at each depth. Within each representation, the training objective favors proximity between samples by the same person and separation between samples by different people. To evaluate new writing, the system makes a comparison at each depth and combines the resulting scores. The writing can thus contribute different kinds of evidence to the ranking, and the experimenters can examine how the ranking changes when they omit one of those scores.

The authors test LIGHT with LUAR and Wegmann, using RoBERTa and ModernBERT as encoders and drawing on Reddit comments, Amazon reviews, and Fanfiction stories. They report an improvement over the corresponding original system in 15 out of 16 settings where training and testing use different domains. With RoBERTa and Fanfiction training, LUAR obtains 9.49 mean reciprocal rank on Reddit, while LIGHT-LUAR obtains 14.32. This metric rewards rankings that place the first correct candidate nearer the top. Results within the training domain are mixed. RoBERTa-based LIGHT-LUAR reaches 72.65 mean reciprocal rank on the Amazon in-domain test, compared with 68.99 for LUAR, whereas LUAR leads the corresponding in-domain comparison on Reddit.

The analysis helps explain why the choice of depth matters. Linguistic tests recover different properties most successfully from different projected layers. In the ranking experiments, earlier scores often help on a new domain and later scores tend to be more useful on familiar writing. The Fanfiction-trained system illustrates the tradeoff: some early scores help it find authors on Reddit and Amazon, while omitting those scores improves recall on Fanfiction. The results show that a representation’s value can depend on where the authorship comparison is used, even when the training and all the other parts of the fitted system stay the same.

Deep dive: Layered Insights: Generalizable Analysis of Human Authorial Style by Leveraging All Transformer Layers

Layered Insights tests whether comparing writing at every Transformer layer improves authorship rankings when the training and test genres differ. · about 35 minutes to read

The problem and its context

Matching collections of writing

The paper treats authorship as a problem of comparing collections. A query collection is set against a candidate collection, and the system assigns a score to the pair. The writing within each collection comes from a single person. The unknown relationship is between the collections: did the same person write both? The scores allow the system to rank the candidates for a given query. In evaluation, the experimenters know which author is correct and can assess where that author appears in the ranking.

This formulation gives the system several opportunities to notice habits that might be hard to see in an isolated sentence. A writer may have a favorite way of qualifying a statement, linking clauses, or signaling a shift to a new point. Any particular sample might contain few instances of those choices. With a collection, evidence can accumulate across passages. The useful unit for comparison is still a body of writing, even though different passages in it can supply different clues.

What a writer does repeatedly depends in part on what the setting calls for. A product review invites evaluation of an item. A discussion comment can be a response to an earlier turn. A story may organize its language around narration or dialogue. These are examples of why the paper describes its corpora as different domains: the texts come from sources with different purposes, levels of formality, and degrees of consistency in their writing. An authorship procedure trained in one domain learns under the conditions that source provides.

Subject matter creates a related problem. Several people responding to the same discussion can use similar words because the discussion gives them a shared vocabulary. A single person writing about different subjects can use noticeably different words. A learned association between a term and a writer can therefore look helpful in a training collection and work poorly elsewhere. Researchers need ways to establish whether a similarity score remains useful when the conditions that made such associations available change.

In the paper’s transfer experiments, this change happens between training and evaluation. A system can learn how to compare collections using authors in a fiction corpus, then be asked to rank candidates using collections of comments. The test pairs in that example come from the comment corpus. The experiment asks whether a comparison learned from one sort of writing works on another. Tracing a particular author across both sources would pose a different question about how well a score connects writings that straddle the domain boundary.

The distinction has practical consequences for the applications the authors mention. A forensic investigation or an intellectual-property dispute can involve writing that differs from the material on which a comparison method was developed. A successful in-domain test establishes that a system can rank authors under familiar conditions. Changing the source of the test writing examines how much of that ranking ability survives a change in conditions. The paper investigates a design choice that might make the latter result stronger.

Specifying stylistic features and learning them from examples

Earlier approaches described in the paper often start with measurable features chosen by researchers. Function-word frequencies are an example. Grammatical words can recur across subjects, so their distribution offers a way to compare writers even when the content differs. Recurring sentence patterns offer another possibility. They correspond to choices about how a writer puts phrases and clauses together, a concern of syntax. The field also developed datasets on which to test whether such features support attribution.

A learned representation changes where these choices are made. Rather than deciding in advance which features to count, a system can transform text into a vector and learn from examples of author relationships. Such a vector is often called an embedding. Its coordinates provide a way to measure proximity between writings, and their arrangement is shaped by the task used for training. In the account of LUAR given by the authors, examples from a common writer teach the system which writings should occupy nearby regions of the representation space.

Wegmann makes the training examples more demanding in a particular way. Comparing a sentence about one subject with a sentence about a wholly unrelated subject can give a system an easy route to telling them apart. The route may have little to do with the people who wrote them. Wegmann selects some different-author comparisons to be topically close, so success requires finding distinctions that survive the overlap in subject matter. Reddit’s subreddit information makes it possible to construct such examples in the study.

These approaches already address different parts of the authorship problem. LUAR extracts evidence from several passages before representing a collection. Wegmann uses thematic proximity to make training comparisons harder. In both, the Transformer’s final output supplies the input to the authorship representation. The difference LIGHT introduces concerns where in the encoder that information is taken. It can be applied while keeping the two systems’ different ways of constructing the learning task.

The paper also compares its proposal with classical stylometry at a more general level. Manually specified stylistic features and learned embeddings can both reflect regularities in how people write. With specified features, the researcher can identify the measurement in advance, such as a frequency or a grammatical pattern. A learned representation can carry information about several such regularities together. To discover what it offers, the researchers have to inspect it after training or measure how its participation affects the comparison.

What changes from one depth to another

A Transformer builds successive representations of the same input. It starts with numerical representations of tokens and transforms them as they pass through a stack of blocks. An intermediate output is a usable record of how the input is represented at that point. The last output has passed through the entire stack. Since each block works from earlier information, the final state can draw on the input through a long series of transformations. The paper’s question is whether every distinction useful for author comparison remains equally easy to extract at the end of that series. The architecture comes from Attention Is All You Need.

The prior work discussed by the authors gives reasons to expect variation. Early representations can make wording or surface patterns accessible. Other depths can be useful for grammatical structure, meaning, or information connected to the training task. The precise distribution depends on the property and on what the encoder has been trained to do. The cited review gives a broader account of this specialization in A Primer in BERTology.

The paper also discusses layer analysis in question answering. The research it cites examines how different stages contribute to extracting what a question requires. Another cited study considers tasks for which only a subset of depths is needed. Together these accounts motivate treating the choice of layer as an empirical question. The stage that makes one property accessible may have a different role in a task that calls for other evidence.

For authorship, potentially useful regularities extend from word choice to sentence construction and longer patterns of organization. A writer’s use of particular expressions may be revealing in one comparison. Another pair may be more informative about how the writer structures sentences or develops a point. These longer patterns are among the concerns of discourse analysis. The authors’ hypothesis is that a procedure that can draw on these different scales will make better comparisons when familiar cues become less reliable.

This hypothesis concerns both what the encoder represents and what the authorship task can use. Information may be present in a layer in a form that a suitable test can recover. A separate question is whether exposing that layer to authorship supervision produces a useful comparison. LIGHT builds a mechanism for training such comparisons, then allows the authors to inspect the information available at different depths and measure the consequences of using their scores.

The method, step by step

From tokens to several authorship views

The encoder begins with tokens, the units it accepts as input. A token can be a word or a piece of a word, depending on how the input is segmented. Each token receives an initial numerical representation. Subsequent blocks operate on the sequence of representations and produce updated vectors for its positions. The set of vectors produced at a stage is its hidden state. This is the sequence of operations that follows tokenization.

LIGHT accesses the initial vectors and the hidden states along the stack. In the general design, a separate feed-forward projection transforms the output available at each depth. The projection is a learned mapping into a space in which the system can represent and compare writings. Each mapping has its own output, while the projections share the same underlying encoder. As a result, the system can describe a writing collection at several depths without fitting a separate encoder for each description.

The initial representations are a distinct source of information. A direct comparison there can make use of what is accessible before the Transformer blocks have successively transformed the input. In the distilled RoBERTa implementation of LIGHT-LUAR, the authors call the corresponding projection Layer 0. Layers 1 to 6 refer to projections from the outputs of the encoder blocks. The word “layer” in the evaluation can thus refer to a projected authorship view, including the view from the input embeddings.

The authors keep these outputs separate long enough to make individual comparisons. A candidate may resemble a query strongly according to the initial projection and weakly according to a later projection. Another candidate may receive the reverse pattern of scores. Keeping the separate representations makes the pattern visible and gives the system a way to combine the evidence after it has compared the writings. It also gives the authors a direct intervention for their analysis: they can leave a particular comparison out of the aggregate.

How LIGHT learns and applies authorship comparisons

The steps in order.

How LIGHT learns and applies authorship comparisonsStep 1: Break the writing into tokens1. Break the writing into tokensStep 2: Collect initial embeddings and every block output2. Collect initial embeddings and every block outputStep 3: Form separate authorship representations at each depth3. Form separate authorship representations at each depthStep 4: Evaluate the training objective at each depth4. Evaluate the training objective at each depthStep 5: Average losses and update the trainable parameters5. Average losses and update the trainable parametersStep 6: Compare query and candidate representations by depth6. Compare query and candidate representations by depthStep 7: Combine similarities to rank candidate matches7. Combine similarities to rank candidate matches

Training several representations together

The supervision is contrastive. Known author relationships tell the system which writings to bring closer in its comparison space. Writing by the same author supplies a positive relationship. Writing by different authors supplies a negative one. The training loss measures how far the current representation falls short of its objective on such examples. A smaller loss means the representation better satisfies that objective for the training comparison.

For a conventional final-layer version, the authorship objective acts on the representation made available at the top. LIGHT places an objective at every projected output. If a pair is easy to classify at the final depth and difficult to distinguish near the input, the early representation can still incur a loss. Each projection thus receives direct supervision for authorship, including projections whose underlying states are also used to compute subsequent states.

The paper describes averaging these losses across the starting view and the output views. The operation can be written as follows.

J = (∑ᵢ₌₀ᴺ Jᵢ) / (N + 1)

Here J is the loss used for the joint update. Jᵢ is the authorship loss for the representation at depth i. The summation sign ∑ adds the losses for all i from 0, the initial token embeddings, through N, the output of the final Transformer block. N counts the blocks. The division by N + 1 makes the result an average, counting the input projection alongside those attached to block outputs.

The combined loss is propagated backward through the computations that produced it. The resulting training signal adjusts the parameters of the projections and the shared encoder. An early block contributes both to the representation taken directly from its output and to the computations of blocks above it. Losses at several depths can therefore affect the parameters of that early block. A projected early representation measured after training reflects the full training arrangement, including supervision applied farther up the encoder.

Averaging puts every projected loss into the training objective. That choice alone gives little basis for predicting which score will be useful in a later ranking. Some views may agree on most candidates. Other views may especially help with pairs that are hard to distinguish from the final output. The ranking experiments and ablations examine the results of this training procedure after the representations have been learned.

LUAR and the evidence from several passages

LUAR constructs an embedding for a collection by starting with short excerpts. The encoder supplies a representation for each excerpt. Max pooling retains the peak activation of each feature it pools, while attention helps combine information from different excerpts. The output is a collection vector that can be compared with the vector for another author’s writing. This is the level at which known author relationships provide the objective for ordinary LUAR.

There are separate axes along which this procedure gathers evidence. Across passages, it can use several examples of the writer’s language to form a representation of the collection. Across depths, it can use several stages of processing to represent the information in those passages. LIGHT extends the latter part by taking the initial and intermediate states as well as the final one and training the projected outputs. The ordinary LUAR baseline uses the final encoder state for the passage representations it aggregates.

The RoBERTa implementation starts from the paraphrase-distilroberta checkpoint. The appendix reports 82.5M parameters for this base in the LUAR experiments. The authors train separately on each domain for 20 epochs, with validation every five epochs. A validation check evaluates the system during training on separate data. The batch size is 84. Per author, the procedure samples 16 excerpts, each containing 32 tokens. The authors use the default LUAR settings and report little benefit from training past their chosen schedule. The encoder and its lineage are described in RoBERTa and DistilBERT.

The ModernBERT version uses a base reported at 149M parameters. It trains for 30 epochs and keeps the same validation interval. It uses 32 excerpts per author and retains the paper length of 32 tokens. The base encoder is described as supporting contexts of up to 8k tokens. The fixed excerpt length and the number of excerpts specify how the authors actually supply writing to the LUAR procedure. The maximum supported context describes a capability of the encoder. ModernBERT

The LUAR implementation also uses a memory-saving attention procedure. Attention uses queries and keys to compute how positions should draw on information from values. Computing all of these relationships together involves storing a large matrix. The implementation divides queries and key–value entries into chunks, with a reported size of 32 for each type. It processes partial results and normalizes after combining them. Subtracting the maximum log value before exponentiation keeps the calculation numerically stable. The appendix characterizes the running time of the attention procedure as follows.

O(n²)

Here O expresses how the cost grows with input size, n is the sequence length, and the superscript ² denotes a square. The expression describes quadratic growth in the work of the attention calculation. The appendix describes the memory complexity of the chunked procedure with a separate expression.

O(log n)

Here O again describes an order of growth, n is the sequence length, and log denotes a logarithm. This is the paper’s characterization of the memory cost of the attention procedure. The implementation further reduces the need to hold intermediate values in memory through activation checkpointing. With checkpointing, selected values are computed again when the update procedure needs them.

The authors report LUAR training on an NVIDIA A100 with 40GB of memory. For RoBERTa, an epoch takes roughly 1 hour on Reddit, 11 minutes on Fanfiction, and 5 minutes on Amazon. With the ModernBERT configuration, the corresponding reported times are approximately 4 hours, 1 hour 10 minutes, and 12 minutes. These figures describe training under the paper’s configurations, which differ in the encoder and in the amount of writing sampled per author. They give a sense of the resources involved in testing the design on the different corpora.

Wegmann and the choice of a difficult comparison

Wegmann’s training unit is a triplet. Its anchor is the sentence used as the point of comparison. The positive comes from the same writer. The negative comes from another writer and is chosen to be close in subject matter. The use of a related subject gives the negative a plausible reason to resemble the anchor. The objective rewards a representation when it places the anchor closer to the positive even under that condition.

The authors draw on Reddit’s subreddit metadata to construct such comparisons. This metadata gives them a way of identifying texts with related content when building the training data. The Amazon and Fanfiction data used in the paper lack the corresponding topical information required by this sampling procedure. For that reason, the reported Wegmann experiments train on Reddit and apply the resulting comparison to all the test corpora.

The ordinary Wegmann variant uses the final state of the special [CLS] token to represent a sentence. This is a token whose state serves as a sentence-level vector for the comparison. The appendix describes the LIGHT implementation as exposing the encoder’s intermediate hidden states and using the [CLS] representation at each included depth. Thus Wegmann and LUAR supply different units for their training objectives, but in both cases LIGHT adds supervision across depths. The sentence representation follows the framework of Sentence-BERT.

For each triplet, the authors give the following layer-averaged objective.

(1 / L) ∑ℓ₌₁ᴸ max(0, d_cos(aℓ, pℓ) − d_cos(aℓ, nℓ) + m)

L is the number of depths included in this objective. The index ℓ labels a depth, and ∑ sums the resulting terms for ℓ from 1 through L. The multiplier 1 / L takes their average. The symbols aℓ, pℓ, and nℓ refer to the [CLS] vectors for the anchor, positive, and negative at depth ℓ. The function d_cos measures cosine distance, a distance based on the directions of the vectors. The margin m is set to 0.5. For each depth, max takes the larger of 0 and the positive distance minus the negative distance plus that margin.

If the negative lies sufficiently farther from the anchor than the positive does, the term inside max falls to 0 or below, and the contribution from that depth is 0. If the two distances are too close, the loss is positive even if the positive is already the nearer sentence. The margin is the amount of separation the objective asks for. Taking the maximum at each depth means that a successful comparison at one depth leaves an unsuccessful comparison at another depth visible in the loss.

The main experimental account describes 58k Reddit triplets, a batch size of 24, and training for 20 epochs with either encoder. The appendix describes training with 59k Reddit-MUD triplets and 210k Wegmann conversation triplets, plus early stopping with a threshold of 10⁻⁴ and a patience of 3 epochs. It reports typical convergence within 9 epochs in that account. The descriptions give different details about training. The results identify Reddit as the source for the Wegmann runs, while the paper leaves the mapping between the appendix’s training configurations and the main results unspecified.

Turning comparisons into a ranking

At evaluation time, the authorship procedure can compute a similarity independently for corresponding representations of the query and candidate. The paper describes these layer comparisons in terms of cosine similarity. Two vectors pointing in similar directions get a higher score. Since the comparison concerns direction, the length of a vector by itself does not make the pair more similar. The system combines the layer scores and uses the resulting comparison to order candidates.

This aggregation serves a different purpose from the training average. During training, the system combines losses that reflect how well its representations meet an objective on labeled examples. During evaluation, it combines the similarities of the particular writings it is comparing. The paper describes the latter operation for LIGHT-LUAR as an aggregate of layer-wise cosine scores. In its account of Wegmann evaluation, the appendix specifies direct cosine comparisons of sentence embeddings and distinguishes that procedure from the classification logits it mentions for LUAR. The score-removal experiments are explicitly defined on the LIGHT-LUAR layer similarities.

A pair can have a favorable aggregate because every depth supplies moderate evidence or because some of its comparisons are especially strong. The ranking then depends on how that aggregate relates to those of competitors. This is why a high score at one depth and an improvement in the whole ranking are distinct observations. Omitting a depth can move several candidates at once, and the outcome depends on which candidates gain or lose relative to the correct match.

The authors name the accompanying implementation LIGHT-for-AA-analysis. Their experiments evaluate the layer design through both the usual candidate rankings and measurements that use the exposed layer outputs themselves.

Experiments and results

The corpora, splits, and comparisons

The single-domain evaluation fits an authorship system on one corpus and tests it on the test split of every corpus. An in-domain result uses the same source for fitting and evaluation. An out-of-domain result has a different training source and test source. Where timestamps are available, the authors use temporally disjoint training and evaluation texts. Even the in-domain setting can therefore ask the system to apply its comparison to later writing from the same kind of source.

The Amazon data contain 135K authors chosen from reviewers with at least 100 reviews. Of these authors, 100K are used for training and 35K for evaluation. This corpus supplies writing with a recurring purpose: people appraise products. The paper cites the data from Justifying Recommendations Using Distantly-Labeled Reviews and Fine-Grained Aspects.

Fanfiction offers a different source of evidence. Its dataset contains 278,169 stories by 41K writers. The evaluation is limited to 16,456 writers who contribute exactly two stories apiece. The number of stories in the corpus thus describes the material available overall, while the two-story condition describes the evaluation subset. A score on this test reflects the ranking protocol for those eligible writers.

The Reddit data include 1 million authors. They supply conversational writing, with training data drawn from prior work and evaluation using a disjoint set from a later period. The source named for the later data is The Pushshift Reddit Dataset. The authorship system sees different patterns of language from those in reviews or fiction, and the candidate task is defined within the Reddit evaluation material.

For each encoder, the central comparisons hold the authorship system fixed and ask what happens when LIGHT is introduced. LUAR is compared with LIGHT-LUAR and Wegmann with LIGHT-Wegmann. Those matches make it possible to examine the layer intervention within systems that have different training methods. Changing from RoBERTa to ModernBERT, by comparison, changes the underlying encoder and, for LUAR, goes along with changes to the training settings already described.

The paper includes comparison systems that build text vectors without the LIGHT design. The Conv baseline uses a sub-word convolutional network. The other baseline counts terms, accounting both for a term’s prominence in a document and for how widely that term appears across documents. Its representation treats the document as a bag of words, so the weights provide evidence about vocabulary without encoding the sequence of the words. It uses TF-IDF.

What the ranking metrics measure

Recall-at-8, abbreviated R@8, credits a query if its correct author appears in the top 8 candidates. This measures how often the ranking presents the match in a short list. Within that part of the list, the measure gives the same credit at any eligible rank. Mean reciprocal rank, abbreviated MRR, uses the reciprocal of the position of the first correct match and averages that value over queries. It is consequently sensitive to movements near the start of the list. The paper cites the ranking convention of The TREC-8 Question Answering Track.

Both scores are better when higher. A correct candidate already within the cutoff can move upward and improve MRR without changing its recall outcome. A candidate that enters the cutoff contributes a new recall success, even if several incorrect candidates still rank higher. Improvements in both metrics therefore give complementary evidence about how the ordering has changed. Each score describes performance under a specified source, destination, and candidate protocol.

The count of 15 out of 16 transfer improvements summarizes the matched LIGHT comparisons from the single-domain runs. It pools directions of transfer for LUAR and for the Reddit-trained Wegmann variants across the encoders. This count is a measure of how consistently LIGHT helps its own comparison system. To see the scale of the changes, or how the systems place against other baselines, the individual source and destination scores are needed.

Single-domain transfer with RoBERTa

The Fanfiction-to-Reddit direction shows what the extra views can contribute when the original system has difficulty on the destination corpus. LUAR learns its author comparisons from stories and then ranks collections of comments. LIGHT-LUAR achieves 21.11 R@8 on Reddit in this setting, compared with 14.61 for LUAR. Its MRR also leads the alternatives reported for the same source and destination.

Mean reciprocal rank on Reddit after training on Fanfiction in the RoBERTa experiment

LIGHT-LUAR leads the reported alternatives when training on stories and ranking authors of comments.

Mean reciprocal rank on Reddit after training on Fanfiction in the RoBERTa experimentConv: 3.90Conv3.90TF-IDF: 4.63TF-IDF4.63LUAR: 9.49LUAR9.49LIGHT-LUAR (this paper): 14.32LIGHT-LUAR (this paper)14.32
The numbers
System or settingMRR
Conv3.90
TF-IDF4.63
LUAR9.49
LIGHT-LUAR (this paper)14.32

With the same Fanfiction source and Amazon as the destination, the RoBERTa systems reach 44.36 MRR for LIGHT-LUAR and 26.39 for LUAR. Their R@8 scores are 56.69 and 37.12, respectively. Fanfiction training consequently gives examples of gains on different destination corpora. The higher absolute numbers on the Amazon evaluation describe a different retrieval task, with different authors and different source material for the candidates.

Amazon training also supports transfer to the other corpora. Its Reddit test produces 18.03 MRR for LIGHT-LUAR versus 14.65 for LUAR, accompanied by R@8 values of 26.92 and 22.67. On Fanfiction after Amazon training, LIGHT-LUAR reaches 29.98 MRR and 39.21 R@8. LUAR reaches 25.04 MRR and 34.56 R@8. Both results show that the changes extend to a comparison learned from reviews.

Reddit training yields a further pair of LUAR comparisons. On the Amazon test, LIGHT-LUAR scores 60.74 MRR and 72.63 R@8 while LUAR scores 58.51 MRR and 71.84 R@8. On Fanfiction, the scores are 33.96 MRR and 43.26 R@8 with LIGHT, and 32.30 MRR and 42.50 R@8 with LUAR. The directional consistency across the LUAR comparisons is clearer than any fixed gain in score. The layered comparison sometimes makes a modest improvement to a relatively strong ranking and sometimes makes a much larger change to a weak one.

Wegmann gives the exception to the paper’s overall transfer count. On the Amazon test after Reddit training, RoBERTa-based Wegmann reaches 72.26 MRR and 79.49 R@8. The LIGHT version reaches 70.18 MRR and 75.77 R@8. On Fanfiction after the same training source, the ordering favors LIGHT. It records 23.45 MRR and 30.65 R@8 against Wegmann’s 21.21 MRR and 28.46 R@8. Topically structured triplets and the same encoder therefore support different outcomes when the destination changes.

The Reddit-to-Amazon setting also shows why the choice of comparison matters. LIGHT-LUAR improves over LUAR there, while the highest RoBERTa score among the listed systems comes from ordinary Wegmann. An improvement over the original form of a system answers the paper’s architectural question. The best absolute score reflects all the differences among those systems, including their training examples and how they construct a text representation.

Comparisons within the training domain

When both training and evaluation use Amazon, RoBERTa-based LIGHT-LUAR attains 84.68 R@8 and 72.65 MRR, with the original LUAR at 82.54 R@8 and 68.99 MRR. The layered system improves the chance of finding the correct match in the cutoff and its position as measured by MRR. The authors suggest that the regular form of reviews may give the different layers complementary evidence that is useful within the domain.

The other LUAR in-domain results favor the ordinary system. On Reddit, LUAR achieves 69.67 R@8 and 54.78 MRR, compared with 67.87 R@8 and 53.31 MRR with LIGHT. On Fanfiction, LUAR achieves 55.38 R@8 and 45.07 MRR against 51.78 R@8 and 44.33 MRR from LIGHT-LUAR. These comparisons show how a useful transfer design can have a cost when the evaluation returns to the kind of writing the system was trained on.

Reddit’s in-domain test for RoBERTa Wegmann favors the layered variant. LIGHT-Wegmann reaches 14.32 R@8 and 9.51 MRR, compared with 7.26 R@8 and 4.83 MRR for Wegmann. The authors propose that the effort to use challenging, topically similar negatives may help the extra representations contribute in a discussion corpus. The observed result is an advantage over Wegmann under its own training setup. The LUAR results show stronger absolute rankings in that Reddit evaluation.

Taken together, the in-domain experiments put an important condition on the paper’s headline. The extra views can pay off in a familiar domain, as they do for LUAR on Amazon and Wegmann on Reddit. They can also introduce scores that alter a useful ranking in the wrong direction. The experiments on individual depths investigate where that change comes from.

How the ModernBERT runs compare

The ModernBERT results give a separate test of the transfer pattern. On Amazon after Fanfiction training, LIGHT-LUAR reaches 50.65 MRR, while LUAR reaches 22.14. The same test also shows a large change in the proportion of correct matches that enter the recall cutoff.

Recall-at-8 on Amazon for ModernBERT LUAR variants trained on Fanfiction

The layered system brings the correct review author into the recall cutoff more often.

Recall-at-8 on Amazon for ModernBERT LUAR variants trained on FanfictionLUAR: 32.39LUAR32.39LIGHT-LUAR (this paper): 63.52LIGHT-LUAR (this paper)63.52
The numbers
System or settingR@8
LUAR32.39
LIGHT-LUAR (this paper)63.52

On Reddit after Fanfiction training, the ModernBERT version of LIGHT-LUAR obtains 10.86 MRR and 16.26 R@8, compared with 6.81 MRR and 10.95 R@8 for LUAR. ModernBERT thus reproduces the benefit of adding layers in this direction. The RoBERTa version of LIGHT-LUAR is still stronger on that particular Reddit test. The answer to whether LIGHT helps a given encoder can differ from the answer to which encoder supplies the strongest ranking.

The other training sources provide further checks. ModernBERT LIGHT-LUAR trained on Amazon reaches 17.85 MRR on Reddit and 29.01 MRR on Fanfiction. Its corresponding LUAR baselines reach 12.70 and 18.64. From Reddit training, ModernBERT LIGHT-LUAR achieves 80.79 MRR on Amazon and 35.83 MRR on Fanfiction, where its ordinary counterpart obtains 78.69 and 31.79. The transfer advantage appears across the source and destination changes in these LUAR runs.

ModernBERT reverses the RoBERTa result for Wegmann on Amazon. After Reddit training, LIGHT-Wegmann achieves 77.64 MRR and 82.34 R@8 on reviews. Ordinary Wegmann achieves 71.99 MRR and 79.72 R@8. On Fanfiction, ModernBERT LIGHT-Wegmann also leads with 28.50 MRR and 36.33 R@8 versus 18.14 MRR and 24.39 R@8. For Wegmann the Fanfiction improvement is reproduced across both encoders, while the outcome of the review test varies with the encoder.

The same-domain pattern for LUAR is similar to RoBERTa’s. In the Amazon in-domain test, ModernBERT LIGHT-LUAR reaches 92.07 MRR and 96.70 R@8, compared with 89.12 MRR and 95.90 R@8 for LUAR. On Reddit, the original obtains 56.89 MRR and 72.29 R@8 against 55.49 MRR and 70.37 R@8 with LIGHT. Fanfiction again favors the original, which reaches 47.67 MRR and 58.47 R@8, while the layered version reaches 46.46 MRR and 56.50 R@8. Training and evaluating ModernBERT Wegmann on Reddit favors LIGHT-Wegmann, which reaches 9.44 MRR and 13.91 R@8, compared with 3.79 MRR and 5.90 R@8 for its counterpart.

The appendix connects favorable ModernBERT results with the encoder’s depth and capacity for longer contexts. The experiments establish the behavior of each configured system on the benchmark. In LUAR, the schedules and the number of excerpts per author also differ between encoders. The repeated gain over the corresponding final-layer baseline is the most direct evidence that the paper’s approach works with both encoders.

Training on a pair of domains

The multi-domain experiment changes the writing available during training. For RoBERTa LUAR and LIGHT-LUAR, the authors combine corpora in pairs and report evaluation on the omitted source as well as on the included sources. Training batches have size 256 and sample equally from the two domains. The authors are disjoint across the domains. Same-author examples consequently come from within a corpus, while the training procedure has to learn with examples from both kinds of writing.

When Amazon and Fanfiction supply the training data, Reddit serves as the omitted domain. LIGHT-LUAR obtains 20.62 MRR and 29.95 R@8 there, compared with 13.11 MRR and 20.40 R@8 for LUAR. With training on Reddit and Fanfiction, the Amazon holdout gives 57.04 MRR and 69.43 R@8 to LIGHT-LUAR and 39.63 MRR and 53.51 R@8 to LUAR. Training on Reddit and Amazon and holding out Fanfiction yields 33.54 MRR and 43.24 R@8 for LIGHT-LUAR against 30.49 MRR and 40.69 R@8 for LUAR. Thus each held-out test favors LIGHT when both systems learn from the same mixture.

A second question is how adding a particular source compares with training on a single corpus. For instance, on Reddit the Amazon-and-Fanfiction mixture gives LIGHT-LUAR 20.62 MRR, compared with 18.03 after Amazon training alone. On Amazon, a mixture of Reddit and Fanfiction gives LIGHT-LUAR 57.04 MRR, whereas Reddit training by itself gives 60.74. The gain from using the layered system under a fixed training mixture is more consistent than the gain from adding a corpus to the training set.

The results for test domains included in training also depend on the mixture. With Reddit and Amazon as sources, LIGHT-LUAR reaches 78.38 MRR on Amazon and LUAR reaches 72.09. With Reddit and Fanfiction as sources, LUAR leads on Fanfiction, with 46.32 MRR versus 44.56 for LIGHT-LUAR. A system can therefore benefit from extra layer scores on the holdout while changing the rankings of familiar writing in either direction. Multi-domain training extends the paper’s evidence for transfer without making the in-domain results uniform.

What the ablations show

Taking a layer score out of the ranking

The principal ablation removes a similarity score from the aggregate of a fitted LIGHT-LUAR system. The authors repeat the evaluation after leaving out each layer’s direct comparison in turn. They measure the effect on R@8. In the paper’s figure, a positive value signifies that recall fell when the score was removed, so the discarded score had helped the complete system. A negative value signifies that the ranking improved after the omission.

The intervention changes the calculation made after the representations have been produced. The encoder still processes the text through its usual blocks, and the projections used for the remaining comparisons retain their trained parameters. An early state can therefore still affect every later representation that depends on it. The ablation measures the benefit of having its own score in the aggregate, conditional on the rest of the system continuing to work as trained.

The Fanfiction-trained system gives the clearest change in the value of a group of layers across test corpora. Removing scores from the early views, Layers 0 to 3, hurts R@8 on the out-of-domain Amazon and Reddit tests. On the in-domain Fanfiction test, dropping early scores improves performance. The later scores, from Layers 4, 5, and 6, show their value in that in-domain test: recall drops when they are taken away. The training and parameters remain fixed across the comparisons, so the different effects refer to how those scores behave on the evaluation material.

From Amazon training, Layers 1 to 3 help on the Reddit test and are detrimental to recall on the Amazon test when included in the full combination. The later layers, 4 to 6, contribute principally on Amazon. This is a related configuration of effects with a different source of supervision. Early scores have value after a change of domain, and the deeper comparisons provide the most consistently useful evidence in the same kind of writing that supplied training.

From Reddit training, the input projection has an especially clear effect. Omitting the Layer 0 score hurts on Amazon and Fanfiction and helps on Reddit. Layer 6 supplies the largest favorable contribution in the Reddit in-domain comparison. These are measurements of the whole ranked list under a particular score intervention. They support the authors’ conclusion that the transfer improvement draws partly on information made directly available by earlier views.

The experiments also help explain why in-domain degradation can coexist with cross-domain improvement. A layer that helps sort candidates on a new source can be redundant or misleading in the presence of scores already suited to the original source. Because the same architecture adds that view in both tests, it can help one ranking and hurt the other. The observed changes depend on which layer is removed and on the evidence remaining in the aggregate.

Learning without the initial projection

The authors run a separate ablation that removes the projection of the token embeddings before training. The initial embeddings still supply input to the encoder. The fitting procedure omits the direct loss attached to that projection, and evaluation omits the corresponding similarity score. The remaining representations can consequently adapt during training. The experiment tests the value of building the input projection into the authorship system in the first place.

In Reddit’s in-domain comparison, the system trained without the projection obtains 68.55 R@8 and 53.7 MRR, while the complete system obtains 67.87 R@8 and 53.31 MRR. The direction agrees with the ablation of the already trained system, in which leaving out the Layer 0 score improves recall on Reddit. With Amazon training and testing on Reddit, the full system leads instead, at 26.92 R@8 and 18.03 MRR. The version trained without the input projection obtains 26.76 R@8 and 17.94 MRR.

The effect is clearer when Fanfiction-trained systems are applied to Reddit. With the projection, recall is 21.11 R@8. Without it, recall is 19.38 R@8. MRR also favors keeping the projection. The comparison reflects a change to both supervision and scoring, so a separate experiment that only omits the score provides complementary evidence.

Mean reciprocal rank on Reddit for Fanfiction-trained LIGHT-LUAR with and without the input projection

Keeping the input projection improves the ranking when the system learns from stories and evaluates comments.

Mean reciprocal rank on Reddit for Fanfiction-trained LIGHT-LUAR with and without the input projectionTrained without Layer 0: 12.73Trained without Layer 012.73Trained with Layer 0 (this paper): 14.32Trained with Layer 0 (this paper)14.32
The numbers
System or settingMRR
Trained without Layer 012.73
Trained with Layer 0 (this paper)14.32

Other transfer directions in the table also favor the complete system. On Amazon after Fanfiction training, it achieves 56.69 R@8 and 44.36 MRR, compared with 52.97 R@8 and 40.51 MRR for the system trained without Layer 0. For the reverse direction, training on Amazon and testing on Fanfiction, the complete system reaches 39.21 R@8 and 29.98 MRR against 38.64 R@8 and 28.65 MRR. In combination with the score-removal results, these comparisons support giving the initial representation an explicit role in authorship training and evaluation, particularly for transfer.

What the linguistic probes can recover

The paper also asks what kinds of linguistic information the projected representations make accessible. The authors use Holmes, a benchmark comprising over 200 datasets with different probing procedures. A probe is an auxiliary assessment applied to a representation to see how readily information relevant to a linguistic property can be recovered. The authors compare the final output from LUAR with the separate projections from LIGHT-LUAR, using Reddit-trained systems in both cases.

The benchmark covers properties including word structure, the arrangement of phrases and clauses, meaning, and the organization of connected text. These categories broaden the analysis beyond the task’s author labels. For example, a useful author representation might also distinguish grammatical forms. A probe gives the experimenters a way to see whether enough information about those forms remains available to do well on the probe’s own task. The relevant categories include morphology and semantics.

The conventional LUAR output is comparatively strong on morphology relative to its results for the other categories. LIGHT-LUAR distributes its strengths across the available representations. For the categories discussed other than morphology, the best LIGHT layer for a category exceeds the LUAR output in that category. This is a comparison between the best available layer for each property and a common baseline output. Which layer supplies the favorable result can change with the property being measured.

The authors find syntax most accessible at intermediate depths, around Layers 2 to 3. Discourse information is more accessible at later depths, around Layers 3 to 6, and the input projection also shows evidence of it. One explanation the authors raise for the Layer 0 result is the presence of recognizable discourse markers. Expressions that signal transitions or relationships between ideas can provide clues near the level of word choice, even though the organization they help express extends over longer passages.

The probes lend support to the idea that the extra representations supply a wider range of linguistic information. The attribution ablations address a further link in that account. They establish that including particular depths changes the final ranking. The two results are compatible with an explanation based on complementary stylistic evidence, while leaving room for several kinds of information to contribute through any given score.

Which layers give especially strong evidence on a pair

A further analysis starts with 5k sampled text pairs for a training and evaluation configuration. The authors calculate the cosine similarities at the available depths and examine how frequently a layer produces a score far from the reference average in the expected direction. They express distance from the average using a z-score, measured in units of standard deviation. For known same-author pairs, they count scores with a z-score above 1.5. For different-author pairs, they count scores with a z-score below -1.5. This identifies views that often offer unusually strong evidence of similarity or dissimilarity for the relevant class of pair.

For the Fanfiction-trained system, the final Layer 6 has a prominent role on the Fanfiction pairs, while early Layers 0 to 2 stand out more in transfer. With Amazon training, Layers 0 and 6 are prominent on Amazon pairs, and the analyses on Reddit and Fanfiction also identify early Layers 1 to 3. With Reddit training, Layers 0 and 6 stand out on Reddit pairs, while Layer 1 is more prominent in the discussion of the out-of-domain pairs. The authors see a recurring distinction between the last layer’s contribution on familiar writing and the evidence supplied by early layers on a new source.

An early score can stand out on favorable pairs while reducing recall as part of the ranking. Layer 0 after Reddit training illustrates this: it is prominent in the analysis of Reddit pairs, yet removing its score improves R@8 on the Reddit ranking. The pair statistic counts how frequently an individual similarity is unusually favorable. R@8 depends on how the combination of similarities orders the correct candidate relative to others. A clear signal on part of the pair sample can coexist with harmful movements at the cutoff.

Together the analyses address the method at different scales. A probe evaluates whether a projected representation makes linguistic information accessible. The pair analysis identifies depths that give particularly favorable scores on some known examples. The score ablation tests the change to a completed ranking when one depth’s direct evidence is removed. Their broad agreement about the role of early views in transfer helps explain the results, while their differences show why the value of a projection depends on how the system uses it.

Limitations

Limits identified by the authors

The language scope is English. The study changes the kind of writing within that scope, including discussion, reviews, and fiction. The authors leave open how well the findings transfer to other languages, in which stylistic choices and the representations available to an encoder may differ. The evaluation therefore supports generalization across these writing domains in English.

The authors also identify the resource cost of adding projections and supervising them throughout the encoder. A deeper backbone gives the architecture more projected views to train and compare. The reported training times illustrate the scale of the configurations examined, though changes in encoder and excerpt sampling influence those figures too. The authors propose testing whether a smaller group of projections could retain the performance gains. The study evaluates the benefit of opening up the encoder’s depth more fully and leaves the most efficient selection unresolved.

The detailed layer analyses focus on LUAR. Wegmann contributes evidence that the general method can improve rankings under a different training objective, but the paper does not run the corresponding analysis of which linguistic properties each Wegmann depth captures or which scores drive its transfer gains. Even within LUAR, the probing comparison is based on Reddit-trained systems. Its linguistic findings are best read in the context of that training source.

The authors caution that probes provide an imperfect measure of linguistic competence. A favorable result shows what the probing procedure can recover from a representation. The path from that recoverable information to an authorship decision remains a further question. Inspecting the layer scores makes the comparison easier to examine than a single score alone, while the individual embeddings still encode many properties at once. The result is a limited form of interpretability.

The paper’s ethics discussion identifies the risks of revealing someone’s identity from their writing, including misuse to suppress speech. It also considers false attribution, such as linking a person to a post in a criminal case. The authors flag mistakes under domain shift as a concern. The benchmark results measure a pattern of better ranking under many such shifts. The consequences of acting on an erroneous ranking depend on the application and on how its decision is made.

Limits that follow from the design

The source and destination corpora differ along several dimensions at the same time. Amazon reviews have a recurring communicative purpose. Reddit comments occur in discussions, and Fanfiction stories provide a different form of writing. The corpora also differ in how authors and writing samples are selected. The authors’ explanations about structure, topic, and stylistic diversity are plausible accounts of the observed differences. The comparisons use complete corpora, which leaves those explanations entangled with the other properties that change between sources.

The transfer protocol gives evidence about applying a learned comparison within an unfamiliar corpus. It provides limited evidence about direct comparisons between writing from different platforms or genres. In particular, the paired-source training procedure uses disjoint authors across its sources and forms positive relationships within each source. Identifying a writer from a review collection and a story collection would require tests in which precisely that cross-source author relationship is known and evaluated.

Rank-based measures also have a defined scope. R@8 measures whether the correct author is in a short list, and MRR measures how close the first correct match is to the top. Real decisions can involve candidate sets in which the right author is absent, or settings where a system must judge whether a given similarity justifies an identification. The reported results give neither an error rate for a chosen identification threshold nor a calibration curve for such decisions. Stronger ranking supports the task tested in the paper, while identification accuracy under those conditions calls for a different evaluation.

The ablations establish conditional contributions. Omitting a single score shows how the rest of the trained aggregate operates without it. It gives little information about how a different group of depths would behave if trained and used together. The Layer 0 retraining experiment addresses a particular architectural change, leaving broader questions about redundancy and interactions among projections open. The evidence supports using information from several depths, while the value of keeping every individual projection can vary with source and destination.

Finally, the linguistic and ranking analyses do not trace an attribution to a specific choice in the writing. A projection can make syntactic information accessible and improve a transfer ranking, but its similarity score can reflect vocabulary, sentence construction, and other features together. Identifying which choice caused a particular candidate to move would require examining or manipulating the evidence behind that comparison. The paper establishes differences across views and consequences for ranking, with the finer explanation left open.

What came after

No later study is documented. The authors outline two extensions of the work. They propose testing whether a smaller selection of depths can retain the transfer gains while reducing the computation required for training. They also suggest comparing LIGHT directly with classical stylometry. Such a study could examine how similarities derived from the learned views relate to explicit measurements of linguistic habits, and whether the two approaches succeed on the same authorship comparisons.

Cite

Cite as Milad Alshomary, Nikhil Reddy Varimalla, Vishal Anand, Smaranda Muresan and Kathleen McKeown. 2025. Layered Insights: Generalizable Analysis of Human Authorial Style by Leveraging All Transformer Layers. Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2025.emnlp-main.521

@inproceedings{alshomary2025layered,
  title = {{Layered Insights: Generalizable Analysis of Human Authorial Style by Leveraging All Transformer Layers}},
  author = {Milad Alshomary, Nikhil Reddy Varimalla, Vishal Anand, Smaranda Muresan and Kathleen McKeown},
  booktitle = {Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
  doi = {10.18653/v1/2025.emnlp-main.521},
  url = {https://doi.org/10.18653/v1/2025.emnlp-main.521}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/alshomary-2025-layered-insights-generalizable-analysis-human/