Skip to main content
QUICK REVIEW

[Paper Review] A Financial Service Chatbot based on Deep Bidirectional Transformers

Yu Shi, Yuxin Chen|arXiv (Cornell University)|Feb 17, 2020
Topic ModelingComputer Science53 references9 citations
TL;DR

This paper presents AVA, a task-oriented financial service chatbot built on fine-tuned BERT models to classify 381 intents with high accuracy. It introduces novel uncertainty quantification using Monte Carlo dropout and entropy-based thresholds to improve escalation decisions, and leverages BERT's masked language modeling for automatic spelling correction, boosting intent classification robustness in noisy inputs.

ABSTRACT

We develop a chatbot using Deep Bidirectional Transformer models (BERT) to handle client questions in financial investment customer service. The bot can recognize 381 intents, and decides when to say "I don't know" and escalates irrelevant/uncertain questions to human operators. Our main novel contribution is the discussion about uncertainty measure for BERT, where three different approaches are systematically compared on real problems. We investigated two uncertainty metrics, information entropy and variance of dropout sampling in BERT, followed by mixed-integer programming to optimize decision thresholds. Another novel contribution is the usage of BERT as a language model in automatic spelling correction. Inputs with accidental spelling errors can significantly decrease intent classification performance. The proposed approach combines probabilities from masked language model and word edit distances to find the best corrections for misspelled words. The chatbot and the entire conversational AI system are developed using open-source tools, and deployed within our company's intranet. The proposed approach can be useful for industries seeking similar in-house solutions in their specific business domains. We share all our code and a sample chatbot built on a public dataset on Github.

Motivation & Objective

  • To develop a reliable, in-house task-oriented chatbot for financial customer service that reduces call handling time and expert dependency.
  • To address the challenge of handling out-of-scope or ambiguous queries by enabling accurate escalation to human agents using uncertainty-aware decision-making.
  • To improve intent classification robustness in real-world noisy inputs by integrating BERT-based automatic spelling correction.
  • To optimize inference efficiency without significant accuracy loss through model distillation and architectural pruning of BERT.
  • To provide a production-ready, open-source deployable conversational AI system using off-the-shelf tools and models.

Proposed method

  • Fine-tuned BERT-base for intent classification on 381 financial service intents using domain-specific training data.
  • Applied Monte Carlo Dropout (MCD) during inference to estimate predictive uncertainty via multiple forward passes with different dropout masks.
  • Evaluated two uncertainty metrics—information entropy and variance of MCD predictions—to determine model confidence in predictions.
  • Used mixed-integer programming to optimize decision thresholds that distinguish between confident predictions, uncertain predictions, and out-of-scope queries.
  • Integrated BERT’s masked language model with word edit distance (e.g., Levenshtein) to identify and correct misspelled input tokens before intent classification.
  • Deployed the system using open-source tools (Rasa, PyTorch, TensorFlow) with RESTful APIs hosted on AWS SageMaker and integrated into Microsoft Teams via Bot Framework.

Experimental results

Research questions

  • RQ1How can uncertainty in BERT-based intent classification be effectively quantified and leveraged to improve escalation decisions in a production chatbot?
  • RQ2What are the relative performances of entropy and variance of dropout sampling as uncertainty metrics in real-world financial NLP tasks?
  • RQ3Can BERT’s pre-trained language modeling capabilities be effectively repurposed for automatic spelling correction to improve intent classification robustness?
  • RQ4To what extent can BERT model compression (reducing attention and hidden layers) improve inference throughput and reduce latency with minimal accuracy loss?
  • RQ5How can a hybrid approach combining uncertainty-aware classification and spelling correction enhance the reliability of a closed-domain financial chatbot?

Key findings

  • The use of Monte Carlo Dropout with entropy-based uncertainty thresholds significantly improved the bot’s ability to detect and escalate out-of-scope queries, reducing incorrect responses.
  • The model achieved 94.4% intent classification accuracy on the full BERT-Small architecture (12 attention heads, 12 hidden layers), with a 1.6% drop in accuracy when reduced to 6 attention heads and 6 hidden layers.
  • The smallest optimized model (6A-6H) achieved double the throughput (18.1 requests/second) and half the latency (552 ms) compared to the original BERT-Small, with only a 1.6% performance drop.
  • The spelling correction module, combining BERT’s masked language model probabilities and edit distance, effectively reduced intent classification errors caused by typos in user inputs.
  • Mixed-integer programming was successfully applied to determine optimal decision thresholds for uncertainty-based escalation, balancing precision and recall in out-of-scope detection.
  • The entire system was successfully deployed as an in-house solution using open-source tools, demonstrating feasibility and scalability for enterprise-level financial chatbots.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.