← Latest papers
💬 NLP

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

This paper introduces CTRAG, a novel Retrieval-Augmented Generation framework that leverages adaptive chunking, dynamic retrieval, and in-context learning to automate and significantly improve the accuracy of regulatory compliance verification by cross-referencing control questions with company documentation, as validated by a successful real-world deployment at a Big Four professional services firm.

Original authors: Muhammad Roman, Karen Rafferty, Barry Devereux

Published 2026-08-04
📖 7 min read🧠 Deep dive

Original authors: Muhammad Roman, Karen Rafferty, Barry Devereux

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

=== SUMMARY ===
Imagine you are a detective trying to solve a mystery, but instead of a crime scene, your "crime" is a company breaking the rules. In the world of business, there are thousands of rules—like a giant, invisible rulebook for how to handle money, protect secrets, or keep data safe. Checking if a company follows these rules is called "compliance." Traditionally, this job falls to human auditors who have to read through mountains of messy paperwork, looking for tiny clues that prove the company is playing by the book. It's slow, boring, and humans get tired, which means they sometimes miss clues or get confused.

Enter the world of Artificial Intelligence, specifically a type of smart computer brain called a Large Language Model (LLM). Think of an LLM as a super-fast reader that has read almost everything in the world and can talk like a human. However, there's a catch: these smart brains sometimes make things up (called "hallucinations") or forget specific facts because they rely on what they memorized rather than what's in front of them. To fix this, scientists use a trick called "Retrieval-Augmented Generation" (RAG). Imagine giving the detective a flashlight and a stack of specific files to search before they write their report. The AI looks up the facts in the documents first, then uses its brain to write the answer. This paper explores how to make that flashlight search and the final report as perfect as possible for checking if companies are following the rules.


The Detective's New Toolkit: CTRAG

The researchers behind this paper, working with a major professional services firm, built a new system called CTRAG. Think of CTRAG as a high-tech compliance detective designed to automate the boring, time-consuming job of checking if a company is following the rules. Instead of a human spending hours flipping through PDFs, CTRAG takes the rules (which are written as questions) and hunts through the company's documents to find the answers.

The paper's main goal was to figure out the best way to teach this AI detective how to search. They tested different strategies to see which one helped the AI find the right clues without getting distracted by irrelevant noise.

The "Chunking" Puzzle: How to Slice the Pie

One of the biggest challenges was how to cut up the company documents. Imagine you have a 500-page novel and you need to find a specific sentence. If you cut the book into tiny 200-character pieces (like cutting a page into postage stamps), you might lose the context of the story. If you cut it into huge 3000-character chunks (like cutting the whole book in half), you might get so much extra text that the specific clue gets lost in the middle of a sea of words.

The team tested different "chunk sizes" (how big the pieces of text are):

  • Tiny pieces (200 chars): These were too small and fragmented. The AI got confused because it couldn't see the whole picture.
  • Huge pieces (3000 chars): These were too messy. The AI got overwhelmed by too much information, like trying to find a needle in a haystack where the haystack is on fire.
  • The Sweet Spot: They found that small chunks (around 800 characters) worked best. It was like cutting the book into manageable paragraphs. This size was just right to keep the context clear without drowning the AI in noise.

They also tried a fancy method called "Meta-chunking," which tries to cut the text based on logical story breaks rather than just cutting at a specific number of characters. While this sounded smart, it turned out to be too slow and computationally expensive for this specific job, so they stuck with the simpler, fixed-size cuts.

The "Flashlight" Setting: How Many Files to Check?

When the AI asks a question, it needs to decide how many document snippets to pull up to answer it. This is called the K-value (or top-K).

  • If the AI looks at only 1 snippet, it might miss the answer if it's hiding in the second file.
  • If it looks at 5 snippets, it might get confused by extra, irrelevant details.
  • The researchers found that looking at 4 snippets (K=4) was the perfect balance. It gave the AI enough evidence to make a decision without getting distracted.

Teaching the AI to Think Like a Human

The biggest breakthrough came from a technique called In-Context Learning (ICL). Imagine you are teaching a new intern how to solve a case. You don't just say "find the rule"; you show them examples: "Here is a case where a company used a cloud provider, and here is why that counts as 'Pass' even though the company didn't do the work themselves."

The AI struggled with "indirect compliance"—situations where a company follows a rule because their vendor (like a cloud provider) follows it. Without help, the AI would say "Fail" because the company didn't do the work directly. But by feeding the AI a few carefully chosen examples (like a reference sheet of past cases), the AI learned to mimic human judgment. It realized, "Ah, if the vendor is compliant, that counts for us too!"

The Results: Faster, Smarter, and More Accurate

When they put CTRAG to the test in a real-world scenario with a Big Four professional services firm, the results were impressive:

  • Accuracy: The system achieved an F1-score of 78% and a recall of 85%. In detective terms, this means it found 85% of the actual rule-breaking cases and didn't miss many.
  • Efficiency: The system reduced the manual work for human reviewers by about 60%.
  • The "No-Evidence" Fix: One tricky problem was when the AI couldn't find any info in the documents. Instead of guessing, the system was programmed to treat "No Evidence" as "Non-Compliant." The logic is simple: if you can't prove you followed the rule in your documents, you probably didn't. By reclassifying these "No Evidence" cases as failures, the system caught many potential rule-breakers it would have otherwise missed. This critical step allowed the system to achieve that high 85% recall rate without needing to retrain the AI.

What They Ruled Out

The paper was very clear about what didn't work:

  • Tiny chunks (200 chars) were a bad idea; they broke the context too much.
  • Huge chunks (3000 chars) and Meta-chunking were too noisy or too slow to be practical for this specific task.
  • Direct prompting (just asking the AI without examples) wasn't enough for tricky cases involving third-party vendors.

The Bottom Line

The authors suggest that CTRAG is a powerful tool for streamlining compliance checks, but they are careful not to call it a "solved problem." They note that their tests were based on 240 rules and 45 documents from a single organization. While the results are promising and suggest this approach could scale to other companies and tasks (like checking contracts), more testing across different industries is needed to be sure it works everywhere.

In short, CTRAG shows that by giving AI the right-sized "chunks" of information, the right number of "flashlight" beams, and a few "reference sheet" examples, we can build a system that helps humans check the rules faster and with fewer mistakes. It's not magic, but it's a very smart way to use technology to keep the corporate world honest.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →