Instructions to use baogiadoan/Llama-3.1-8B-Instruct-DoRA-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use baogiadoan/Llama-3.1-8B-Instruct-DoRA-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct") model = PeftModel.from_pretrained(base_model, "baogiadoan/Llama-3.1-8B-Instruct-DoRA-adapter") - Notebooks
- Google Colab
- Kaggle
Llama-3.1-8B-Instruct — DoRA adapter
Built with Llama.
A LoRA adapter for meta-llama/Llama-3.1-8B-Instruct, fine-tuned on the
synthetic training split of DoRA (Domain-oriented RAG Assessment) for
grounded question answering over specialist-domain documents.
📄 Paper · 💻 Code · 📊 Dataset
Naming note. "DoRA" here is the framework — Domain-oriented RAG Assessment. This adapter uses standard LoRA, not Weight-Decomposed Low-Rank Adaptation (Liu et al., 2024).
Results
Evaluated on the 1,259-instance DoRA test set with GTE retrieval (top-k=3). Mean ± std over three fine-tuning seeds; baselines over three inference runs.
| Model | ROUGE-L-R ↑ | Tok-R ↑ | Completeness ↑ | Hallucination ↓ |
|---|---|---|---|---|
| Llama-3.1-8B-Instruct (base) | 63.30±0.80 | 62.76±0.74 | 66.72±0.51 | 4.75±0.23 |
| This adapter | 69.12±0.19 | 71.13±0.16 | 73.37±0.40 | 2.17±0.35 |
| Gain vs base | +5.82 | +8.37 | +6.65 | +2.58 |
Every gain is significant under a paired bootstrap test (10,000 resamples, p < 0.001). Hallucination is more than halved. Gains persist across alternative retrievers, gold evidence, and matched answer-length budgets.
Training
| Base model | meta-llama/Llama-3.1-8B-Instruct |
| Method | LoRA (PEFT) |
| Rank / alpha / dropout | 64 / 128 / 0.05 |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| Epochs | 3 (checkpoint 900) |
| Learning rate | 1e-5 |
| Batch size | 4 × grad-accum 4 |
| Max sequence length | 4096 |
| Precision | bf16, gradient checkpointing |
| Training data | 5,052 train / 266 validation, generated by Claude Sonnet over a seed corpus disjoint from the test corpus |
Three seeds are released. Seed 42 (the primary model reported in the paper) is at
the repository root; seeds 2 and 3 are under seed2/ and seed3/.
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_id = "meta-llama/Llama-3.1-8B-Instruct"
model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, "baogiadoan/Llama-3.1-8B-Instruct-DoRA-adapter")
tokenizer = AutoTokenizer.from_pretrained(base_id)
The model expects the grounded prompt used throughout the paper — retrieved context, then the question:
You are provided with grounded evidence. Use only this context to answer.
If the evidence is insufficient, respond with "I don't have enough context."
Context:
{context}
Question:
{question}
Answer:
That template is released as prompts/evaluation/grounded_inference.yaml in the
code repository. Behaviour will differ if you prompt it another way.
Intended use and limitations
Built for grounded, evidence-attributed QA over specialist-domain documents. It is trained to answer from supplied context and to decline when the evidence is insufficient — it is not a general-purpose assistant and should not be used as a knowledge source without retrieval.
The training corpus is Australian defence-related public policy documents. The paper's evaluation is in that domain, and transfer to other specialist domains is untested. Answers are markedly more verbose than the reference answers (length ratio ≈ 5×); the paper includes a truncation analysis showing the coverage gains survive matched length budgets.
This is a research artifact. It has not been safety-tuned beyond the base model's alignment, and it should not be used for operational decision-making.
Licence
Governed by the Llama 3.1 Community License
as a derivative of meta-llama/Llama-3.1-8B-Instruct. You must comply with that
agreement and the Llama 3.1 Acceptable Use Policy. Built with Llama.
Citation
@misc{doan2026benchmarkconstructionevaluationframework,
title={A Benchmark Construction and Evaluation Framework for Specialist Domains: Case Study on Defense-related Documents},
author={Bao Gia Doan and Aditya Joshi and Pantelis Elinas and Aarya Bodhankar and Oscar Leslie and Tom Marchant and Flora Salim},
year={2026},
eprint={2604.17943},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2604.17943},
}
- Downloads last month
- -
Model tree for baogiadoan/Llama-3.1-8B-Instruct-DoRA-adapter
Base model
meta-llama/Llama-3.1-8B