Introduction
Authorship Attribution (AA) is the task of identifying the author of a given text, a capability essential for forensic linguistics, intellectual property protection, and online safety. While Transformer-based models have significantly advanced the state-of-the-art in AA, they often suffer from a "final layer bias." Most existing frameworks rely exclusively on the output of the final Transformer layer to represent authorial style. However, linguistic research suggests that style is a multi-faceted phenomenon encompassing lexical choice, syntactic structure, and discourse patterns—features that are captured at varying depths within a neural network.
Methodology: The LIGHT Framework
To address the limitations of single-layer representations, we introduce LIGHT (Layered Insights for Generalizable Analysis of Human Authorial Style). LIGHT moves beyond the final layer by extracting and utilizing embeddings from every layer of the Transformer, including the initial token embeddings (Layer 0).
As illustrated in the architecture diagram, the LIGHT extension involves three key components:
- Layer-wise Projections: Each layer's output is processed through a dedicated linear projection layer.
- Multi-Layer Contrastive Learning: During training, a contrastive loss is calculated for every layer simultaneously. This objective encourages the model to learn author-specific signatures across all levels of linguistic abstraction.
- Aggregated Inference: At test time, similarity scores are computed across all projected spaces and aggregated to form a final stylistic fingerprint.
Experimental Setup
We evaluated LIGHT by applying it to two prominent AA models, LUAR and Wegmann, using RoBERTa and ModernBERT backbones. Experiments were conducted across three diverse domains: Reddit (informal/conversational), Amazon (structured reviews), and Fanfiction (creative writing). A primary focus was placed on out-of-domain (OOD) performance, where models are trained on one dataset and evaluated on another, testing the true generalizability of the learned stylistic features.
Results and Discussion
The experimental results demonstrate that the LIGHT framework significantly enhances model robustness, particularly in OOD scenarios. While the final layer often suffices for in-domain tasks by potentially exploiting content-based shortcuts, it frequently fails when the domain shifts. In contrast, the internal layers of LIGHT-enhanced models capture more stable syntactic and morphological patterns.
Key findings include:
- Significant OOD Gains: As shown in the results table, LIGHT-LUAR achieved a 50% improvement in Mean Reciprocal Rank (MRR) when transferring from Fanfiction to Reddit. Overall, LIGHT improved performance in 15 out of 16 OOD test cases.
- Layer Specialization: Probing analysis confirmed that lower layers (0-1) specialize in morphology, middle layers (2-3) in syntax, and higher layers (4-6) in semantics and discourse.
- In-Domain Trade-offs: In some in-domain settings, LIGHT showed a slight performance decrease compared to single-layer models. This suggests that while the final layer can overfit to domain-specific content for "easy" tasks, the multi-layer approach is necessary for cross-domain reliability.
Conclusion and Future Work
By leveraging the full depth of Transformer architectures, the LIGHT framework provides a more comprehensive and generalizable representation of authorial style. While currently focused on English and entailing some computational overhead due to additional projection layers, LIGHT represents a significant step toward robust, domain-agnostic authorship attribution. Future research will explore its efficacy in multi-lingual settings and investigate methods to optimize computational efficiency.
Summary updated