Improving LLM Domain Certification with Pretrained Guide Models

Jiaqian Zhang, Zhaozhi Qian, Faroq Al-Tam, Ignacio Iacobacci, Muhammad Al-Qurishi, Riad SouissiEACL (Volume 1: Long Papers) 2026

TL;DR

This paper introduces PRISM, a novel framework for domain certification of Large Language Models (LLMs). PRISM leverages pretrained language models as "guide models" to ensure LLMs stay within their intended domain, significantly improving out-of-domain rejection and certification tightness compared to previous methods. This is crucial for deploying LLMs safely in high-stakes applications like healthcare and finance.

What Problem Does This Paper Address?

Large Language Models (LLMs) are incredibly powerful but can generate harmful, off-topic, or misleading responses when used in specialized domains. This is especially problematic in critical areas like healthcare or finance, where such errors can have serious consequences. While existing methods like alignment and safety fine-tuning aim to control LLM behavior, they are often vulnerable to adversarial attacks and lack rigorous guarantees.

The VALID algorithm (Emde et al., 2025) proposed a formal way to certify LLM domain adherence by using a "guide model" trained from scratch on in-domain data. However, this approach suffers from poor generalization due to limited training data. PRISM aims to overcome this limitation by using pretrained language models as guide models, which are then fine-tuned to distinguish between acceptable and unacceptable content within a specific domain.

Methods

PRISM's core innovation lies in its use of pretrained language models as guide models (G), rather than training them from scratch. This leverages the rich world knowledge already present in these models. The key challenge is that pretrained models might assign high likelihoods to out-of-domain (OOD) content. To address this, PRISM employs specialized contrastive fine-tuning objectives to train the guide model G.

The paper explores several fine-tuning strategies:

  • PRISM-GA (Gradient Ascent): Combines standard cross-entropy loss on in-domain data with a negative cross-entropy loss on out-of-domain data. This aims to increase likelihood for in-domain and decrease it for OOD content.
  • PRISM-NPO (Negative Preference Optimization): Adapts a loss function from machine unlearning to prevent excessive deviation from the initial policy, mitigating catastrophic collapse.
  • PRISM-DPO (Direct Preference Optimization): Uses preference pairs (in-domain vs. out-of-domain) to align the guide model.
  • PRISM-BC (Binary Classification): Reformulates the guide model as a binary classifier that directly assigns scores to in-domain vs. out-of-domain responses.

These PRISM variants are then used within the VALID framework for certification.

Datasets

  • In-Domain Training Data (DT): PubMedQA (Jin et al., 2019), a dataset of medical question-answer pairs. A subset of 20k examples was used to simulate realistic data constraints.
  • Out-of-Domain Training Data (DF): A combination of 20k samples from:
  • SQuAD (Rajpurkar et al., 2016): General knowledge question-answering dataset.
  • ShareGPT (RyokoAI, 2023): Real user prompts and ChatGPT responses.
  • Megpie-Llama-3.1 (Xu et al., 2024b): Synthetic dataset generated by LLaMA 3.1 models.
  • Unseen OOD Test Sets:
    • LMSYS-Chat-1M (Zheng et al., 2023): One million real-world dialogues from 25 LLMs.
  • WildChat (Zhao et al., 2024): Real user conversations with GPT-3.5 and GPT-4.
  • Perturbed Test Set: A dataset of medical misinformation created by inverting correct answers and generating false explanations to test robustness.
  • Math Questions with Medical Framing: A dataset of 100 math problems disguised as medical stories to test domain generalization.

Key Insights and Ideas

  • Pretrained models are better guides: Using pretrained LLMs as guide models significantly improves generalization and performance compared to training from scratch, especially with limited in-domain data.
  • Fine-tuning is key: While pretrained models have broad knowledge, targeted fine-tuning with contrastive objectives is crucial to make them effective domain-specific judges.
  • PRISM-BC and PRISM-GA excel: These two variants consistently show the best performance in terms of OOD rejection and certification tightness across various evaluations.
  • Trade-offs in alignment: Methods like DPO/NPO, while good for general alignment, can be sensitive to regularization parameters, impacting the balance between certification bounds and detection accuracy.
  • Domain certification is more than just detection: The "Median Constriction Ratio" metric effectively captures how well the certification mechanism tightens the bounds on LLM behavior, which is critical for practical safety guarantees.

Key Results

  • PRISM consistently outperforms the VALID baseline in both OOD rejection accuracy and certification tightness across diverse data regimes and perturbations.
  • PRISM-BC achieved near-perfect detection (F1 > 0.999) with negligible False Positive Rates (FPR) in various challenging scenarios, including unseen OOD data and perturbed misinformation.
  • PRISM-GA demonstrated the highest Median Constriction Ratio (CR), indicating substantially tighter and more informative certification bounds, especially in scenarios requiring moderate FPR. For instance, on the Shakespeare dataset, PRISM-GA achieved a Median CR of 14061.69 compared to VALID's 206.33.
  • On the math questions with medical framing task, PRISM-BC achieved perfect detection (F1=1.0, FPR=0.0), while VALID(200k) struggled with an F1 score of 0.482.
  • PRISM's performance was robust to the choice of guide model architecture, showing strong results even with a smaller Qwen-0.6B model.

Limitations and Future Work

  • Context-agnostic certification: Like VALID, PRISM's certification relies solely on the response y and does not consider the input prompt x. This can lead to incorrect acceptance of plausible responses that are inappropriate given the prompt. The authors suggest that fine-tuning the base LLM L to produce more explicit, self-contained responses could partially mitigate this.
  • Future Work: The paper suggests developing a truly context-aware certification framework as an important future direction.

Summary updated

BibTeX
@inproceedings{zhang2026improving,
  author = {Jiaqian Zhang and Zhaozhi Qian and Faroq Al-Tam and Ignacio Iacobacci and Muhammad Al-Qurishi and Riad Souissi},
  title = {{Improving LLM Domain Certification with Pretrained Guide Models}},
  booktitle = {EACL (Volume 1: Long Papers)},
  year = {2026},
  doi = {10.18653/v1/2026.eacl-long.69},
}

Loading related content...

Figure