Skip to content
Robotics.world

Research

RAG-Based Auto-Configuration for Industrial Fieldbus Devices

Commissioning an industrial field device today means an engineer reads heterogeneous PDF manuals, finds hundreds of protocol-specific parameters (register addresses, baud rates, station addresses…

The paper’s first page · arXiv:2608.08618
arXiv
2608.08618 · Preprint · not peer-reviewed
Published
2026-08-09
Authors
Aadil Gani Ganie, Saad Ezzini, Naveed Farooz Marazi

In plain words

Commissioning an industrial field device today means an engineer reads heterogeneous PDF manuals, finds hundreds of protocol-specific parameters (register addresses, baud rates, station addresses, PDO mappings), and retypes them into a SCADA/DCS system — work the paper says can consume hundreds of engineering hours per cycle and up to 30% of project cost in greenfield deployments.

AI summary

Overview

Research area: Industrial automation and robotics — specifically retrieval-augmented generation (RAG) applied to fieldbus device commissioning in Industrial IoT (IIoT) settings. Technical level: Advanced. The paper assumes familiarity with retrieval fusion methods, ontology standards (ECLASS, AAS, SOSA/SSN), SHACL validation, JSON-LD, and industrial protocols. Scope: The paper presents CLARITY, a six-stage pipeline that converts PDF device manuals and natural-language requests into validated, deployed configuration for Modbus RTU, OPC-UA, Profibus DP, and CANopen devices, evaluated component-by-component plus a case study on a Universal Robots UR5e.

What This Paper Is About

Commissioning an industrial field device today means an engineer reads heterogeneous PDF manuals, finds hundreds of protocol-specific parameters (register addresses, baud rates, station addresses, PDO mappings), and retypes them into a SCADA/DCS system — work the paper says can consume hundreds of engineering hours per cycle and up to 30% of project cost in greenfield deployments. The goal is to automate this end-to-end while guaranteeing that the system never writes a plausible-but-wrong value to hardware. The authors' answer is to ground a local LLM's output in retrieved manual evidence, wrap it in ontology-aligned JSON-LD, validate it formally, and abstain rather than guess when the evidence is thin.

Key Contributions

  1. Hybrid retrieval with ontology-graph boosting. Dense BGE-M3 embeddings (1024-dimensional) and BM25 results are fused with Reciprocal Rank Fusion (constant k = 60), each chunk receiving a +0.1 boost when an ECLASS/AAS/SOSA/SSN ontology label appears verbatim, then reranked by a cross-encoder down to the top-5 passages passed to the LLM.
  2. Protocol-specific JSON-LD generation with automatic repair. A local llama3.1:8b model (temperature 0.1, 2048 tokens, via Ollama) fills protocol-specific prompts and emits ontology-aligned JSON-LD; a four-step deterministic repair pass (strip JS comments, remove trailing commas, normalise Python literals, fix quoting) runs before parsing, and at least one repair step fired in 11 of 15 benchmark runs.
  3. A two-stage, formally motivated abstention gate. A pre-LLM gate requires both a sigmoid cross-encoder score s_max ≥ τ = 0.72 and an IRI resolution ratio ρ_iri ≥ 0.80; a post-LLM gate scans only the prose outside the JSON block for uncertainty markers. The gate's calibration is characterised empirically rather than assumed.
  4. Four protocol adapters plus a released component-wise evaluation harness. Adapters for Modbus RTU, OPC-UA, Profibus DP, and CANopen enforce deterministic safety constraints before any network I/O (e.g., Modbus registers in [1, 65534] with 0 and 65535 permanently blocked, function codes in {1,2,3,4,5,6,15,16}, Profibus station addresses in [0,125], CANopen node IDs in [1,127]), verify every write by read-back, and log a provenance_trail (document, page, confidence) per chunk for IEC 62443 auditability.

Main Findings

  • Fusion beats either retrieval signal alone. On 28 gold field-level queries over 71 chunks, hybrid RRF reaches HitRate@10 of 0.964 versus 0.929 for both dense-only and sparse-only. The authors attribute this to complementary failure modes: BM25 wins exact identifiers such as P0918 and 0x18A, while dense embeddings win paraphrases.
  • Reranking buys calibration more than raw accuracy. The cross-encoder raises MRR@10 from 0.557 to 0.625 and nDCG@10 from 0.634 to 0.679, and lowers the mean first-relevant rank from 3.50 to 3.18 (rank 27 to rank 9 in the extreme case). It is not uniformly positive: one query's chunk left the top-5, dropping HitRate@5 from 0.893 to 0.857. Its decisive benefit is that the sigmoid score is bounded, unlike unbounded RRF and BM25 scores.
  • Documented and undocumented queries separate cleanly on the synthetic benchmark. Every documented query scores s_max ≥ 0.526 and every out-of-corpus query scores s_max ≤ 0.061 — an 8.6× separation with no overlap, so any threshold τ in (0.061, 0.526) yields abstention precision = recall = 1.0.
  • The production threshold errs safe. At τ = 0.72, hard field-level queries produce one false abstention (precision 0.833, recall 1.0); device-level commissioning queries reach s_max ≥ 0.99, so no false abstention occurs at that granularity.
  • Generation is strong except on OPC-UA. Micro-averaged over 12 runs: precision 0.830, recall 0.907, field-level F1 0.867, exact match 9/12. Modbus RTU, Profibus DP, and CANopen each score 1.000 with 3/3 exact matches; OPC-UA scores 0.000 with 0/3.
  • The systematic failure is localised, not hidden. The OPC-UA prompt demonstrably contained the required node identifiers (five occurrences of ns=2;i=1001), yet llama3.1:8b emitted only the server endpoint and omitted the mandated clarity:nodes array. The OPC-UA SHACL shape does not yet mandate a non-empty node array — a gap the evaluation exposed — so the incomplete configuration was caught one layer later by deployment verification.
  • End-to-end runs are fast and fail loudly. Across 15 runs on one NVIDIA H100, documented devices complete in 2.6–6.6 s: TH200 (Modbus) 3/3 deployed in 6.5 s, PS500 (OPC-UA) 0/3 due to the generation defect at 3.6 s, VFD300 (Profibus) 2/3 with one false abstention at 3.4 s, ENC100 (CANopen) 3/3 at 3.1 s, and Legacy XYZ abstaining correctly 3/3 in 0.5 s. Validity rate was 1.0, zero unsafe writes occurred, and failure detection was 100% — every unsuccessful run ended in an explicit abstention or a deployment-verification error, never a silently wrong configuration. End-to-end abstention precision/recall was 0.75/1.0.
  • The LLM dominates latency. Per-stage means on the H100: query embedding 248 ms, dense+BM25 search <2 ms, reranking 449 ms, LLM generation 4.69 s (about 87%), SHACL 10 ms, deployment 29 ms. CPU-only inference took 35–93 min (0.8 vs. roughly 120 tokens/s). On a CPU node, retrieval alone costs 59 ms to embed, <1 ms to search, and 321 ms to rerank 20 candidates.
  • More retrieved context is slower and riskier. Sweeping k ∈ {1,3,5,10} on TH200, latency rose from 2.4 s to 7.3 s while field F1 was non-monotonic: at k = 3 a distractor chunk displaced a needed one and cost a field (F1 0.667), whereas k = 5 held the evidence in a roughly 1.4k-token prompt at F1 1.0.
  • Ablation confirms each component earns its place. In a single CPU-host run per configuration where all four documented devices deployed: full CLARITY 4/4; removing BM25 3/4 (VFD300's station address is only retrievable by exact-term matching); removing dense retrieval 2/4; removing the pre-LLM gate still 4/4 but wasting 73 min on the undocumented device; removing JSON repair 1/4; removing SHACL still 4/4 but a reserved register address of 0 would pass undetected to the field.
  • The UR5e case study transfers to real documentation. Using unmodified vendor material (a 254-page user manual and an 8-page register list, 496 chunks) and a MuJoCo physics simulation behind the robot's documented Modbus TCP server, CLARITY generated and deployed the correct configuration in all three runs at field-level F1 = 1.0 (exact match), in 4.2 and 4.7 s per warm run and 14.0 s including one-off model load. A sentinel preload of 60000 confirmed writes originated from CLARITY; read-back returned 128:0, 129:0, 130:0, 131:1; robot-mode register 258 read 7 (Running); and 18 joint-angle comparisons matched simulator ground truth within tolerance with values changing between reads taken 1 s apart.
  • Real manuals break the calibration. On the layout-heavy UR5e manual, hybrid HitRate@10 falls to 0.40 and the documented/undocumented s_max separation narrows to [0.070, 0.156], so τ = 0.72 would falsely abstain on five valid field queries; recalibrating to the separation midpoint of 0.113 restores correct decisions on all 12 gold queries.

Methodology in Plain English

The pipeline works in six steps. First, PDF manuals are cut into 512-token chunks with 64-token overlap — chosen so register-map rows are not split — and turned into searchable vectors while also being indexed for exact keyword matching. Second, a natural-language request is answered by combining the two search styles, giving a small bonus to chunks that contain a recognised ontology term, and then re-scoring the candidates with a second model that reads the query and each chunk together, keeping the best five.

Third, before the language model is invoked at all, a gate checks two things: is the best reranked passage confident enough, and do the ontology identifiers referenced in that passage actually exist in the loaded vocabularies? If either check fails, the system refuses. Fourth, if it proceeds, a small local language model fills a protocol-specific template and produces JSON-LD, with a deterministic cleanup pass for the malformed JSON that small models frequently emit. Fifth, a fifth gate looks for hedging language in the model's prose, and only then is the JSON-LD checked against protocol-specific SHACL shapes encoding required properties, datatypes, and value ranges. Sixth, only configurations that pass are written to a device — against protocol simulators or structural simulation — with every value read back and compared.

The evaluation deliberately separates the stages. The retriever is scored on rank metrics against gold relevance labels that are evidence-grounded (a chunk counts as relevant only if it contains the exact manual statement of the gold value), the generator is scored field-by-field against gold configurations, and the pipeline is scored on deployment success, abstention behaviour, and latency. The authors then disable one component at a time to see what breaks, run the unchanged system on real UR5e vendor documentation, and analyse three prompt-injection threat vectors against the layered defences.

Why This Matters

Impact on research. The paper makes the case that end-to-end success rates alone conceal real defects. Its own headline number — zero unsafe writes across 15 runs — is achieved partly because a broken OPC-UA configuration was caught downstream rather than generated correctly; only the component-wise breakdown reveals that the generator, not the retriever, is at fault and that the OPC-UA SHACL shape has a gap. That methodological point, plus the abstention-as-conformity-measure framing and the released harness with evidence-grounded labels, gives other industrial-LLM researchers a template for evaluation that does not reward silent failure.

Real-world applications.

  • Greenfield plant commissioning, where the paper reports manual parameter extraction can consume up to 30% of project cost.
  • Brownfield retrofits and legacy device onboarding, where the abstention gate's 0.5 s refusal on the undocumented "Legacy XYZ" device avoids an expensive LLM round-trip and an unsafe guess.
  • Collaborative robot cell bring-up, demonstrated concretely by commissioning a UR5e from its unmodified 254-page manual and 8-page register list.
  • Auditable configuration management in regulated environments, via the per-chunk provenance_trail (document, page, confidence) logged for IEC 62443 auditability.

Industry relevance. The economics are the argument: 2.6–6.6 s per device on a single H100 versus 35–93 min on CPU-only inference turns commissioning from a batch job into an interactive one. The architecture is also maintenance-friendly by design — new devices, manuals, or ontology revisions are onboarded by re-chunking and re-embedding the affected documents and reloading the ECLASS/AAS/SOSA graph, with no retraining, so post-deployment upkeep is an ingestion operation rather than a model update. The paper's comparison table places CLARITY against LLM4PLC, Agents4PLC, Vendor-Aware Agents, and Advanced RAG, positioning it as the only one combining hybrid retrieval, ontology-aligned output, formal validation, multi-protocol deployment, and an abstention gate; the abstract describes this as a comparison with five industrial-LLM systems.

Future Directions

  • Layout-aware ingestion for brownfield catalogues. HitRate@10 collapsing to 0.40 on the UR5e manual is direct evidence that multi-column tables and scanned pages need stronger document-layout extraction; the authors name LayoutLM as a candidate and call for a larger gold set beyond the current 28 field-level queries.
  • Formal abstention guarantees. The threshold sweep gives an empirical band, and the UR5e run shows τ must be recalibrated per corpus (0.113 there versus the production 0.72). A conformal calibration on a held-out set would supply a formal 1−α coverage guarantee.
  • Closing the two identified defects. Schema-constrained decoding or few-shot node examples to fix llama3.1:8b's OPC-UA output, and an OPC-UA SHACL shape that additionally mandates a non-empty node array.
  • Revision handling, provenance hardening, and protocol coverage. When manual revisions disagree, CLARITY currently ranks purely by relevance; the logged provenance_trail already carries the metadata needed for a revision- or reliability-weighted prior in RRF. The residual security risk — a plausible in-range value that reranks highly and evades SHACL — is to be mitigated by document signing and chunk-level provenance attestation. Stated future work also includes quantisation benchmarking, adapters for HART 7, EtherNet/IP, and IO-Link, and AAS Technical Data submodel integration.

Target Audience

Industrial automation and IIoT engineers evaluating whether LLM-based tooling is safe enough for production commissioning; RAG researchers interested in abstention, ontology-grounded generation, and component-wise evaluation design; and robotics and manufacturing-systems practitioners working on device integration, digital twins, and Asset Administration Shell interoperability. It is also useful for reliability and security reviewers who need to see how a system fails rather than only how often it succeeds. Readers without background in fieldbus protocols, RDF/SHACL, or retrieval metrics will find the system architecture and case study accessible but the evaluation dense.

Authors’ abstract

Industrial device commissioning requires engineers to manually extract hundreds of protocol-specific parameters from heterogeneous PDF manuals and transcribe them into supervisory control systems, a time-intensive, error-prone workflow. This paper presents SysName, a production-oriented pipeline that automates device configuration end-to-end for Modbus RTU, OPC-UA, Profibus DP, and CANopen. It builds a hybrid dense-sparse retrieval index augmented by an ontology graph…

The full abstract on arXiv
Read the original paper