Organizations: Zhejiang Lab, Hangzhou, China · School of Computer Science and Software Engineering, Harbin Institute of Technology, China · School of Mechanical Engineering, Shanghai Jiao Tong University, China
Flagship large language models (LLMs) offer rich general knowledge and strong reasoning capabilities, but their high inference cost and latency limit their use for large-scale data labeling. We study zero-shot text classification with semantically meaningful labels and task descriptions, without task-specific labeled examples or classifier feedback. We propose SLKR (Semantic Label Knowledge Retrieval), a label-centric retrieval-augmented generation framework that separates offline knowledge construction from lightweight online inference. Offline, a flagship LLM independently generates label definitions, retrieval keywords, and boundary rules for potentially confusable label pairs, forming a reusable label-knowledge store. Because this construction operates over the label space rather than the input corpus, its one-time flagship cost can be amortized across large-scale inference. Online, hybrid semantic and lexical retrieval first identifies the top-K candidate labels and then selects up to M input-relevant boundary rules connecting candidate-label pairs. A lightweight LLM performs the final classification in a single call using the retrieved definitions and rules. Across three public benchmarks and a real-world multilingual book-classification dataset, SLKR achieves the best results on all four datasets with Qwen3.5-4B and on three of four with Ministral-3-3B, while using compact input contexts and no task-specific labeled examples. Boundary ablations further show that retrieving a small set of input-relevant rules preserves performance close to using all boundaries with substantially less context, supporting efficient reuse of flagship-generated label knowledge for lightweight classification.
Figures & tables
Figure 1: SLKR overview. Three independent flagship augmentations receive the same original label inventory and task scope, producing definitions ( D ), keywords ( W ), and boundary rules ( B ). Online, hybrid Top- K label retrieval is followed by candidate-pair filtering, deduplication, and hybrid Top- M rule retrieval. One lightweight LLM reads the input, candidate definitions/scope, and selected rules.
Family
Design
No External Data
Label Knowledge
Boundary Aware
Provided / Retrieved Content
Prompting
Zero-shot
✓
✗
✗
Label names and task description
Few-shot
✗
✗
✗
Text–label demonstrations
Retrieval- based
Retrieved ICL
✗
✗
✗
Retrieved text–label demonstrations
Document RAG
✗
✗
✗
Retrieved document passages
SLKR (ours)
✓
✓
✓
Label knowledge and boundary rules
Table 1: Comparison of prompting and retrieval-based paradigms for LLM classification. “No External Data” denotes no reliance on labeled examples or an external corpus.
Figure 2: Candidate-conditioned boundary retrieval ( K=5 , M=3 ). Fourteen eligible copies yield seven unique rules after deduplication. The table shows illustrative semantic similarities and first-occurrence positions; selection combines semantic and lexical ranks using RRF. The graphs retain all five candidate labels while selecting three rules for shared reader context. Scores and candidate order are schematic, not measured results.
Table 2: Datasets, label counts, evaluation splits, and roles.
Dataset
R@3
R@5
R@10
R@15
BANKING77
74.74
83.51
94.29
97.18
CLINC150
86.24
92.38
96.47
97.47
WOS-143
79.49
87.81
94.45
95.90
Book-38
73.74
81.38
97.39
98.32
Table 3: First-stage label retrieval recall (%).
Model
Method
WOS-143
BANKING77
CLINC150
Book-38
Avg. Input Tokens
Qwen3.5-4B
Label only – ZS
57.10 / 56.54
68.77 / 66.99
80.36 / 78.94
64.25 / 57.04
0.9k
Gen-Z (Label + definition)
57.37 / 57.06
72.95 / 71.58
85.64 / 84.66
61.45 / 60.81
2.7k
1-shot / label
58.67 / 57.88
74.84 / 73.86
89.07 / 88.66
68.16 / 65.57
4.7k
Retrieved ICL
59.67 / 57.92
75.29 / 74.40
89.24 / 88.92
67.60 / 68.08
1.2k
SLKR-Desc ( M=0 )
59.92 / 57.67
77.05 / 75.99
89.13 / 88.57
66.85 / 66.24
1.0k
SLKR ( M=5 )
60.17 / 58.20
77.45 / 76.63
89.81 / 89.33
70.58 / 70.25
1.4k
Table 4: Classification accuracy / macro-F1 (%). Bold marks the best results within each model. Input tokens are averaged across the three public datasets.
Boundary policy
WOS-143
BANKING77
CLINC150
Book-38
Boundary tokens
No boundary ( M=0 )
59.92±0.0757.67±0.07
77.05±0.0075.99±0.01
89.13±0.0388.57±0.03
66.85±0.3266.24±1.62
0
All boundaries
60.36±0.0858.34±0.04
77.47±0.1776.82±0.20
89.95±0.2589.44±0.25
67.04±0.0064.71±0.18
2.51k
Random M=5
58.72±0.3556.92±0.31
76.69±0.0675.78±0.09
89.41±0.1888.88±0.17
66.48±0.5662.55±2.04
0.36k
Hybrid Top- M=5
60.17±0.0558.20±0.04
77.45±0.0276.63±0.02
89.81±0.0389.33±0.03
70.58±0.3270.25±0.17
0.35k
Table 5: Boundary retrieval ablation at K=15 . Each cell reports accuracy (top) and macro-F1 (bottom), in %. Boundary tokens denote the average per-input boundary context.
Method
Builder
Reader
Accuracy / F1
Build Cost
Online Cost / 1k
Amortized Cost / 1k
Direct Flagship
None
GPT-5.6-sol
86.01 / 85.30
0
4.111
4.111
SLKR
GPT-5.6-sol
Qwen-3.5-4B
77.45 / 76.63
3.4
0.0596
0.4276
Table 6: Flagship–lightweight cost comparison on BANKING77. Amortized cost is computed over three complete BANKING77 test-set runs (9240 classifications in total). Costs are reported in USD.
Zero-shot text classification assigns texts to categories without task-specific labeled training data, using language models, embeddings, or label descriptions.