Downloads · 30 days
25
27% of all-time downloads
CycleCoreTechnologies/Maaza-MLM-135M-JSON-v1
Maaza-MLM-135M-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.
Micro Language Model (135M parameters) specialized for JSON extraction on edge devices.
Downloads · 30 days
25
27% of all-time downloads
All-time downloads
93
Public
Repo size
19.6 MB
Likes
0
Public
Click a slice to open those files.
.safetensors19.6 MB · 80%
From the Hugging Face model README
Micro Language Model (135M parameters) specialized for JSON extraction on edge devices.
Evaluated on 158 test cases across 24 schema types:
| Metric | Score |
|---|---|
| JSONExact | 24.7% |
| Field F1 | 0.520 |
| Schema Compliance | 41.1% |
| Latency (CPU) | 18.5 tokens/sec |
| Training Time | <1 minute |
| Complexity | Fields | Nesting | JSONExact | Field F1 |
|---|---|---|---|---|
| Simple | 2-4 | Flat | 44.7% | 0.698 |
| Medium | 4-8 | 1-2 levels | 13.5% | 0.456 |
| Complex | 8+ | 2+ levels | 0.0% | 0.234 |
product_info (2 fields, simple)sensor_reading (4 fields, simple)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}")
Capacity Ceiling: This model hits a capacity ceiling on complex schemas (8+ fields, 2+ nesting levels), achieving 0% exact match accuracy. For complex structured extraction, consider the larger Maaza SLM-360M model.
Simple Schema Specialization: Best suited for simple schemas (2-4 fields, flat structure) where it achieves 44.7% accuracy.
Synthetic Data: Trained exclusively on synthetically generated data from Qwen2.5-7B, which may not capture all real-world edge cases.
Domain Specificity: Optimized for structured data extraction, not general-purpose language understanding.
pip install transformers peft torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"HuggingFaceTB/SmolLM2-135M",
torch_dtype=torch.float16,
device_map="auto"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(
base_model,
"CycleCore/Maaza-MLM-135M-JSON-v1"
)
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM2-135M")
prompt = """Extract the structured JSON data from the following text.
Input: John Doe works at Acme Corp. His email is [email protected] and phone is 555-1234.
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)
{
"name": "John Doe",
"company": "Acme Corp",
"email": "[email protected]",
"phone": "555-1234"
}
Quick Decision:
If you use this model in your research, please cite:
@misc{cyclecore2025mlm,
title={CycleCore Maaza MLM-135M-JSON: Micro Language Model for Edge JSON Extraction},
author={CycleCore Technologies},
year={2025},
publisher={HuggingFace},
howpublished={\url{https://huggingface.co/CycleCore/Maaza-MLM-135M-JSON-v1}},
}
Academic Paper (forthcoming):
@article{cyclecore2025slmbench,
title={Micro Language Models (MLMs) and SLM-Bench: A Benchmark Suite for Structured Tasks on Resource-Constrained Devices},
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.