TL;DR
IBM Research introduces a library of "LLM Intrinsics" for Retrieval-Augmented Generation (RAG)—standardized, reusable modular capabilities (such as query rewriting, hallucination detection, and citation generation) exposed via stable APIs. Implemented primarily as lightweight LoRA adapters on top of IBM Granite models, these intrinsics provide developers with a clean, interchangeable software pattern to build and optimize complex RAG pipelines without being locked into specific prompt structures or model backends.
What Problem Does This Paper Address?
While Retrieval-Augmented Generation (RAG) has become the standard architecture for grounding LLMs in external knowledge, the developer ecosystem lacks the structural maturity of traditional software engineering. Currently, there are no universally agreed-upon APIs or modular software libraries for RAG components. Prompt engineering remains highly fragile and model-specific, making it incredibly difficult to swap out components or collaborate at scale.
Taking inspiration from hardware and compiler design—where "intrinsics" provide fixed, highly optimized functional blocks abstracted away from the underlying architecture—the authors address this fragmentation by defining and implementing a standardized library of modular LLM capabilities.
Methods
The authors define an LLM Intrinsic as a specific capability invoked through a well-defined, stable API, independent of its underlying implementation.
The library introduces eight distinct RAG intrinsics, mapped across different stages of the RAG lifecycle:
- Pre-Retrieval: Query Rewrite (QR), Query Expansion (QE)
- Pre-Generation: Context Relevance (CR), Answerability Determination (AD), Passage Reranking (PRR)
- Post-Generation / Guardrails: Uncertainty Quantification (UQ), Hallucination Detection (HD), Citation Generation (CG)
Six of these intrinsics are implemented as fine-tuned LoRA adapters built on top of the ibm-granite/granite-3.3-8b-instruct base model. The remaining two (Query Expansion and Passage Reranking) are pure software-based algorithmic implementations. To ensure production readiness, the library is exposed via Granite IO Processing, a co-optimized software layer built on top of the vLLM inference platform that guarantees strictly structured JSON inputs and outputs.
Datasets
The LoRA adapters were fine-tuned using a mix of proprietary datasets and synthetically generated multi-turn conversations validated by automatic judges (like Mixtral). The seed data originated from several public corpora:
- Context Relevance & Answerability: CLAPNQ, DROP, HotpotQA, SQuADV2, FinanceBench, BioASQ, and the MT-RAG benchmark.
- Hallucination & Citation: RAGTruth, CoQA Wikipedia Passages, MultiDoc2Dial, and QuAC.
Evaluation was performed across standard benchmarks specific to each task, including BEIR for passage reranking, RAGTruth for hallucination detection, and ALCE / LongBench-Cite for citation accuracy.
Key Insights and Ideas
- Decoupling API from Implementation: An intrinsic can be a LoRA adapter, a prompt, or a pure software script. By standardizing the interface, developers can swap a lightweight 8B model adapter for a larger model prompt without changing a single line of application code.
- The Power of Post-Hoc Processing: Intrinsics like Citation Generation and Hallucination Detection take the generated assistant response as an input. This allows them to function as universal, post-hoc guardrails capable of evaluating and citing text generated by any external LLM provider.
- Emergent Complexity in Composition: When combining multiple intrinsics (e.g., Query Rewrite + Answerability Determination), the components interact dynamically. Rewriting a query changes what the retriever fetches, which directly alters the context available for determining if a question is answerable.
Key Results
The modular intrinsics consistently matched or exceeded the performance of much larger, state-of-the-art models:
- Query Rewrite (QR): On the MT-RAG benchmark, the Granite 3.3 8B LoRA adapter achieved a
Recall@20score of 0.76, marking a 9 percentage point jump over the no-rewrite baseline and performing on par with human-crafted "gold" rewrites.
- Hallucination Detection (HD): Evaluated on the RAGTruth QA benchmark, the Hallucination Detection LoRA achieved an F1 score of 68.6, significantly outperforming zero-shot prompted GPT-4-turbo (45.6) and matching a fully finetuned Llama-2-13B model.
- Citation Generation (CG): On the LongBench-Cite benchmark, the 8B LoRA adapter achieved an average F1 score of 68.6 when generating span-level citations, drastically outperforming a prompted Llama-3.1-70B-Instruct model (42.0).
Limitations and Future Work
While the APIs are stable and model-agnostic, the current weights for the trained adapters are tightly coupled with the IBM Granite 3.3 8B base model. Porting these capabilities to other model families requires separate training.
Additionally, the authors note that combining multiple intrinsics can occasionally lead to conflicting or puzzling edge cases (e.g., a system reporting high uncertainty but low hallucination risk simultaneously). Future work will focus on optimizing the software layer for set-wise passage reranking (moving away from pairwise tournaments) and developing more sophisticated orchestration frameworks to handle complex composite flows.
Summary updated