Abstract
Slot tagging is a critical component of Natural Language Understanding (NLU), yet applying few-shot prompting techniques to this task has traditionally been computationally prohibitive. Standard prompting requires enumerating and querying every possible word span in a sentence. We present inverse prompting, a method that reverses the task by asking the model to generate values for specific slot types. This approach achieves up to an 8x speedup and significantly improves accuracy, outperforming larger models in low-data regimes.
Problem Statement: The Bottleneck of Standard Prompting
Slot tagging involves identifying entities such as "departure city" or "time" within a sentence. While prompting has excelled in other few-shot tasks, its application to sequence labeling is inefficient. The standard "discriminative" approach requires the model to evaluate every possible n-gram span (e.g., "book", "book a", "a flight") and classify it against a slot type. For a typical sentence, this results in dozens of independent queries, making the process slow and failing to capture dependencies between slots.
Methodology: Inverse Prompting and Iterative Refinement
To address these inefficiencies, we propose two primary innovations:
1. Inverse Prompting
Instead of mapping tokens to labels, we map labels to tokens. We construct a prompt that provides the original sentence and a specific slot type, asking the model (e.g., GPT-2) to identify the corresponding value: [Original Sentence] [Slot Type] refers to [MASK]. This reduces complexity from $O(n^2)$ (checking all spans) to $O(m)$ (checking only the number of slot types).
2. Iterative Prediction Strategy
To model dependencies between slots, we employ a two-pass system. The first pass predicts slots independently. In the second pass, the model is re-queried for any missing slots, but this time it is provided with the successful predictions from the first pass as context. This allows the model to refine its output based on the emerging structure of the sentence.
Experimental Setup
We evaluated the method on several few-shot benchmarks:
- MIT Restaurant & Movie Reviews: Domain-specific entity extraction.
- SNIPS: A 7-domain dataset used for cross-domain evaluation to test transferability.
Key Results and Insights
- Efficiency: Inverse prompting is approximately 8x faster than standard template-based prompting. Even with the iterative strategy, it remains over 3x faster than baselines.
- Accuracy: In 10-shot settings, our method improved F1-scores by over 6.1 points compared to state-of-the-art methods, even outperforming larger models like Template-based BART.
- Generative Advantage: By leveraging the native generative capabilities of language models, the "inverse" approach aligns better with pre-training objectives than forced classification.
Conclusion and Future Work
Inverse prompting demonstrates that flipping the task structure can lead to massive gains in both speed and accuracy for few-shot NLU. While the method scales linearly with the number of labels, future work could explore handling domains with hundreds of slots or applying this logic to abstractive slot filling.
Summary updated