Nest · Base model · Dataset · Benchmarks
A 4-billion-parameter model that classifies the main intent of a Brazilian Portuguese customer-support conversation into 8 intents. Nest fine-tuned Qwen3.5-4B with LoRA and benchmarked it against the untuned base model and a frontier model, GPT-5.6 Terra. On the held-out test set it outperforms the frontier model: 84.31% accuracy against 57.84% for GPT-5.6 Terra and 51.96% for the base model.
| Model | Adaptation | Test accuracy | Test macro F1 | Validation accuracy |
|---|---|---|---|---|
| This model | Nest LoRA | 84.31% | 84.25% | 83.33% |
| GPT-5.6 Terra | zero-shot | 57.84% | 55.67% | 57.84% |
| Qwen3.5-4B (base) | none | 51.96% | 48.58% | 55.88% |
Test: 102 conversations. Validation: 102 conversations. Macro F1 averages all classes, with zero for undefined class F1. LoRA − Terra on test macro F1: +28.6 pp, group bootstrap 95% CI [+18.9, +39.3] pp (10,000 resamples over 93 similarity groups, seed 42).
cancelamento, compra, duvida_produto, duvida_servico, elogio, reclamacao, saudacao, suporte_tecnico).inference_config.json.Requires transformers>=5.5, peft>=0.21, torch and accelerate. The base weights are downloaded from the Hub; this repository holds only the adapter.
import json
import torch
from huggingface_hub import hf_hub_download
from peft import PeftModel
from transformers import AutoModelForImageTextToText, AutoTokenizer
repo = "guistmartin/qwen3.5-4b-talkex-pt-br-lora"
config = json.load(open(hf_hub_download(repo, "inference_config.json")))
tokenizer = AutoTokenizer.from_pretrained(config["base_model"], revision=config["base_revision"])
base = AutoModelForImageTextToText.from_pretrained(
config["base_model"], revision=config["base_revision"], dtype="auto", device_map="auto")
model = PeftModel.from_pretrained(base, repo).eval() # keep the adapter attached: do not merge_and_unload()
messages = [
{"role": "system", "content": config["system_prompt"]},
{"role": "user", "content": "Cliente: Oi, quero cancelar minha assinatura, não uso mais o serviço."},
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, enable_thinking=False,
return_dict=True, return_tensors="pt").to(model.device)
with torch.inference_mode():
output = model.generate(**inputs, max_new_tokens=config["max_output_tokens"], do_sample=False)
print(tokenizer.decode(output[0, inputs.input_ids.shape[-1]:], skip_special_tokens=True).strip())
# prints exactly one label from labels.json, e.g. cancelamento
| Developed by | Nest |
| Model type | LoRA adapter (PEFT) for a causal language model |
| Base model | Qwen/Qwen3.5-4B |
| Task | Brazilian Portuguese support-intent classification |
| Language | Portuguese (Brazil) |
| Dataset | TalkEx PT-BR (Apache 2.0) |
| License | Apache 2.0 |
| Method | Supervised LoRA fine-tuning on Tinker, one round |
| Steps | 180 optimizer steps |
| Training data | 1,916 conversations from the TalkEx train portion |
| LoRA rank / learning rate | 16 / 2e-4 |
| Seed | 42 |
The adapter was converted from the native Tinker checkpoint to PEFT, preserving LoRA scaling, fusing Q/K/V updates into the Qwen3.5 layout and keeping the output-head adapter separate from the tied input embeddings. Nest verified projection equivalence, every saved tensor and PEFT loading on the exact base architecture. Keep the adapter attached rather than calling merge_and_unload().
| File | Contents |
|---|---|
adapter_model.safetensors, adapter_config.json |
The LoRA adapter |
inference_config.json |
Exact system prompt, renderer and decoding settings |
labels.json |
The exact output labels, in order |
metrics.json |
Aggregate scores, training counts and provenance hashes |
data_manifest.json |
Dataset revision, split hashes and counts |
base_test_metrics.json |
The untuned base model's test scores (post-hoc run) |
benchmark.png |
The benchmark card above |
@misc{nesttalkexptbr2026,
title = {Qwen3.5-4B TalkEx PT-BR: a Nest LoRA for Brazilian Portuguese support-intent classification},
author = {Nest},
year = {2026},
url = {https://huggingface.co/guistmartin/qwen3.5-4b-talkex-pt-br-lora}
}
Nest turns the narrow, repeated LLM calls inside an agent into small models trained for that one task: same quality or better, at a fraction of the cost and latency. More results at nest.technology/benchmarks.
Qwen/Qwen3.5-4B