Distilled BERT Student Model for CPU Text Classification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current neural networks, such as BERT, are resource-intensive and require long training times, making them unsuitable for smaller applications with only CPU resources, and struggle with out-of-distribution (OOD) classification due to inaccurate probabilistic distributions and the difficulty in identifying inputs beyond pre-defined classes.

Innovation Solution

A smaller student model is trained using knowledge distillation from a BERT teacher model, supplemented with OOD training, and employs preprocessing with Gaussian noise, separation of reference class vectors, and sparsification to improve OOD identification accuracy, and generates OOD samples from in-distribution samples to enhance detection capabilities.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If BERT model is used for text classification, then classification accuracy is improved, but training time and hardware resource requirements increase significantly

Engineering Contradiction:
Improveclassification accuracyVSAvoidtraining time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent creates a distilled student model that copies the essential classification knowledge from the pre-trained BERT teacher model. The student model is trained using the teacher's predictions and probability distributions as training targets, enabling it to replicate BERT's classification accuracy while requiring significantly fewer computational resources and training time.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent extracts only the necessary classification knowledge from the full BERT model by using its predictions and probability distributions as training signals for a smaller student model. This extraction process removes unnecessary components and complexity while preserving the essential classification capabilities needed for the specific text classification task.

Inventive Principle:
Principle #2Taking out (Extraction)

2Measurement precision

If BERT model is used for text classification, then classification accuracy is improved, but hardware resource requirements increase

Engineering Contradiction:
Improveclassification accuracyVSAvoidhardware resource requirements
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The student model copies the classification functionality from BERT with much lower hardware requirements. By training a compact model to replicate BERT's behavior through knowledge distillation, the system achieves comparable accuracy on CPU-only workstations without needing GPU hardware.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent replaces the expensive, resource-intensive BERT model with a cheaper, lighter student model that can run on standard CPU hardware. This substitution makes text classification accessible on ordinary workstations without requiring specialized GPU infrastructure.

Inventive Principle:
Principle #27Cheap short-living objects (Disposable)

3Use of energy by moving object

If traditional classification models are used, then resource consumption is reduced, but ability to handle out-of-distribution inputs deteriorates

Engineering Contradiction:
Improveresource consumptionVSAvoidOOD classification accuracy
Core Design Contradiction:
Use of energy by moving objectVSReliability

Solution Approach 1:

The student model copies not only the classification predictions but also the probability distributions from the BERT teacher model. This includes copying the teacher's ability to identify OOD inputs through its probability confidence scores, enabling the resource-efficient student model to detect out-of-distribution samples effectively.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent performs preliminary OOD detection by analyzing the probability distributions generated during the distillation process. The student model is trained to recognize patterns in probability confidence that indicate OOD inputs, allowing it to identify out-of-distribution samples before making final classification decisions.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11922303B2Systems and methods for distilled BERT-based training model for text classification
Publication Date: 2024.03.05 SALESFORCE INC
  • US11922303B2 patent drawing
  • US11922303B2 patent drawing
  • US11922303B2 patent drawing

AI summary

Embodiments described herein provides a training mechanism that transfers the knowledge from a trained BERT model into a much smaller model to approximate the behavior of BERT. Specifically, the BERT model may be treated as a teacher model, and a much smaller student model may be trained using the same inputs to the teacher model and the output from the teacher model. In this way, the student model can be trained within a much shorter time than the BERT teacher model, but with comparable performance with BERT.