Master's Thesis  ·  NTU  ·  2024–2025

Entity2Intent

A two-stage reasoning framework for accurate, cost-efficient intent classification using LLMs — grounding predictions in structured entity extraction rather than raw text.

LLM Reasoning Intent Classification NLP Prompt Engineering GPT-3.5 · LLaMA2 API Cost Optimization
📄 Read Thesis →
Entity2Intent Pipeline
STAGE 2 — ENTITY-GUIDED REASONING — The core pipeline: entity extraction anchors LLM reasoning to structured attributes (Action, Object, Target, Temporal), mapping them to the reduced candidate label set with a chain-of-thought explanation.

Motivation
The Paradox of Choice in Intent Detection

When a user sends a message, a conversational AI must pick the right intent from hundreds of possible labels. Too many choices lead to confusion — a classic paradox also experienced by humans every day.

Paradox of Choice
INSPIRATION — The paradox of choice: excess options lead to confusion and dissatisfaction. Entity2Intent tackles this by structurally narrowing the label space before reasoning.

Core problem: Naively prompting an LLM with hundreds of intent labels is expensive and inaccurate. Entity2Intent solves this with a two-stage approach — first reduce the candidate space, then reason precisely.

Methodology
Two-Stage Pipeline
1
Self-Reduction (CBWR)

Cluster-Based Window Reduction narrows the full intent label space into a small, semantically diverse candidate set — avoiding redundant comparisons and introducing semantic variety before reasoning.

2
Entity-Guided Reasoning

Structured entities (Action, Object, Target, Temporal) are extracted from the query. These serve as explicit reasoning anchors — the LLM maps entities to the reduced candidate set with a chain-of-thought explanation.

3
Intent Output + Explanation

The final intent label is produced with an interpretable reasoning trace — enabling debugging and transparency in production dialogue systems.

CBWR Algorithm
STAGE 1 — CBWR — Cluster-Based Window Reduction algorithm. Clusters the full label set into K groups, samples candidates from each cluster, and iteratively discards low-probability options to produce a compact candidate window.
Entity-Guided Reasoning
STAGE 2 — ENTITY-GUIDED REASONING — Given "check reservation availability for 2 at red lobster at 8pm", the model extracts Action: "check reservation", Object: "red lobster", Target: "2", Temporal: "8pm" — then maps these to the correct intent label with an LLM explanation.
Experiments
Benchmarks

Evaluated on three real-world intent classification datasets spanning single-domain and multi-domain settings.

Datasets
DATASETS — Banking77 (77 classes, 13,083 samples), Clinc150 (150 classes, 23,700 samples), Liu54 (54 classes, ~9,000 samples) — covering fine-grained banking, diverse multi-domain, and real-world travel/restaurant scenarios.
Results
Entity2Intent Outperforms Baselines

Compared against Zero-Shot (ZS), Few-Shot (FS), and PC-CoT across GPT-3.5 Turbo and LLaMA2-70B Chat. Entity2Intent consistently leads — especially on multi-domain datasets.

Main Results Table
MAIN RESULTS — Entity2Intent achieves the highest average accuracy on both GPT-3.5 Turbo (61.49 avg) and LLaMA2-70B Chat (58.11 avg), outperforming PC-CoT across Banking77, Liu54, and Clinc150.
Confusion Matrices
CONFUSION MATRICES — PC-CoT vs Entity2Intent on Banking77. Entity2Intent shows tighter clustering along the diagonal — fewer misclassifications on frequently confused labels.
Stack
Tools & Technologies
Python GPT-3.5 Turbo LLaMA2-70B HuggingFace Prompt Engineering K-Means Clustering Chain-of-Thought NLU Benchmarks F1 / Accuracy
← Back to all projects