ISACL: Internal State Analyzer for Copyrighted Training Data Leakage

Guangwei Zhang, Qisheng Su, Jiateng Liu, Cheng Qian, Yanzhou Pan, Yanjie Fu, Denghui Zhang · 2025

Read ISACL: Internal State Analyzer for Copyrighted Training Data Leakage by Guangwei Zhang, Qisheng Su, Jiateng Liu, Cheng Qian, Yanzhou Pan, Yanjie Fu, Denghui Zhang (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-17767.txt.

Introduction

Guangwei Zhang and co-authors built ISACL in 2025, a guard that spots when a language model is about to leak training text. Models can learn text that is under copyright and then spit it back out. Most guards check the output after it is made, which is too late to stop a leak. This team reads the model's inner state before it writes a word.

A classifier trained on known guarded works flags risky inner states. The host system can then halt the reply or steer it aside. The tool is wired into a search-aided setup that checks rights as it works. The authors say the early read cuts leak risk at scale while the text stays strong.

Catalog record

CREATORGuangwei Zhang, Qisheng Su, Jiateng Liu, Cheng Qian, Yanzhou Pan, Yanjie Fu, Denghui Zhang
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE60 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2508-17767

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

ISACL: Internal State Analyzer for Copyrighted Training Data Leakage Guangwei Zhang, Qisheng Su, Jiateng Liu, Cheng Qian, Yanzhou Pan, Yanjie Fu, Denghui Zhang Abstract Large Language Models (LLMs) have revolutionized Natural Language Processing (NLP) but pose risks of inadvertently exposing copyrighted or proprietary data, especially when such data is used for training but not intended for distribution. Traditional methods address these leaks only after content is generated, which can lead to the exposure of sensitive information. This study introduces a proactive approach: examining LLMs’ internal states before text generation to detect potential leaks. By using a curated dataset of copyrighted materials, we trained a neural network classifier to identify risks, allowing for early intervention by stopping the generation process or altering outputs to prevent disclosure. Integrated with a Retrieval-Augmented Generation (RAG) system, this framework ensures adherence to copyright and licensing requirements while enhancing data privacy and ethical standards. Our results show that analyzing internal states effectively mitigates the risk of copyrighted data leakage, offering a scalable solution that fits smoothly into AI workflows, ensuring compliance with copyright regulations while maintaining high-quality text generation. The implementation is available on GitHub. 1 1 1 https://github.com/changhu73/Internal_states_leakage 1 Introduction Figure 1: To assess the risk of copyrighted training data leakage, an LLM’s internal states are analyzed prior to generating content. Extracting semantic information from intermediate layers allows for the proactive identification of potential risks. LLMs have significantly enhanced text generation and dialogue systems in NLP Zhang et al. 2023 ; Li et al. 2022a . However, they also pose risks of unintentionally reproducing copyrighted or proprietary information from their training data, especially when the data is licensed for training but not distribution. According to U.S. copyright law U.S. Copyright Office 1976 , only the copyright holder has the exclusive right to distribute copyrighted works. If an LLM inadvertently distributes copyrighted material by replicating parts of its training data, it may violate this law and expose its developers or users to legal liability Borkar 2023 . This underscores the importance of adhering to legal and ethical standards when deploying LLMs across various applications Peng et al. 2023 ; Xue et al. 2021 ; Wang et al. 2025 ; Yu et al. 2023a ; Yu et al. 2024 . Addressing these risks is crucial to protecting intellectual property rights and ensuring the responsible and lawful use of LLMs in real-world situations. Previous research has raised concerns about the issue of copyrighted data leakage Zhang et al. 2025 ; Pan et al. ; Xu et al. 2024 ; Zhao et al. 2024 during the generation process of LLMs, including the leakage of private information Kim et al. 2023 ; Lukas et al. 2023 ; Huang et al. 2022 ; Shao et al. 2024 and evaluation data used in machine learning Zhou et al. 2025 ; Zhou et al. 2023 . Existing methods to prevent or mitigate data leakage include implementing strict output filtering Miyaoka and Inoue 2024 and context-aware mechanisms Luu et al. 2024 , applying differential privacy techniques Li et al. 2025 ; Hoory et al. 2021 ; Du and Mi 2021 ; Li et al. 2022b ; Behnia et al. 2022 ; Shi et al. 2022 ; Wu et al. 2022 ; Majmudar et al. 2022 ; Du et al. 2023 ; Mai et al. 2024 or other data anonymization methods during training, regularly auditing and reviewing model outputs, and monitoring LLM interactions to detect potential data leakage. However, these approaches face several limitations, such as limited coverage of scenarios Xiao et al. 2023 , reduced model performance and usability caused by differential privacy techniques, and high costs and delays associated with manual audits Song et al. 2024 . Figure 2: Overview of our Copyrighted Training-set Leakage Detection Framework: Our approach involves maintaining a database of sensitive or proprietary materials to support the analysis of LLM hidden states. During inference, this database provides reference samples for potential leakage, working in conjunction with the model’s hidden states to predict whether the generated content poses a risk of training-set leakage. The pipeline is structured into three key stages: The left section focuses on the construction and extraction of data for Retrieval-Augmented Generation, a core component designed to enhance model performance and address training-set leakage challenges. The right section illustrates the generation of training data, including the collection of internal states, labels, and reference embeddings, which are then used to train a Multi-Layer Perceptron as the final leakage risk detector. Lastly, the bottom section showcases real-world user interaction, where queries are submitted, and the system applies our framework to assess copyrighted potential leakage risks effectively. To address the challenge of detecting copyrighted training data leakage in LLM-generated text, we introduce a framework called the Internal State Analyzer for Copyrighted training data Leakage (ISACL) . ISACL evaluates leakage risks by analyzing the model’s internal states during the prefill phase, before any text is generated. Unlike conventional approaches that rely on examining fully generated outputs, ISACL proactively identifies potential risks by assessing early-stage representations of input text and their correlation with copyrighted reference materials. This approach enables real-time, scalable, and precise risk assessment without requiring complete output generation. To enhance its effectiveness, ISACL is integrated into a RAG system. Copyrighted information is indexed using FAISS and stored in SQLite, allowing efficient retrieval of relevant reference materials during the evaluation process. When a relevant reference is retrieved, it is combined with the model’s internal states to determine the likelihood of leakage. This integration improves the accuracy and efficiency of comparing generated content with known copyrighted training data, ensuring reliable detection. Beyond detection, ISACL adheres to legal and ethical standards, serving as a robust safeguard against unauthorized disclosure of copyrighted materials in AI-generated content. By ensuring compliance with licensing constraints, ISACL promotes responsible and lawful use of LLMs in real-world applications. In a series of experimental configurations, ISACL demonstrated outstanding performance, achieving high accuracy and F1 scores. Specifically, accuracy ranged from 91.88% to 95.05%, while F1 scores varied between 0.9249 and 0.9468. In certain configurations, ISACL even achieved near-perfect detection rates. These results highlight ISACL’s consistent ability to accurately identify potential training-set leakage across diverse settings, maintaining high levels of precision and recall. The findings underscore ISACL’s robustness in scalable, real-time risk detection for LLM-generated content, even without generating any text. For a detailed description of the experimental setup and results, please refer to Section 4.3 . Our primary contributions are as follows: \bullet As illustrated in Figure 1 , we propose a real-time framework “ISACL” for predicting copyrighted training data leakage in LLM-generated text by leveraging internal states extracted before any token is decoded. This ensures efficiency and avoids reliance on output generation, proactively addressing potential risks of unauthorized disclosure. \bullet ISACL is the first framework to proactively detect potential copyrighted data leakage by analyzing LLM internal states before content is generated. This approach ensures that neither users nor language models are exposed to sensitive or copyrighted information, thereby ensuring compliance with legal and licensing standards. \bullet We validate ISACL’s effectiveness in large-scale text generation scenarios and demonstrate its integration with a RAG system. This integration enables efficient and accurate text retrieval while ensuring compliance with copyright constraints, making the approach

Read the complete text