--- license: other license_name: lfm-open-license-v1.0 license_link: LICENSE base_model: LiquidAI/LFM2.5-1.2B-Base datasets: - tobil/qmd-query-expansion-train-v2 pipeline_tag: text-generation library_name: transformers tags: - lfm2.5 - qmd - query-expansion - transformers - gguf - v2 - base --- # langleu/qmd-query-expansion-lfm2.5-1.2b-base-v2 LiquidAI/LFM2.5-1.2B-Base fine-tuned with LoRA for QMD query expansion using the **v2** data recipe. This repository contains the merged BF16 Transformers checkpoint at its root and QMD-ready GGUF quantizations alongside it. ## Repository formats - **Merged BF16 Transformers checkpoint:** load the repository directly with `AutoModelForCausalLM.from_pretrained("langleu/qmd-query-expansion-lfm2.5-1.2b-base-v2", torch_dtype=torch.bfloat16)`. - **GGUF for QMD/llama.cpp:** `qmd-query-expansion-lfm2.5-1.2b-q8_0.gguf`, `qmd-query-expansion-lfm2.5-1.2b-q5_k_m.gguf`, `qmd-query-expansion-lfm2.5-1.2b-q4_k_m.gguf` The BF16 checkpoint is the unquantized merged fine-tune. The GGUF files are derived from that same merged checkpoint. ## Artifact validated by this publishing invocation - File: `qmd-query-expansion-lfm2.5-1.2b-q5_k_m.gguf` - Kind: GGUF - Size: 843,354,048 bytes - SHA-256: `c51ccefa421b77cef13999049e520f807b58158057449784a3c9669e31a08963` - Base model: [`LiquidAI/LFM2.5-1.2B-Base`](https://huggingface.co/LiquidAI/LFM2.5-1.2B-Base) - Base revision: `f6a5d174bc3e52bd0df245d69133f9930b4828d8` - Dataset: [`tobil/qmd-query-expansion-train-v2`](https://huggingface.co/datasets/tobil/qmd-query-expansion-train-v2) - Dataset revision: `9b9c3dd41a11209f3ce907908f9b865f0ead415e` - Configured release quantizations: Q8_0, Q5_K_M, Q4_K_M - Evaluation report: `q5_k_m` ## Prompt and behavior ```text /no_think Expand this search query: {query} ``` This variant supports the production v2 QMD behavior: an optional `Query intent:` line and `/only:lex`, `/only:vec`, and `/only:hyde` directives. Each emitted line begins with `lex:`, `vec:`, or `hyde:`. ## Use with QMD The Transformers checkpoint is not loaded by QMD directly; select one of the GGUF files. For a private repository, authenticate once with `hf auth login`, or set `HF_TOKEN`. QMD's `node-llama-cpp` downloader reads the cached Hugging Face token from `~/.cache/huggingface/token` by default. ```bash export QMD_GENERATE_MODEL="hf:langleu/qmd-query-expansion-lfm2.5-1.2b-base-v2/qmd-query-expansion-lfm2.5-1.2b-q5_k_m.gguf" qmd query --json --explain --no-rerank "docker container shutdown timeout" ``` ## Training-data provenance Training records were rebuilt from the pinned dataset's `messages` field with the target LFM2.5 tokenizer. The dataset's preformatted Qwen text was not used. Completion-only loss masked the user prompt. ## Validation - Average QMD reward: 95.17% - Format compliance: 100.00% - Entity preservation: 98.31% - `/only:*` behavior: 100.00% - Hard failures: 0 ## BF16 and GGUF comparison | Format | Avg reward | Δ vs BF16 | Format compliance | Entity | `/only:*` | |---|---|---|---|---|---| | BF16 | 95.13% | baseline | 100.00% | 100.00% | 100.00% | | Q8_0 | 94.91% | -0.22 pp | 99.68% | 96.61% | 98.85% | | Q5_K_M | 95.17% | +0.04 pp | 100.00% | 98.31% | 100.00% | | Q4_K_M | 94.76% | -0.37 pp | 100.00% | 98.31% | 100.00% | Quality changes are reported in **percentage points (pp)**, not relative percent. Small positive GGUF deltas can occur because sampled generation is not bit-for-bit deterministic. Speed percentages are intentionally not reported. BF16 was measured with batched Transformers inference, while QMD runs GGUF through llama.cpp one query at a time. Their observed throughput and latency are useful operational measurements, but dividing them would not be an apples-to-apples speedup. ## Credits - [Liquid AI](https://huggingface.co/LiquidAI) for LFM2.5 and the LFM Open License v1.0. - [Tobi](https://huggingface.co/tobil) for QMD, the QMD query-expansion datasets, evaluation/scoring design, and the Qwen3 query-expansion model. - [OrcsRise](https://huggingface.co/OrcsRise/qmd-query-expansion-lfm2-sft) for the earlier LFM2 QMD fine-tuning work that informed the LFM target-module recipe. - [QMD](https://github.com/tobi/qmd), [TRL](https://github.com/huggingface/trl), [PEFT](https://github.com/huggingface/peft), and [llama.cpp](https://github.com/ggml-org/llama.cpp). ## Licensing and dataset notice This derivative is governed by the **LFM Open License v1.0**. The included `LICENSE` must be retained, including its attribution and commercial-use terms. The upstream QMD dataset card did not declare an explicit dataset license at the pinned revision. This repository records that fact and does not imply that a license was granted. Users and redistributors are responsible for confirming that their use is authorized.