Downloads · 30 days
13
21% of all-time downloads
AryanNsc/strm-4b-v1
strm-4b-v1 is a text generation model from AryanNsc. 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.
A LoRA fine-tune of Qwen/Qwen3-4B trained on distilled chain-of-thought data for parsing unstructured, spoken-language input into structured JSON.
Downloads · 30 days
13
21% of all-time downloads
All-time downloads
62
Public
Parameters
4B
8.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8 GB · 100%
From the Hugging Face model README
A LoRA fine-tune of Qwen/Qwen3-4B trained on distilled chain-of-thought data for parsing unstructured, spoken-language input into structured JSON.
The model maintains running state while processing sequential instructions -- handling corrections ("scratch that"), cancellations ("actually nevermind"), quantity changes ("bump that to 3"), and modifier adjustments in a single forward pass.
~94% exact-match accuracy averaged across evaluation domains.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "AryanNsc/strm-4b-v1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
messages = [
{"role": "system", "content": "You are an expert POS agent. Parse the order step by step, then output JSON."},
{"role": "user", "content": "uh can I get a venti latte with oat milk and a blueberry muffin actually scratch that muffin make it an avocado toast"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=2048, temperature=0.6, do_sample=True)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
The model reasons inside <think> tags, then outputs structured JSON:
<think>
Processing the order step by step:
1. "venti latte with oat milk" -> Latte, Venti, Oat Milk
- Base: $4.50 + Venti: $1.00 + Oat Milk: $0.80 = $6.30
2. "a blueberry muffin" -> Blueberry Muffin
- $3.75
3. "actually scratch that muffin" -> Cancel the Blueberry Muffin
4. "make it an avocado toast" -> Avocado Toast
- $7.00
Running total: $6.30 + $7.00 = $13.30
</think>
{"items": [{"name": "Latte", "size": "Venti", "quantity": 1, "modifiers": ["Oat Milk"]}, {"name": "Avocado Toast", "size": null, "quantity": 1, "modifiers": []}], "total_price": 13.30}
STRM is designed for tasks that require stateful sequential reasoning -- processing a stream of instructions where later instructions modify earlier state. Primary use cases:
The model is trained with distilled thinking -- each training example includes explicit step-by-step reasoning inside <think> tags before the final JSON output. This teaches the model to:
Training data spans multiple domains with weighted sampling, so the model learns the general skill of stateful reasoning rather than memorizing domain-specific patterns.
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen3-4B |
| Method | LoRA |
| LoRA rank (r) | 64 |
| LoRA alpha | 64 |
| LoRA dropout | 0.0 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Quantization | 4-bit NF4 (training only; weights are merged to 16-bit) |
| Max sequence length | 4096 |
| Learning rate | 2e-4 |
| LR scheduler | Cosine with 5% warmup |
| Weight decay | 0.01 |
| Epochs | 3 |
| Per-device batch size | 2 |
| Gradient accumulation | 4 (effective batch size: 8) |
| Precision | bf16 |
| Seed | 42 |
The model was trained on multi-domain distilled chain-of-thought data. Each example consists of a system prompt, a user input, and an assistant response containing <think>...</think> reasoning followed by structured JSON. Domains include coffee shop orders, restaurant orders, grocery checkout, banking, inventory, bill splitting, recipe scaling, scheduling, budget tracking, and unit conversion -- with coffee-domain examples upsampled for the primary use case.
Benchmarked on held-out labeled data across difficulty tiers:
| Difficulty | Description |
|---|---|
| Easy | 1-2 items, no corrections |
| Medium | 2-3 items, some modifiers |
| Hard | Multiple items with cancellations or quantity bumps |
| Nightmare | 4+ items with mixed corrections, modifier removals, and re-additions |
The model achieves ~94% exact-match accuracy averaged across domains, where exact match requires both the item list (names, sizes, quantities, modifiers) and total price to be completely correct.
enable_thinking=True in apply_chat_template -- the model was trained to reason inside <think> tags before outputting JSON</think> closing tag -- parse everything after that delimiterThe full training and evaluation code is open source:
github.com/Guney-olu/strm-model
Apache 2.0