Downloads · 30 days
33
23% of all-time downloads
CycleCoreTechnologies/Maaza-SLM-360M-JSON-v1
Maaza-SLM-360M-JSON-v1 is a text generation model from CycleCoreTechnologies. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Small Language Model (360M parameters) for high-accuracy JSON extraction on edge and server deployments.
Downloads · 30 days
33
23% of all-time downloads
All-time downloads
144
Public
Repo size
69.5 MB
Likes
0
Public
Click a slice to open those files.
.safetensors69.5 MB · 94%
From the Hugging Face model README
Small Language Model (360M parameters) for high-accuracy JSON extraction on edge and server deployments.
Evaluated on 158 test cases across 24 schema types:
| Metric | Score |
|---|---|
| JSONExact | 55.1% |
| Field F1 | 0.729 |
| Schema Compliance | 74.1% |
| Latency (CPU) | 17.2 tokens/sec |
| Throughput | 5.7 tokens/sec (estimated) |
| Training Time | 90.1 seconds |
| Complexity | Fields | Nesting | JSONExact | Field F1 |
|---|---|---|---|---|
| Simple | 2-4 | Flat | 78.9% | 0.927 |
| Medium | 4-8 | 1-2 levels | 51.4% | 0.815 |
| Complex | 8+ | 2+ levels | 4.0% | 0.072 |
Perfect (100% JSONExact):
log_entry (4 fields, simple)product_info (2 fields, simple)sensor_reading (4 fields, simple)transaction_record (5 fields, simple)High Accuracy (80%+):
notification (88.9%)simple_config (87.5%)support_ticket (87.5%)rating (85.7%)order_details (83.3%)Comparison to MLM-135M demonstrates scaling effectiveness:
| Model | Params | JSONExact | Field F1 | Simple | Medium | Complex |
|---|---|---|---|---|---|---|
| MLM-135M | 135M | 24.7% | 0.520 | 44.7% | 13.5% | 0.0% |
| SLM-360M | 360M | 55.1% | 0.729 | 78.9% | 51.4% | 4.0% |
| Improvement | 2.67× | 2.23× | 1.40× | 1.77× | 3.81× | ∞ |
Key Finding: Complex schema ceiling breakthrough - 360M breaks the 0% barrier that 135M hit, proving capacity matters for structured tasks.
Training Multiplier Insight: Larger models benefit less from fine-tuning (4.83×) vs smaller models (13× for 135M), suggesting better pre-training quality but diminishing fine-tuning returns.
Extract the structured JSON data from the following text.
Input: {prompt}
Output:
JSONExact Score:
Field F1:
Schema Compliance:
After generation, validate the output:
import json
from jsonschema import validate # pip install jsonschema
# Decode model output
output = tokenizer.decode(outputs[0], skip_special_tokens=True)
# Parse JSON
try:
obj = json.loads(output)
# Validate against schema
validate(instance=obj, schema=your_json_schema)
print("✅ Valid JSON matching schema")
except json.JSONDecodeError:
print("❌ Invalid JSON")
except jsonschema.exceptions.ValidationError as e:
print(f"❌ Schema validation failed: {e.message}")
Complex Schema Ceiling: While this model breaks through the 0% ceiling that MLM-135M hit on complex schemas, it still achieves only 4.0% exact match on 8+ field schemas with 2+ nesting levels. For production complex schema extraction, consider larger models (>500M params) or specialized architectures.
Medium Schema Viability: Best suited for simple (78.9%) and medium (51.4%) schemas. Medium schema performance is production-viable but may require validation/correction workflows.
Synthetic Data: Trained exclusively on synthetically generated data from Qwen2.5-7B, which may not capture all real-world edge cases.
Latency Trade-off: 2.67× larger than MLM-135M but similar CPU inference speed (17.2 vs 18.5 tok/sec), making it an excellent value-for-accuracy trade-off.
pip install transformers peft torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"HuggingFaceTB/SmolLM2-360M",
torch_dtype=torch.float16,
device_map="auto"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(
base_model,
"CycleCore/Maaza-SLM-360M-JSON-v1"
)
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM2-360M")
prompt = """Extract the structured JSON data from the following text.
Input: Order #12345 placed by Jane Smith ([email protected]) on 2025-11-20.
Items: 2x Widget ($19.99 each), 1x Gadget ($49.99).
Shipping to 123 Main St, Springfield, IL 62701. Total: $89.97.
Output:"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.0,
do_sample=False
)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)
{
"order_id": "12345",
"customer": {
"name": "Jane Smith",
"email": "[email protected]"
},
"order_date": "2025-11-20",
"items": [
{"name": "Widget", "quantity": 2, "price": 19.99},
{"name": "Gadget", "quantity": 1, "price": 49.99}
],
"shipping_address": {
"street": "123 Main St",
"city": "Springfield",
"state": "IL",
"zip": "62701"
},
"total": 89.97
}
Quick Decision:
Performance Summary:
| Criterion | MLM-135M | SLM-360M |
|---|---|---|
| JSONExact | 24.7% | 55.1% (2.23× better) |
| Simple Schemas | 44.7% | 78.9% (1.77× better) |
| Medium Schemas | 13.5% | 51.4% (3.81× better) |
| Complex Schemas | 0.0% | 4.0% (breakthrough) |
| Model Size | ~270MB | ~720MB |
| Latency (CPU) | 18.5 tok/s | 17.2 tok/s |
If you use this model in your research, please cite:
@misc{cyclecore2025slm,
title={CycleCore Maaza SLM-360M-JSON: Small Language Model for Edge JSON Extraction},
author={CycleCore Technologies},
year={2025},
publisher={HuggingFace},
howpublished={\url{https://huggingface.co/CycleCore/Maaza-SLM-360M-JSON-v1}},
}
Academic Paper (forthcoming):
@article{cyclecore2025slmbench,
title={Capacity Scaling in Micro and Small Language Models: Evidence from EdgeJSON Benchmark},
author={CycleCore Technologies},
journal={arXiv preprint},
year={2025},
note={Paper in preparation}
}
For questions, issues, or collaboration:
Apache License 2.0
Copyright 2025 CycleCore Technologies
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.