MEMORYDistillPL-1.5b
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 fortransformersadapter/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 dotransformersadapter/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.