MCP
arXivarXiv
Preprint
Published: August 3, 2026
cs.CL

CTRAG: An In-Context Retrieval-based Framework for Automated Compliance Checking using LLMs

Abstract
Trust is fundamental in modern regulatory ecosystems, and compliance checking plays a critical role in fostering that trust. Regulatory compliance verification is essential for businesses operating in highly controlled environments, as it ensures alignment with sector-specific guidelines across domains such as financial reporting, data privacy, and cybersecurity. Manual compliance testing, however, is often time-intensive and prone to inconsistencies, particularly when compliance depends indirectly on third-party services such as cloud providers, where vendors rely on external providers to meet regulatory standards. In this paper, we present CTRAG, a novel Retrieval-Augmented Generation (RAG) pipeline designed for automated compliance checking. CTRAG employs advanced strategies, including adaptive chunking, dynamic retrieval configurations, and in-context learning, to improve the precision and relevance of compliance assessments. By extracting control questions from regulatory texts and cross-referencing them with unstructured company documentation, CTRAG achieves highly accurate, document-informed compliance verification, even in cases of indirect compliance through third-party services. Empirical evaluations demonstrate significant improvements, with CTRAG achieving an F1-score of 78% and a recall of 85% in the final deployed configuration, ensuring minimal missed non-compliance cases while reducing manual reviewer effort in a real-world deployment. To validate CTRAG value, we developed and deployed a POC within a Big Four professional services firm, applying it to real-world cases and cross-checking results against manual compliance reports. These findings highlight CTRAG potential to streamline compliance workflows, mitigate risks, and enhance regulatory trust in complex, high-stakes environments.
0
AI overview
Reviews
Citation graph
References · 30
Structured
This preview uses generator v1; v2 is available

Overview

This paper proposes CTRAG, a customized RAG pipeline for regulatory compliance checking. Through chunking, retrieval configuration, and in-context learning optimizations tailored to compliance scenarios, it achieves an F1 of 78% and a recall of 85% in a real deployment scenario, reducing manual review workload.

Task Background and Existing Challenges in Automated Compliance Checking

Traditional compliance testing typically follows a labor-intensive manual review model, in which auditors analyze the massive volumes of documents submitted by enterprises one by one. Although such processes are meticulous, they are extremely time-consuming overall, and differences in how auditors interpret regulatory provisions directly introduce variability in results. Compliance review requires auditors to locate all relevant information within huge collections of corporate documents, and every new review case adds large amounts of material to process, further greatly increasing the complexity and error risk of the review.

Even with some progress in relevant techniques, automated compliance checking still faces significant core challenges, rooted in the inherent complexity and pervasive ambiguity of regulatory requirements themselves. Many compliance obligations are expressed in natural language, containing implicit assumptions, contextual dependencies, and subjective terminology that are difficult to formalize directly through computational means. Existing research has confirmed that a considerable proportion of regulatory requirements cannot be evaluated using simple rule-based methods alone; some of this ambiguity is intentional, designed to preserve flexibility in applying rules, while the rest is unintentional ambiguity arising from linguistic properties and domain-specific complexity.

Positioning of Existing Compliance-Checking Research and the Gap to Be Filled

Building on existing technical progress, research on jointly optimizing retrieval configuration, document chunking strategies, and in-context learning for evidence-based compliance checking of unstructured organizational documents remains very limited. This clear research gap directly forms the design starting point of CTRAG, a compliance-oriented RAG framework intended to support accurate, traceable compliance assessment through document-grounded reasoning.

Core Contributions of CTRAG's Compliance-Oriented Custom RAG Pipeline

CTRAG is a retrieval-augmented generation pipeline custom-built for regulatory compliance checking. It integrates the ability to extract control rules from regulatory documents into the workflow, enabling precise, document-grounded checking of user-provided files containing unstructured content.

Fig. 1: Full-pipeline architecture of the RAG approach for compliance checking, covering document chunking, vector retrieval, and LLM inference.

Beyond this, the design distinguishes itself from generic RAG in two further ways: first, through extensive controlled experiments it systematically benchmarks chunking strategies and the number of retrieved chunks, obtaining the optimal configuration for compliance-checking tasks and helping researchers in the field understand how changes in chunk size affect performance on similar tasks; it also covers comparative analysis of how different LLM choices affect the final assessment results.

Design Logic of CTRAG's Chunking Strategy and Retrieval Configuration

In a RAG pipeline for compliance checking, document chunking is the core step that breaks down massive regulatory and internal corporate documents into manageable, contextually coherent fragments. CTRAG specifically explores a chunking implementation suited to compliance-checking scenarios, preserving the complete context needed by compliance queries as much as possible while safeguarding retrieval precision. The implementation is based on LangChain's RecursiveCharacterTextSplitter, supporting custom window sizes and overlapping context configurations, and covers both sentence-level and paragraph-level chunking granularity: sentence-level chunking offers fine-grained content control, making it easier for retrieval to locate the specific provision being targeted when responding to clearly directed compliance queries.

CTRAG systematically varies the number K of top retrieved documents included in the query context to evaluate how this parameter affects compliance response quality. A higher K provides the LLM with richer contextual information, but also increases the risk of introducing irrelevant data; a lower K maintains retrieval precision by limiting the context scope, but occasionally fails to retrieve the key details needed to handle complex queries. Balancing K is a core element in ensuring that output responses meet regulatory expectations, and the value of this design is especially evident when handling indirect compliance scenarios.

Empirical Evaluation Results of CTRAG's Full-Pipeline Configuration

The paper built and deployed a proof-of-concept system within one of the Big Four professional services firms, applying the CTRAG approach to a real compliance-checking scenario. All output results were cross-verified against manually produced compliance reports. Under the optimal deployed configuration, CTRAG achieved a classification F1 score of 78% and a recall of 85%, reducing the workload of human reviewers while minimizing missed non-compliant cases.

Fig. 2: F1 performance on compliance checking for four LLMs under three different chunk sizes after in-context learning.

The paper systematically validated the effects of four categories of variables—chunking strategy, retrieval configuration, LLM architecture, and in-context learning—on automated compliance checking. Among all tested configurations, the combination of small chunks with retrieval depth K set to 4 delivered the most stable performance, while larger chunks typically showed simultaneous drops in precision and recall due to context dilution. Meta-chunking, designed to preserve logical coherence, incurred extremely high preprocessing overhead in this task scenario and performed worse than fixed-size chunking. These experimental results indicate that for compliance-oriented document analysis tasks, retrieval quality and evidence granularity should be prioritized over simply enlarging the input context size.

Conclusions and Statement of Applicability Boundaries

The scenario-specific RAG optimization insights from this study are supported empirically entirely by 240 control rules and 45 documents from a single organization; large-scale testing across different regulatory domains has not yet been completed, and the generalizability of conclusions on chunking strategies and in-context learning remains to be further validated.

The study has several explicit limitations: all datasets used are private and cannot be publicly released; and no inter-annotator agreement was measured for the binary pass/fail labels.

The final deployed CTRAG pipeline adopted a conservative reclassification logic of "judging as non-compliant when no evidence is found," which is essentially a design that sacrifices some precision in exchange for higher recall.

Rating
No ratings yet
Rate
Community rating
—
/ 5
No ratings yet
Rating
—
Soundness
—
Presentation
—
Contribution
—
Confidence
—
Discussion
Top
Newest
Questions
Replication
Author
No comments yet — be the first