- Introduced by
- Multiple (e.g., Garg et al.; Yue et al.)
- Year
- 2019–2020
- Type
- Domain adaptation for extractive/generative QA
- Family
- Deep learning / NLP / CV
What does it do?
Domain-adaptive Question Answering (DA-QA) adapts a pre-trained transformer, such as BERT or RoBERTa, to answer questions in a specialised target domain (for example biomedical, legal or financial text) where labelled question-answer data is limited.
Two adaptation routes are common. One is a supervised two-stage transfer, in which the model is first fine-tuned on a general answer-sentence task and then on target-domain data, as in TANDA. The other is domain-adaptive pre-training (DAPT), in which masked language modelling continues on unlabelled target-domain text before fine-tuning. The benefit over direct fine-tuning depends on the domain and the data, so it should be checked on a held-out target-domain set.
The intuition behind the method
A QA model trained mainly on general encyclopedic passages learns reading-comprehension skills, but its vocabulary and reasoning habits may not match a specialised field. DA-QA adds a middle step in which the model reads a body of unlabelled target-domain text before it sees any target-domain questions. The aim is to shift its internal representations toward the new field, so that a small labelled set has more to work with during fine-tuning. The idea is similar to a student reading domain textbooks before practising exam questions.
History
The DA-QA label covers the transfer of pre-trained transformers, such as BERT, to specialised question-answering settings. Garg et al. (2020) proposed TANDA, which first fine-tunes a pre-trained transformer on a large general answer-sentence dataset and then adapts it to a target domain with a second supervised fine-tuning step. TANDA was evaluated on answer sentence selection using WikiQA and TREC-QA, and the authors also report an industrial setting with domain-specific datasets. Continued masked language modelling on unlabelled domain text (DAPT) is a separate, unsupervised technique and is not described in the TANDA work.
When to use it
Use DA-QA when you need question answering in a specialised domain, such as biomedical, legal, scientific or customer-support text, and general-purpose QA models perform poorly because of vocabulary or domain-specific reasoning. It is most relevant when unlabelled domain text is available but labelled question-answer pairs are scarce. Do not use it when the target domain is already well covered by the base model's pre-training data, since direct fine-tuning may be sufficient. Avoid DA-QA when predictions must be fully explainable and black-box neural models are not acceptable to the stakeholders.
Limitations and considerations
- DAPT requires a substantial corpus of unlabelled target-domain text and the compute to run masked language modelling on it, which can be costly.
- In retrieval-augmented systems, answer quality depends on passage retrieval; if the relevant passage is not retrieved, the reader cannot recover the answer.
- Extractive readers return spans that appear verbatim in a passage, so they cannot synthesise an answer that combines information across several passages.
- Confidence scores from fine-tuned transformers are often poorly calibrated, which makes it hard to tell when the system should abstain.
- The approach assumes the unlabelled corpus is representative of the target questions and passages; a corpus drawn from a different sub-domain may shift the model away from the questions users actually ask.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- The unlabelled-text adaptation step lets the model learn target vocabulary from domain text before any answer supervision is used. Whether this helps when labelled pairs are scarce can be tested against direct fine-tuning on the user's own data.
- The approach is compatible with different transformer backbones, so a domain-aware model such as BioBERT or a legal-domain model such as LegalBERT can be used as the starting point.
- Retrieval-augmented variants can search a large domain knowledge base instead of relying only on what the model has memorised.
- The two stages are separable: the domain adaptation or the target fine-tuning can be rerun when new unlabelled text or new labels become available.
- The TANDA abstract reports that its transfer step makes the subsequent adaptation more robust to noise in the fine-tuning data, which is relevant when target labels are noisy.
Applications
- Biomedical and clinical QA over PubMed abstracts or electronic health records.
- Legal QA for contract review and statute interpretation.
- Financial QA over earnings reports, filings, and regulatory documents.
- Customer-support automation using product manuals and knowledge bases.
- Scientific literature QA for rapid evidence synthesis in research workflows.
How it works
How it works
A transformer (BERT, RoBERTa, or a domain-aware variant such as BioBERT) is first trained on a large general QA-related dataset. In the TANDA approach (Garg et al., 2020), this transfer stage used a large dataset built from Natural Questions for answer sentence selection. The aim is to give the model general answer-locating skills before domain adaptation.
Domain-adaptive pre-training (DAPT) continues masked language modelling on unlabelled target-domain text, such as biomedical abstracts, legal filings or financial reports. This updates the model's token and contextual representations toward the target vocabulary without requiring labelled QA pairs. DAPT is distinct from the supervised second stage used in TANDA.
The adapted model is fine-tuned on whatever labelled QA data exists in the target domain, which may be a limited set of question-passage-answer examples. Extractive QA fine-tuning predicts the start and end token positions of the answer span. Generative variants instead predict a free-form answer string.
At inference time the model receives a question and a passage and outputs an answer span or generated text. Retrieval-augmented variants pair a passage retriever with the reader, so that relevant passages can be located in a domain knowledge base before the answer is produced.
Common pitfalls
- Fine-tuning directly on a small domain dataset without a domain adaptation step may underperform the full pipeline; this should be checked against a baseline on the same target data.
- If evaluation questions or passages appear in the DAPT corpus, the measured performance on the domain benchmark will be inflated.
- Feeding retrieved passages to the reader without a relevance filter can introduce distracting text and spurious answer spans.
- Reporting only Exact Match hides partial-credit answers; token-level F1 should be reported alongside it.
- A single adapted model may not transfer evenly across sub-domains of a broad field, such as different clinical specialties within biomedicine.
Frequently asked questions
How much unlabelled domain text is needed for DAPT to help?
There is no established minimum corpus size; the answer depends on the domain and on how close the corpus is to the target questions. The practical approach is to compare the adapted model against a baseline on a validation set, and to add domain text until the validation gain levels off.
Should I use an extractive or generative QA model?
Extractive models return only spans that appear verbatim in a passage, which makes their outputs easier to check against the source. Generative models can combine information across passages, but their outputs need separate verification before they are trusted.
What evaluation metrics should I report?
Report both Exact Match (EM) and token-level F1 on a held-out test set. For retrieval-augmented systems also report passage-level retrieval recall. Where labelled test data is unavailable, human evaluation of a random sample of answers is the fallback.
Can DA-QA work without any labelled target-domain QA pairs?
Not in the simple form of DAPT alone: DAPT is masked language modelling on unlabelled text and does not add an answer-prediction head, so it cannot by itself return answer spans. A zero-shot setting requires a model already trained for question answering, for example after the general QA stage, applied to target passages. Another option is to generate synthetic questions from domain passages and fine-tune on them; the effectiveness of this approach is not established by the sources cited here, so its results should be checked on held-out data.
Is domain-adaptive QA the same as fine-tuned QA?
No. Fine-tuned QA only updates the model on labelled QA pairs from the target domain. Domain-adaptive QA adds a DAPT step on unlabelled domain text before fine-tuning. Whether this step improves results must be tested against direct fine-tuning on a held-out target-domain set.
Related methods
Sources
Garg, S., Vu, T., & Moschitti, A. (2020). TANDA: Transfer and Adapt Pre-Trained Transformer Models for Answer Sentence Selection. Proceedings of the AAAI Conference on Artificial Intelligence, 34(5), 7780–7788.
Open DOI referenceYue, X., Zeng, Z., Shi, Y., Zhang, C., & Song, Y. (2022). Domain-adaptive Pre-training Methods for Natural Language Understanding. arXiv preprint.
Open publication reference