Optimizing Retrieval Augmented Generation for Object Constraint Language
On the map: Retrieval-augmented generation → RAG pipeline design and evaluation
Abstract (arXiv)
The Object Constraint Language (OCL) is essential for defining precise constraints within Model-Based Systems Engineering (MBSE). However, manually writing OCL rules is complex and time-consuming. This study explores the optimization of Retrieval-Augmented Generation (RAG) for automating OCL rule generation, focusing on the impact of different retrieval strategies. We evaluate three retrieval approaches unicodex2013 BM25 (lexical-based), BERT-based (semantic retrieval), and SPLADE (sparse-vector retrieval) unicodex2013 analyzing their effectiveness in providing relevant context for a large language model. To further assess our approach, we compare and benchmark our retrieval-optimized generation results against PathOCL, a state-of-the-art graph-based method. We directly compare BM25, BERT, and SPLADE retrieval methods with PathOCL to understand how different retrieval methods perform for a unified evaluation framework. Our experimental results, focusing on retrieval-augmented generation, indicate that while retrieval can enhance generation accuracy, its effectiveness depends on the retrieval method and the number of retrieved chunks (k). BM25 underperforms the baseline, whereas semantic approaches (BERT and SPLADE) achieve better results, with SPLADE performing best at lower k values. However, excessive retrieval with high k parameter can lead to retrieving irrelevant chunks which degrades model performance. Our findings highlight the importance of optimizing retrieval configurations to balance context relevance and output consistency. This research provides insights into improving OCL rule generation using RAG and underscores the need for tailoring retrieval.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Placed in RAG pipeline design and evaluation, one of 15 directions in Retrieval-augmented generation. Builds on 14 of its 19 references that are in the map. First posted on arXiv 19 May 2025.
Builds on
14 of 19 references.
Closest ancestors · 1
Same direction, newest first
Other references · 13
- 2023GPT-4 Technical Reportcited by 18,396
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2021SPLADE: Sparse Lexical and Expansion Model for First Stage Rankingcited by 286
- 2023Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMscited by 178
- 2022Large Language Models with Controllable Working Memorycited by 169
- 2024RAG vs Fine-tuning: Pipelines, Tradeoffs, and a Case Study on Agriculturecited by 81
- 2024Enhancing LLM Factual Accuracy with RAG to Counter Hallucinations: A Case Study on Domain-Specific Queries in Private Knowledge-Basescited by 77
- 2023On the Effectiveness of Large Language Models in Domain-Specific Code Generationcited by 44
- 2023L2CEval: Evaluating Language-to-Code Generation Capabilities of Large Language Modelscited by 22
- 2023On Codex Prompt Engineering for OCL Generation: An Empirical Studycited by 8
1 more
Built on by
Citing papers per year: 2025: 2; 2026: 2.
4 papers.
- 2025Survey of GenAI for Automotive Software Development: From Requirements to Executable Codecited by 5
- 2025GenAI for Automotive Software Development: From Requirements to Wheelscited by 5
- 2026Leveraging LLMs to support co-evolution between definitions and instances of textual DSLs: A Systematic Evaluationcited by 1
- 2026Why Do LLMs Fail at OCL Generation? A Graph Reasoning Perspectivecited by 0
- 2026Why Do LLMs Fail at OCL Generation? A Graph Reasoning Perspective6 Aug 2026
- 2026Leveraging LLMs to support co-evolution between definitions and instances of textual DSLs: A Systematic Evaluation12 Feb 2026
- 2025GenAI for Automotive Software Development: From Requirements to Wheels24 Jul 2025
- 2025Survey of GenAI for Automotive Software Development: From Requirements to Executable Code20 Jul 2025
Similar, not cited
Close in wording, no citation either way
- 2026Not All RAGs Are Created Equal: A Component-Wise Empirical Study for Software Engineering Tasks
- 2026Mapping the RAG Landscape: A Four Axis Taxonomy of Efficiency, Defense, Interactivity, and Reasoning
- 2024Towards Optimizing a Retrieval Augmented Generation using Large Language Model on Academic Data
- 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?
- 2023Retrieval-Augmented Generation for Large Language Models: A Survey
- 2024XRAG: eXamining the Core -- Benchmarking Foundational Components in Advanced Retrieval-Augmented Generation
- 2025Enhancing Retrieval-Augmented Generation: A Study of Best Practices
- 2024Contextual Compression in Retrieval-Augmented Generation for Large Language Models: A Survey