MEMORYDistillPL-1.5b

๐Ÿ‡ฌ๐Ÿ‡ง English  ยท  ๐Ÿ‡ต๐Ÿ‡ฑ Polski


English

MEMORYDistillPL-1.5b is a Polish-language fine-tune of Qwen2.5-1.5B-Instruct, trained with QLoRA to distill long conversational transcripts into concise, structured memory notes โ€” summarizing what was discussed and extracting the entities (people, organizations, decisions, facts) mentioned in the conversation.

The model is optimized for this one narrow task rather than general-purpose chat: given a Polish-language conversation transcript, it produces a compact, structured summary suitable for long-term storage and later retrieval, rather than free-form conversational responses.

Model Details

  • Base model: Qwen/Qwen2.5-1.5B-Instruct
  • Architecture: Qwen2, 28 layers, hidden size 1536, 12 attention heads / 2 KV heads (GQA), vocab size 151,936, 32,768 token context window
  • Fine-tuning method: QLoRA (4-bit NF4 base weights, LoRA adapters), via Unsloth + PEFT/TRL
  • Language: Polish (primary); the base model retains general multilingual ability
  • License: Apache 2.0 (inherited from the Qwen2.5-1.5B-Instruct base model)

Intended Use

  • Distilling Polish-language conversation transcripts into structured, factual summaries with entity extraction.
  • A lightweight, fast alternative to much larger general-purpose LLMs for this specific summarization/extraction task.

Not intended for: general open-domain chat or instruction-following outside the summarization/extraction task, use in languages other than Polish (untested and unoptimized), or high-stakes use without human verification of the output.

Training Data

  • 1,394 training examples / 164 validation / 82 held-out test examples (1,640 total).
  • Each example pairs a conversation transcript with a target structured summary (teacher-model generated, then used as supervised fine-tuning targets).
  • Data is domain-general conversational Polish text. The training corpus itself is not published alongside the model weights.

Training Procedure

QLoRA hyperparameters

Parameter Value
LoRA rank (r) 16
LoRA alpha 16
LoRA dropout 0
Target modules q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Max sequence length 8,192 tokens
Epochs 3
Effective batch size 8 (1 ร— 8 gradient accumulation)
Learning rate 2e-4, cosine schedule, 3% warmup
Optimizer AdamW (8-bit)
Precision bf16
Total steps 525
Final train loss 0.277 (started at 0.88)

Training ran on a single GPU using Unsloth for accelerated QLoRA fine-tuning; total wall-clock training time was approximately 1.5 hours.

Evaluation

The fine-tuned model was compared against the unmodified Qwen2.5-7B-Instruct model on 82 held-out test transcripts. Outputs from both models were judged pairwise (blind, order-randomized) by an independent LLM judge on faithfulness to the source transcript and completeness of the extracted information.

Result: MEMORYDistillPL-1.5b was preferred in approximately 55/82 (~67%) of comparisons against the 7B baseline, despite being roughly 4.5x smaller.

Limitations and Known Issues

  • Abbreviation hallucination: the model occasionally invents plausible-looking but incorrect English expansions for Polish domain abbreviations that do not appear in the source text.
  • Occasional missed entities: in a minority of cases the model omits an entity that should have been extracted.
  • Evaluated only on Polish-language conversational transcripts up to 8k tokens; behavior on other languages, domains, or longer inputs is untested.
  • As with any LLM-based summarizer, outputs should not be treated as guaranteed-faithful to the source without verification in high-stakes use cases.

How to Use

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "cenkierpiotr/MEMORYDistillPL-1.5b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")

messages = [
    {"role": "system", "content": "Jesteล› asystentem streszczajฤ…cym rozmowy w ustrukturyzowanฤ… notatkฤ™."},
    {"role": "user", "content": "<transkrypt rozmowy>"},
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))

Quantized GGUF builds are also provided for llama.cpp-compatible runtimes (e.g. Ollama, LM Studio) โ€” see the format table below.

Files in This Repository

  • model.safetensors, config.json, tokenizer.json, tokenizer_config.json, chat_template.jinja, generation_config.json โ€” merged bf16 weights, ready for transformers
  • adapter/adapter_model.safetensors, adapter/adapter_config.json โ€” the LoRA adapter alone, for use with PEFT on top of the base model
  • GGUF quantized builds, MEMORYDistillPL-1.5b.<TYPE>.gguf:
Variant Size Notes
F16 3.09 GB full precision โ€” reference / re-quantization base
Q8_0 1.65 GB near-lossless
Q6_K 1.27 GB very high quality
Q5_K_M 1.13 GB high quality, good balance
Q5_K_S 1.10 GB high quality, slightly smaller
Q4_K_M 986 MB recommended default โ€” best quality/size balance
Q4_K_S 940 MB smaller, noticeable quality drop
Q4_0 935 MB legacy 4-bit format, broad compatibility
Q3_K_L 880 MB acceptable quality at further reduction
Q3_K_M 824 MB noticeably lower quality
Q3_K_S 761 MB markedly lower quality
Q2_K 676 MB smallest, lowest quality

At this model size (1.5B), low-bit quantization (Q3/Q2) degrades quality more noticeably than on larger models โ€” Q4_K_M or higher is recommended for most uses.


Polski

MEMORYDistillPL-1.5b to dostrojona wersja Qwen2.5-1.5B-Instruct, wytrenowana metodฤ… QLoRA do jednego, wฤ…skiego zadania: zamiany dล‚ugiego, polskojฤ™zycznego transkryptu rozmowy w zwiฤ™zล‚ฤ…, ustrukturyzowanฤ… notatkฤ™ pamiฤ™ciowฤ… โ€” streszczenie tego, co zostaล‚o ustalone, wraz z wyodrฤ™bnionymi encjami (osoby, organizacje, decyzje, fakty) wymienionymi w rozmowie.

Model nie jest modelem ogรณlnego przeznaczenia do swobodnej konwersacji โ€” jest zoptymalizowany pod jedno zadanie ekstrakcyjno-streszczajฤ…ce, kosztem wszechstronnoล›ci.

Szczegรณล‚y modelu

  • Model bazowy: Qwen/Qwen2.5-1.5B-Instruct
  • Architektura: Qwen2 โ€” 28 warstw, hidden 1536, 12 gล‚รณw uwagi / 2 KV (GQA), sล‚ownik 151 936, okno kontekstu 32 768 tok.
  • Metoda dostrojenia: QLoRA (baza 4-bit NF4 + adaptery LoRA), przez Unsloth + PEFT/TRL
  • Jฤ™zyk: polski (podstawowy); model bazowy zachowuje ogรณlnฤ… wielojฤ™zycznoล›ฤ‡
  • Licencja: Apache 2.0 (dziedziczona po modelu bazowym Qwen2.5-1.5B-Instruct)

Przeznaczenie

  • Destylacja polskojฤ™zycznych transkryptรณw rozmรณw w zwiฤ™zล‚ฤ…, ustrukturyzowanฤ… notatkฤ™
  • Ekstrakcja encji (osoby, organizacje, decyzje, fakty) z tekstu rozmowy
  • Lekka, szybka alternatywa dla duลผo wiฤ™kszych modeli ogรณlnego przeznaczenia โ€” przy tym jednym, wฤ…skim zadaniu

Do czego model NIE jest przeznaczony: ogรณlna konwersacja i podฤ…ลผanie za dowolnymi instrukcjami poza zadaniem streszczania/ekstrakcji, jฤ™zyki inne niลผ polski (nietestowane i nieoptymalizowane), zastosowania o wysokiej stawce bez weryfikacji przez czล‚owieka.

Dane treningowe

  • 1394 przykล‚ady treningowe / 164 walidacyjne / 82 testowe (held-out), ล‚ฤ…cznie 1640.
  • Kaลผdy przykล‚ad to para: transkrypt rozmowy โ†’ docelowa ustrukturyzowana notatka (cele treningowe wygenerowane przez model nauczycielski i uลผyte jako dane do uczenia nadzorowanego).
  • Dane to ogรณlnodomenowy polskojฤ™zyczny tekst konwersacyjny. Sam korpus treningowy nie jest publikowany razem z wagami modelu.

Procedura treningu

Hiperparametry QLoRA

Parametr Wartoล›ฤ‡
LoRA rank (r) 16
LoRA alpha 16
LoRA dropout 0
Moduล‚y docelowe q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Maks. dล‚ugoล›ฤ‡ sekwencji 8192 tok.
Epoki 3
Efektywny batch size 8 (1 ร— 8 grad. accum.)
Learning rate 2e-4, cosine, warmup 3%
Optymalizator AdamW 8-bit
Precyzja bf16
Kroki ล‚ฤ…cznie 525
Strata koล„cowa (train loss) 0.277 (start: 0.88)

Trening przeprowadzony na pojedynczej karcie GPU przy uลผyciu Unsloth (przyspieszony QLoRA) + PEFT/TRL; ล‚ฤ…czny czas treningu ok. 1,5 h.

Ewaluacja

Model porรณwnano z niedostrojonym Qwen2.5-7B-Instruct na 82 przykล‚adach testowych (held-out). Odpowiedzi obu modeli oceniaล‚ ล›lepo, w losowej kolejnoล›ci, niezaleลผny model-sฤ™dzia โ€” pod kฤ…tem wiernoล›ci ลบrรณdล‚owemu transkryptowi i kompletnoล›ci wyodrฤ™bnionych informacji.

Wynik: MEMORYDistillPL-1.5b byล‚ preferowany w ok. 55/82 (~67%) porรณwnaล„ wzglฤ™dem bazy 7B, mimo ลผe jest ok. 4,5x mniejszy.

Ograniczenia i znane problemy

  • Halucynacje rozwiniฤ™ฤ‡ skrรณtรณw: model sporadycznie wymyล›la wiarygodnie brzmiฤ…ce, ale bล‚ฤ™dne angielskie rozwiniฤ™cia polskich skrรณtรณw branลผowych, ktรณrych nie ma w tekล›cie ลบrรณdล‚owym.
  • Pomijane encje: w mniejszoล›ci przypadkรณw model pomija encjฤ™, ktรณra powinna zostaฤ‡ wyodrฤ™bniona z transkryptu.
  • Ewaluacja objฤ™ล‚a wyล‚ฤ…cznie polskojฤ™zyczne transkrypty konwersacyjne o dล‚ugoล›ci do 8k tokenรณw โ€” zachowanie poza tym zakresem (inne jฤ™zyki, dล‚uลผsze wejล›cia, inne domeny) nie zostaล‚o zbadane.
  • Jak w przypadku kaลผdego streszczenia generowanego przez LLM, wynik nie powinien byฤ‡ traktowany jako gwarantowanie wierny ลบrรณdล‚u bez weryfikacji w zastosowaniach o wysokiej stawce.

Sposรณb uลผycia

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "cenkierpiotr/MEMORYDistillPL-1.5b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")

messages = [
    {"role": "system", "content": "Jesteล› asystentem streszczajฤ…cym rozmowy w ustrukturyzowanฤ… notatkฤ™."},
    {"role": "user", "content": "<transkrypt rozmowy>"},
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))

Skwantyzowane buildy GGUF sฤ… rรณwnieลผ dostฤ™pne dla runtime'รณw zgodnych z llama.cpp (np. Ollama, LM Studio) โ€” patrz tabela formatรณw niลผej.

Pliki w tym repozytorium

  • model.safetensors, config.json, tokenizer.json, tokenizer_config.json, chat_template.jinja, generation_config.json โ€” scalone wagi bf16, gotowe do transformers
  • adapter/adapter_model.safetensors, adapter/adapter_config.json โ€” sam adapter LoRA, do uลผycia z PEFT na modelu bazowym
  • Skwantyzowane buildy GGUF, MEMORYDistillPL-1.5b.<TYP>.gguf:
Wariant Rozmiar Uwagi
F16 3.09 GB peล‚na precyzja โ€” baza referencyjna / do rekwantyzacji
Q8_0 1.65 GB praktycznie bezstratny
Q6_K 1.27 GB bardzo wysoka jakoล›ฤ‡
Q5_K_M 1.13 GB wysoka jakoล›ฤ‡, dobry balans
Q5_K_S 1.10 GB wysoka jakoล›ฤ‡, nieco mniejszy
Q4_K_M 986 MB zalecany domyล›lny โ€” najlepszy balans jakoล›ฤ‡/rozmiar
Q4_K_S 940 MB mniejszy, zauwaลผalny spadek jakoล›ci
Q4_0 935 MB starszy format 4-bit, szeroka kompatybilnoล›ฤ‡
Q3_K_L 880 MB akceptowalna jakoล›ฤ‡ przy dalszej redukcji
Q3_K_M 824 MB zauwaลผalnie niลผsza jakoล›ฤ‡
Q3_K_S 761 MB wyraลบnie niลผsza jakoล›ฤ‡
Q2_K 676 MB najmniejszy, najniลผsza jakoล›ฤ‡

Przy modelu tej wielkoล›ci (1.5B) niskobitowe warianty (Q3/Q2) tracฤ… na jakoล›ci wyraลบniej niลผ przy duลผych modelach โ€” dla wiฤ™kszoล›ci zastosowaล„ zalecany Q4_K_M lub wyลผej.

Downloads last month
566
Safetensors
Model size
2B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for cenkierpiotr/MEMORYDistillPL-1.5b

Adapter
(1684)
this model