SearcharxivSearch

arXiv subjects

Bhavik Agarwal

Publications and source records attributed to Bhavik Agarwal.

3 recordsLinked to original sources

From Paper to Structured JSON: An Agentic Workflow for Compliant BMR Digital Transformation

Pharmaceutical manufacturers generate thousands of batch manufacturing records (BMRs) each year under FDA 21 CFR Part 211 and EU GMP rules. These long documents combine tables, calculations, images, and handwritten notes, and are usually digitized by hand with hours of expert review per record. We present an AI workflow that converts unstructured BMRs into structured JSON using token based chunking, parallel large language model extraction, and a fixed schema that covers 11 content types while preserving the original Group-Phase-Step hierarchy. The system applies three layers of validation (JSON syntax, structural integrity of classes and references, and pharmaceutical compliance checks aligned with GMP) and reports coverage metrics for text, tables, images, and calculations. On three real BMRs between 15 and 66 pages, it achieves composite confidence scores in the low to high eighties while reducing processing time from hours to minutes on a single GPU. This enables practical, human in the loop BMR digitization at scale and unlocks historical manufacturing data for downstream analysis.

cs.DL

RAGulating Compliance: A Multi-Agent Knowledge Graph for Regulatory QA

Regulatory compliance question answering (QA) requires precise, verifiable information, and domain-specific expertise, posing challenges for Large Language Models (LLMs). In this work, we present a novel multi-agent framework that integrates a Knowledge Graph (KG) of Regulatory triplets with Retrieval-Augmented Generation (RAG) to address these demands. First, agents build and maintain an ontology-free KG by extracting subject--predicate--object (SPO) triplets from regulatory documents and systematically cleaning, normalizing, deduplicating, and updating them. Second, these triplets are embedded and stored along with their corresponding textual sections and metadata in a single enriched vector database, allowing for both graph-based reasoning and efficient information retrieval. Third, an orchestrated agent pipeline leverages triplet-level retrieval for question answering, ensuring high semantic alignment between user queries and the factual "who-did-what-to-whom" core captured by the graph. Our hybrid system outperforms conventional methods in complex regulatory queries, ensuring factual correctness with embedded triplets, enabling traceability through a unified vector database, and enhancing understanding through subgraph visualization, providing a robust foundation for compliance-driven and broader audit-focused applications.

cs.AI

Think Inside the JSON: Reinforcement Strategy for Strict LLM Schema Adherence

In this paper, we address the challenge of enforcing strict schema adherence in large language model (LLM) generation by leveraging LLM reasoning capabilities. Building on the DeepSeek R1 reinforcement learning framework, our approach trains structured reasoning skills of a 1.5B parameter model through a novel pipeline that combines synthetic reasoning dataset construction with custom reward functions under Group Relative Policy Optimization (GRPO). Specifically, we first perform R1 reinforcement learning on a 20K sample unstructured-to-structured dataset, mirroring the original DeepSeek R1 methods, to establish core reasoning abilities. Subsequently, we performed supervised fine-tuning on a separate 10K reasoning sample dataset, focusing on refining schema adherence for downstream tasks. Despite the relatively modest training scope, requiring approximately 20 hours on an 8xH100 GPU cluster for GRPO training and 3 hours on 1xA100 for SFT, our model demonstrates robust performance in enforcing schema consistency. We compare our ThinkJSON approach against the original DeepSeek R1 (671B), distilled versions of DeepSeek R1 (Qwen-1.5B and Qwen-7B), and Gemini 2.0 Flash (70B), showcasing its effectiveness in real-world applications. Our results underscore the practical utility of a resource-efficient framework for schema-constrained text generation.

cs.CL