You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+75-3Lines changed: 75 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -112,11 +112,83 @@ The system combines three key components:
112
112
- safetensors ≥ 0.3.1
113
113
- faiss-cpu ≥ 1.7.4 (or faiss-gpu for GPU support)
114
114
115
-
## Benefits of Adaptive Classification in LLM Routing
115
+
## Adaptive Classification with LLMs
116
+
117
+
### LLM Configuration Optimization
118
+
119
+
The adaptive classifier can also be used to predict optimal configurations for Language Models. Our research shows that model configurations, particularly temperature settings, can significantly impact response quality. Using the adaptive classifier, we can automatically predict the best temperature range for different types of queries:
120
+
121
+
-**DETERMINISTIC** (T: 0.0-0.1): For queries requiring precise, factual responses
122
+
-**FOCUSED** (T: 0.2-0.5): For structured, technical responses with slight flexibility
123
+
-**BALANCED** (T: 0.6-1.0): For natural, conversational responses
124
+
-**CREATIVE** (T: 1.1-1.5): For more varied and imaginative outputs
125
+
-**EXPERIMENTAL** (T: 1.6-2.0): For maximum variability and unconventional responses
126
+
127
+
Our evaluation on the LLM Arena dataset demonstrates:
128
+
- 69.8% success rate in finding optimal configurations
- Balanced distribution across temperature classes, with each class finding its appropriate use cases
131
+
- BALANCED and CREATIVE temperatures producing the most reliable results (scores: 0.649 and 0.645)
132
+
133
+
This classifier can be used to automatically optimize LLM configurations based on query characteristics, leading to more consistent and higher-quality responses while reducing the need for manual configuration tuning.
134
+
135
+
```python
136
+
from adaptive_classifier import AdaptiveClassifier
The classifier continuously learns from new examples, adapting its predictions as it processes more queries and observes their performance.
147
+
148
+
### LLM Router
149
+
150
+
The adaptive classifier can be used to intelligently route queries between different LLM models based on query complexity and requirements. The classifier learns to categorize queries into:
151
+
152
+
-**HIGH**: Complex queries requiring advanced reasoning, multi-step problem solving, or deep expertise. Examples include:
153
+
- Code generation and debugging
154
+
- Complex analysis tasks
155
+
- Multi-step mathematical problems
156
+
- Technical explanations
157
+
- Creative writing tasks
158
+
159
+
-**LOW**: Straightforward queries that can be handled by smaller, faster models. Examples include:
160
+
- Simple factual questions
161
+
- Basic clarifications
162
+
- Formatting tasks
163
+
- Short definitions
164
+
- Basic sentiment analysis
165
+
166
+
The router can be used to optimize costs and latency while maintaining response quality:
167
+
168
+
```python
169
+
from adaptive_classifier import AdaptiveClassifier
We evaluate the effectiveness of adaptive classification in optimizing LLM routing decisions. Using the arena-hard-auto-v0.1 dataset with 500 queries, we compared routing performance with and without adaptation while maintaining consistent overall success rates.
118
190
119
-
### Key Results
191
+
####Key Results
120
192
121
193
| Metric | Without Adaptation | With Adaptation | Impact |
0 commit comments