AUTOMATING SHARIAH COMPLIANCE CHECKS IN ISLAMIC BANKING USING LARGE LANGUAGE MODELS AND RAG PIPELINES
Abstract
The Islamic banking and finance industry, currently managing assets exceeding USD 4 trillion globally, operates under a rigorous framework of Shariah law that mandates exhaustive compliance review of every financial instrument and contractual agreement. Conventional Shariah audit processes are predominantly manual, reliant upon a limited pool of certified scholars, and unable to scale proportionally with the exponential growth of Islamic financial products. This paper proposes a novel, end-to-end computational framework that integrates Large Language Models (LLMs) with Retrieval-Augmented Generation (RAG) pipelines to automate first-pass Shariah compliance checks for Islamic financial contracts. The framework ingests a curated corpus comprising Accounting and Auditing Organization for Islamic Financial Institutions (AAOIFI) standards, classical fiqh rulings, historical fatwas, and standardized Islamic contract templates. A multi-stage RAG pipeline—encompassing dense vector embedding, semantic retrieval from a high-dimensional knowledge base, and contextually grounded LLM reasoning—is employed to evaluate contractual clauses against established Shariah principles. Critically, the architecture incorporates a Dynamic Knowledge Caching layer that stores frequently queried compliance outcomes, thereby reducing query latency by an estimated 67% and computational overhead by up to 45% at production scale. A simulated case study evaluating a Mudaraba (profit-sharing) contract demonstrates the system's capacity to flag non-compliant clauses—such as fixed-return guarantees—and generate Shariah-aligned revisions. The framework maintains a mandatory Human-in-the-Loop (Shariah scholar) verification stage, ensuring auditability and religious legitimacy. Results indicate substantial efficiency gains, with contract review time reduced from an average of 8–12 hours to under 3 minutes, while achieving a clause-level retrieval precision of 91.4% against AAOIFI benchmarks. This work establishes a scalable, explainable, and institutionally viable pathway toward AI-augmented Shariah governance.












