Downloads · 30 days
65
6% of all-time downloads
sennaLLMLearner/qwen2.5-7b-memory-distiller
qwen2.5-7b-memory-distiller is a text generation model from sennaLLMLearner. 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 small model fine-tuned to turn a conversation log into clean, searchable structured-memory JSON for later recall, running locally on an edge device. Fine-tuned from Qwen/Qwen2.5-7B-Instruct via SFT warmup → ORPO, di…
Downloads · 30 days
65
6% of all-time downloads
All-time downloads
1K
Public
Parameters
7.6B
19.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors15.2 GB · 76%
From the Hugging Face model README
A small model fine-tuned to turn a conversation log into clean, searchable structured-memory
JSON for later recall, running locally on an edge device. Fine-tuned from
Qwen/Qwen2.5-7B-Instruct via SFT warmup → ORPO, distilling a DeepSeek-V3 teacher, and
optimized to follow 5 content principles (below) when compressing a conversation into memory.
This is a structured-distillation (memory-summarization) model, not a general summarizer. It is meant to run locally on an edge device and emit schema-conformant memory objects.
This model powers the local memory layer of codeatrium, a personal-memory app: it distills conversations into searchable memories. The goal was a local / free / private 7B that runs on an edge device (via Ollama Q4_K_M) and could replace the larger distiller previously used in that role. It's a personal project: the dataset and evaluation are small-scale, the "5 principles" are a custom rubric drawn from the memory-distillation literature, and training was stopped pragmatically once it reached practical quality (2 ORPO epochs), not pushed to convergence. Metrics and acceptance gates were pre-registered before running the final evals, and only what survived is reported (see How I know).
The model is trained with these 5 principles as the preference signal (chosen/rejected). Each is a content-level best practice backed by external work on memory systems and retrieval.
| Principle | Definition | Primary source | Basis (key figure) | How it's measured |
|---|---|---|---|---|
| completeness (recall) | capture the source's important specifics without dropping them | ProMem (arXiv:2601.04463) | verification+completion raises memory integrity 54→74%; +30.89pp vs Mem0 on HaluMem; +10.74pt transfer on Llama3-8B (the one principle confirmed to help at small scale) | deterministic: specifics recall against the source, no LLM judge |
| lexical_fidelity | keep numbers, commands, identifiers verbatim, not paraphrased | SPAR (arXiv:2110.06918) / Searchat (arXiv:2603.13017) | dense retrievers miss rare entities / salient phrases that BM25 catches (lexical-fidelity gap); Searchat retains 96.8% of query vocabulary after distillation | deterministic: verbatim-retention rate among captured specifics (correlated with completeness, not fully independent) |
| atomicity | one memory = one fact; no cramming multiple facts together | TriMem (arXiv:2605.19952) / Mem0 | fact-centric atomic decomposition; coarse-only memory blocks deep reasoning across scattered facts | LLM judge only; no deterministic anchor |
| discriminative | carries specific info that can be retrieved / told apart (not generic labels) | GAAMA (arXiv:2603.27910) / HippoRAG (arXiv:2405.14831) | generic labels ("programming") make megahub nodes that absorb retrieval mass (megahub problem); discriminative tags narrow retrieval | LLM judge only; no deterministic anchor |
| faithfulness (precision) | do not fabricate specifics absent from the source | ProMem (arXiv:2601.04463) / HaluMem (arXiv:2511.03506) | stronger completion increases fabrication risk (the flip side of completeness); HaluMem measures hallucination | deterministic: specifics precision against the source, no LLM judge |
Eval note.
completenessandfaithfulnessare measured without an LLM judge as set recall / precision of specifics (numbers, identifiers, commands, paths, quoted strings) against the source.lexical_fidelityis a supplementary verbatim-retention rate (not independent of completeness).atomicityanddiscriminativerequire structural/semantic judgment and are measured only via LLM judges — they carry no deterministic anchor (see limitations).
Qwen/Qwen2.5-7B-Instruct. Teacher: DeepSeek-V3 (distillation target).I evaluated distillation quality (the 5 principles), not downstream retrieval. Metrics and acceptance gates were pre-registered before the final runs.
It beats the incumbent on the deployment task. On my codeatrium production path (all arms
Ollama Q4_K_M, 48 independent real conversations), this 7B outperforms both
qwen2.5-coder:14b (my previous distiller) and raw qwen2.5:7b. The win is not judge-dependent —
it holds under a same-family judge (Qwen2.5-72B), a different-family judge (Llama-3.3-70B), a
judge-free specifics metric, and a blind human rating (n=30, FT vs the 14B):
It generalizes to unseen structured schemas — but not to everything. On 5 held-out schemas it never trained on (measured judge-free), it beats raw 7B on field-structured formats (nested JSON, typed record, entity-relation graph — all significant) but only ties on flat / hard-length-capped formats (flat Markdown bullets, ≤12-word YAML). So the honest claim is: generalizes to unseen field-structured schemas; no edge on flat / heavily-constrained formats. (codeatrium's schema is field-structured, consistent with the deployment win.)
atomicity is measurement-limited. LLM judges score a large FT win, but blind humans rated it a
near-tie (27/30 ties) — the judge win is not human-confirmed. Treat atomicity cautiously.discriminative is family-sensitive. Human- and judge-confirmed vs the 14B, but vs raw 7B it
was not significant under a cross-family judge.Deployment target is Ollama Q4_K_M, called via an OpenAI-compatible endpoint
(http://localhost:11434/v1) — the same path codeatrium uses. Prompt the model with your distillation
instruction + schema + the conversation, and read back the structured JSON (greedy / temperature 0 for
determinism). The 5-principle behavior is strongest on field-structured schemas.
Technical note: this repo ships the fully merged weights (base ⊕ SFT-LoRA ⊕ ORPO-LoRA already baked in) — load it directly like any Qwen2.5-7B checkpoint, no adapter reconstruction needed. Internally it was trained as
stock Qwen ⊕ SFT-LoRA → merge → ⊕ ORPO-LoRA → merge; that provenance only matters if you're retraining from an intermediate checkpoint, not for inference.