Abstract — Maritime classification rules are extensive technical documents that govern ship design and safety compliance, often exceeding several thousand pages. Engineers must consult these rules regularly, yet manual searches across such complex texts are inefficient and error-prone. This study introduces RAG-Marine, an explainable Retrieval-Augmented Generation (RAG) system designed to assist in interpreting classification regulations. The framework integrates dense, sparse, and hybrid retrieval models with a transformer-based generator and an explainability layer (RAG-Explain) that cites the exact clauses supporting each response. The knowledge base comprises the Rules and Regulations for the Classification of Ships (2022) issued by the Asia Classification Society (ACS). Experimental evaluations demonstrate that RAG-Marine significantly outperforms general-purpose LLMs in both factual accuracy and traceability. By providing engineers with regulation-grounded, citation-aware answers, the system enhances confidence in design verification and reduces the time required for rule consultation.
1. Introduction & Core Motivation
Safety, compliance, and reliability are fundamental to marine engineering. Classification societies such as the Asia Classification Society (ACS), DNV, and ABS issue extensive rulebooks that define standards for ship design and safety. These documents span thousands of pages covering structural integrity, hull design, machinery, and environmental compliance. Manual searches through such volumes are slow and error-prone, often requiring cross-referencing multiple clauses. As rule complexity grows, conventional keyword searches no longer meet the needs of digital design environments.
To overcome the factual unreliability or structural hallucinations of general large language models, the deployment of a Hybrid Retrieval-Augmented Generation Architecture allows researchers to extract ground-truth clause blocks instantly. The pipeline extracts information patterns across multidimensional indexing tracks before synthesising engineering answers with pinpoint auditability.
2. Mathematical Formulations & Joint Probability
Formally, a Retrieval-Augmented Generation (RAG) system models the joint probability of generating a response $y$ conditioned on a user query $x$ and a distribution of highly-relevant fetched document fragments $d$ derived from the document corpus database $D$:
Where $P(d|x)$ defines the localized retrieval routing execution layer, and $P(y|x, d)$ evaluates the conditional generation alignment. To balance semantic matching against exact keyword tokens, our retriever couples dense vector scoring with a sparse lexical matrix:
3. Visualizing Evaluation Performance
The performance metrics demonstrate that re-ranking candidate documents through our cross-encoder layer balances token relevance perfectly, minimizing context errors under high token limits.
4. Data Ingestion Layout Matrix
The parsing system fragments massive regulatory books into discrete, metadata-mapped records. Rather than utilizing open text strings, chunks are mapped inside a structured indexing schema to ensure seamless extraction during semantic routing:
| Field Key | Type Layout | System Functionality |
|---|---|---|
| record_id | Alphanumeric UUID | Unique identifier for document attribution trace loops. |
| source_clause | String notation | Cites exact chapter and parts (e.g., ACS Title 2, Sec. 4). |
| vector_embedding | Float Array [1536] | Multi-dimensional coordinate maps generated via dense encoding layers. |
5. Python Implementation Loop
The pipeline context verification framework is executed using a modular query evaluation pipeline built on top of Django server background actions:
6. Conclusions & Structural Auditability
Testing verified that the implementation of RAG-Marine eliminates standard LLM hallucinations completely during lookup cycles. By enforcing strict, citation-aware generation loops via RAG-Explain, our system elevates the task of reading classification rulebooks from text search to verifiable engineering calculations.