File size: 9,646 Bytes
ee12bdc 728a55e 8b3a1ff f1d7d9e 8b3a1ff 20e8e2d 8b3a1ff 20e8e2d 8b3a1ff ee12bdc 8b3a1ff be002d1 20e8e2d be002d1 8b3a1ff be002d1 8b3a1ff be002d1 8b3a1ff be002d1 8b3a1ff be002d1 8b3a1ff be002d1 c15c595 be002d1 8b3a1ff ee12bdc be002d1 ee12bdc be002d1 9390b40 be002d1 ee12bdc be002d1 3a1a55b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | ---
language:
- en
license: apache-2.0
pipeline_tag: text-generation
library_name: transformers
tags:
- llm
- instruction-tuned
- text-generation
- text-classification
- sql-generation
- reasoning
- lora
- lightweight
- safetensors
- causal-lm
base_model: unsloth/Phi-3-mini-4k-instruct-bnb-4bit
fine_tuned_from: unsloth/Phi-3-mini-4k-instruct-bnb-4bit
organization: QuantaSparkLabs
model_type: causal-lm
model_index:
- name: Antiplex-Instruct-3B
results:
- task:
type: text-generation
name: SQL Generation
metrics:
- type: accuracy
value: 100
- task:
type: text-classification
name: Intent Detection
metrics:
- type: accuracy
value: 66.7
---
<p align="center">
<img src="quanta.png" width="900" alt="QuantaSparkLabs Logo"/>
</p>
<h1 align="center">Antiplex-Instruct-3B</h1>
<p align="center">
A compact, instruction-tuned large language model optimized for <strong>Text Generation</strong>, <strong>Intent Classification</strong>, and <strong>SQL Reasoning</strong>.
</p>
<p align="center">
<img src="https://img.shields.io/badge/Identity_Alignment-100%25-brightgreen" alt="Identity Alignment">
<img src="https://img.shields.io/badge/SQL_Generation-100%25-brightgreen" alt="SQL Generation">
<img src="https://img.shields.io/badge/General_Reasoning-90%25-yellow" alt="General Reasoning">
<img src="https://img.shields.io/badge/Release-2026-blue" alt="Release Year">
</p>
---
## π Overview
**Antiplex-Instruct-3B** is a high-performance instruction-tuned language model developed by **QuantaSparkLabs**. Released in 2026, this model is engineered for dual-task capability, delivering accurate identity alignment, reliable SQL generation, and strong general reasoning, while remaining lightweight and efficient.
The model is fine-tuned using **LoRA (PEFT)** on curated datasets emphasizing identity consistency and structured reasoning, making it ideal for edge deployment and specialized assistant roles.
## β¨ Core Features
| π― Task Versatility | β‘ Performance Optimized |
| :--- | :--- |
| **Text Generation**: SQL/NLP, creative writing, technical explanations. | **LoRA Fine-tuning**: Efficient parameter adaptation. |
| **Classification**: Intent detection, task routing, safety filtering. | **Identity Alignment**: Consistent persona across interactions. |
| **Dual-Mode**: Single model handling generation + classification. | **Lightweight**: ~3.8B parameters, edge-friendly VRAM footprint. |
<p align="center">
<img src="statics.png" width="900" alt="statics"/>
</p>
---
## π Performance Benchmarks
### π Accuracy Metrics
| Task | Accuracy | Confidence |
| :--- | :--- | :--- |
| Identity Verification | 100% | βββββ |
| SQL Generation | 100% | βββββ |
| General Reasoning | 90% | ββββ |
### π¬ Reliability Assessment
**21-Test Internal Validation Suite**
* **Passed:** 16 tests (76.2%)
* **Failed:** 5 tests (23.8%)
* **Overall Grade:** B (Good)
<p align="center">
<img src="overview.png" width="900" alt="overview"/>
</p>
<details>
<summary>π View Detailed Test Categories</summary>
| Category | Tests | Passed | Rate |
| :--- | :--- | :--- | :--- |
| Identity Tasks | 7 | 7 | 100% |
| SQL Generation | 6 | 6 | 100% |
| Reasoning | 5 | 3 | 60% |
| Classification | 3 | 2 | 66.7% |
**Test Dataset:** `QuantaSparkLabs/antiplex-test-suite`
</details>
---
## ποΈ Model Architecture
### Training Pipeline
```mermaid
graph TD
A[Base Model Phi-3-mini] --> B[LoRA Fine-tuning]
B --> C[Task-Specific Heads]
C --> D[Text Generation Head]
C --> E[Classification Head]
D --> F[Generation Output]
E --> G[Classification Output]
H[Instruction Dataset] --> B
I[SQL Dataset] --> B
J[Identity Dataset] --> B
```
<p align="center">
<img src="structure.png" width="900" alt="structure"/>
</p>
### Inference Flow
```
User Prompt β Tokenization β Antiplex Core β Task Router
β
[Generation/Classification] β Post-processing β Output
```
---
## π§ Technical Specifications
| Parameter | Value |
| :--- | :--- |
| **Base Model** | `unsloth/Phi-3-mini-4k-instruct-bnb-4bit` |
| **Fine-tuning** | LoRA (PEFT) |
| **Rank (r)** | 16 |
| **Alpha (Ξ±)** | 32 |
| **Optimizer** | AdamW (Ξ²β=0.9, Ξ²β=0.999) |
| **Learning Rate** | 2e-4 |
| **Batch Size** | 8 |
| **Epochs** | 3 |
| **Total Parameters** | ~3.8B |
### Dataset Composition
| Dataset Type | Samples | Purpose |
| :--- | :--- | :--- |
| Identity Alignment | 30 | Consistent persona training |
| SQL Generation | 300 | Structured query training |
| Instruction Tuning | 2,500 | General capability enhancement |
| Classification | 1,000 | Intent detection training |
---
## π» Quick Start
### Installation
```bash
pip install transformers torch accelerate
```
### Basic Usage (Text Generation)
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "QuantaSparkLabs/Antiplex-instruct-3B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
prompt = "Write an SQL query to fetch users created in the last 30 days."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
top_p=0.9,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
### Classification Mode
```python
# Intent classification example
classification_prompt = """[CLASSIFY]
User Query: "I need to reset my account password"
Categories: account_issue, technical_support, billing, general_inquiry
"""
inputs = tokenizer(classification_prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=64,
temperature=0.3,
do_sample=False
)
detected_intent = tokenizer.decode(outputs[0], skip_special_tokens=True).split('[')[-1].split(']')[0]
print(f"Detected Intent: {detected_intent}")
```
### Chat Interface
```python
from transformers import pipeline
chatbot = pipeline(
"text-generation",
model=model_id,
tokenizer=tokenizer,
device=0 if torch.cuda.is_available() else -1
)
messages = [
{"role": "system", "content": "You are Antiplex, a helpful AI assistant specialized in SQL and classification tasks."},
{"role": "user", "content": "Classify this intent: 'Can you help me with invoice generation?' Then write a SQL query to find recent invoices."}
]
response = chatbot(messages, max_new_tokens=512, temperature=0.7)
print(response[0]['generated_text'][-1]['content'])
```
---
## π Deployment Options
### Hardware Requirements
| Environment | VRAM | Quantization | Speed |
| :--- | :--- | :--- | :--- |
| **GPU (Optimal)** | 8-12 GB | FP16 | β‘ Fast |
| **GPU (Efficient)** | 4-6 GB | INT8 | β‘ Fast |
| **CPU** | N/A | FP32 | π Slow |
| **Edge Device** | 2-4 GB | INT4 | β‘ Fast |
### Cloud Deployment (Docker)
```dockerfile
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "app.py"]
```
---
## π Repository Structure
```
Antiplex-Instruct-3B/
βββ README.md
βββ model.safetensors
βββ config.json
βββ tokenizer.json
βββ tokenizer_config.json
βββ generation_config.json
βββ special_tokens_map.json
βββ quantasparklogo.png
βββ examples/
β βββ classification_demo.py
β βββ sql_generation_demo.py
β βββ chat_interface.py
βββ evaluation/
βββ test_results.json
```
---
## β οΈ Limitations & Safety
### Known Limitations
- **Domain Specificity**: Not trained for medical/legal/safety-critical domains
- **Bias Inheritance**: May reflect biases in training data
- **Context Window**: Limited to 4K tokens
- **Multilingual**: Primarily English-focused
### Safety Guidelines
```python
# Recommended safety wrapper
def safety_check(text):
blocked_terms = ["harmful", "dangerous", "illegal", "exploit"]
if any(term in text.lower() for term in blocked_terms):
return "Content filtered for safety reasons."
return text
```
---
## π Version History
| Version | Date | Changes |
| :--- | :--- | :--- |
| v1.0.0 | 2026-01-1 | Initial release |
| v1.1.0 | 2026-01-10 | Enhanced classification head |
| v1.2.0 | 2026-01-25 | SQL generation improvements |
---
## π License & Citation
**License:** Apache 2.0
**Citation:**
```bibtex
@misc{antiplex2026,
title={Antiplex-Instruct-3B: A Dual-Task Instruction-Tuned Language Model},
author={QuantaSparkLabs},
year={2026},
url={https://huggingface.co/QuantaSparkLabs/Antiplex-instruct-3B}
}
```
---
## π₯ Credits & Acknowledgments
- **Base Model**: Microsoft Phi-3 Mini team
- **Fine-tuning Framework**: Unsloth for efficient LoRA training
- **Evaluation**: Internal QuantaSparkLabs team
- **Testing**: Community contributors
---
## π€ Contributing & Support
### Reporting Issues
Please open an issue on our repository with:
1. Model version
2. Reproduction steps
3. Expected vs actual behavior
---
<p align="center">
<i>Built with β€οΈ by QuantaSparkLabs</i><br/>
<sub>Model ID: Antiplex-Instruct-3B β’ Parameters: ~3.8B β’ Release: 2026</sub>
</p>
<p align="center">
<a href="https://github.com/unslothai/unsloth">
<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>
</a>
</p>
>Special thanks to microsoft! |