Optimized Transformer Models for FAQ Answering

Sonam Damani, Kedhar Nath Narahari, Ankush Chatterjee, Manish Gupta, Puneet Agrawal

Introduction

Frequently Asked Questions (FAQ) pages serve as critical information repositories, yet navigating them remains a challenge for users. Retrieval-based chatbots aim to bridge this gap by matching user queries to relevant (Question, Answer) pairs. However, traditional keyword-based systems like BM25 often fail to capture semantic nuances, while state-of-the-art Transformer models like BERT are frequently too computationally expensive for real-time production environments. Researchers at Microsoft have addressed this trade-off with MMT-DNN (Masked Multi-task Deep Neural Network), a novel architecture and distillation pipeline that achieves high semantic accuracy with significantly reduced latency.

Methodology

The MMT-DNN Architecture

Unlike standard Transformers that process a concatenated string of (Query, Question, Answer), MMT-DNN employs a specialized multi-stage encoding process designed to isolate specific relevance signals.

The MMT-DNN architecture utilizing split encoders for Query-Question and Query-Answer relevance.

The architecture consists of two primary components:

  1. Encoder 1: Initial layers process the full triple to establish a broad contextual foundation.
  2. Encoder 2: Subsequent layers are split into parallel branches. One branch masks the answer to isolate the Query-Question relationship, while the other masks the question to focus on the Query-Answer relationship.

This "masking trick" prevents the model from being distracted by irrelevant segments of the input, allowing it to learn more precise relevance signals than joint encoding alone.

Knowledge Distillation and Optimization

To transition from a 12-layer "Teacher" model to a production-ready "Student" model, the authors implemented an advanced knowledge distillation pipeline:

  • Layer-Specific Initialization: The 3-layer student model is initialized using the teacher's intermediate layers (specifically layers 2, 3, and 4), which were found to contain the most transferable knowledge.
  • Unlabeled Data Leveraging: A massive dataset of 15 million unlabeled queries was used to generate "soft targets" from the teacher, enabling the student to mimic complex decision logic without requiring additional hand-labeled data.
  • Compiler Optimization: The TVM compiler was utilized to optimize the final model for CPU inference, further squeezing out performance gains.

Experimental Setup

The models were evaluated on two benchmarks:

  1. SemEval-2017 CQA Task 3: A standard community question-answering dataset.
  2. FAQ Search Dataset (FSD): A new, large-scale dataset introduced in this research, comprising ~281,000 instances across diverse domains such as banking and tourism. FSD is approximately 20 times larger than SemEval, providing a rigorous test for real-world scalability.

Results and Discussion

MMT-DNN established new state-of-the-art performance, achieving an NDCG@1 of 83.1 on SemEval and 75.38 on FSD. Beyond accuracy, the optimization efforts yielded dramatic efficiency gains essential for deployment.

Production-ready FAQ search and chatbot interface achieving 31ms latency.

The final production model occupies only 174 MB (a 2.4x reduction from 417 MB) and achieves an inference latency of 31ms per query on standard CPUs—a 7x improvement over the original 225ms. These results demonstrate that semantic search can be both highly accurate and fast enough for real-time interaction in commercial chatbots.

Conclusion

The MMT-DNN framework successfully balances semantic depth with operational efficiency. While the model significantly improves FAQ retrieval, the authors note that "Verbose Match" errors—where unimportant filler words trigger incorrect matches—remain a primary area for future improvement. Future work will explore more sophisticated negative sampling and handling of long-form text to further refine the system's precision.

Summary updated

BibTeX
@inproceedings{damani2020optimized,
  author = {Sonam Damani and Kedhar Nath Narahari and Ankush Chatterjee and Manish Gupta and Puneet Agrawal},
  title = {{Optimized Transformer Models for FAQ Answering}},
  booktitle = {PAKDD},
  year = {2020},
  doi = {10.1007/978-3-030-47426-3\_19},
}
Figure