LFM3-AA1 (LFM3 Abreviated Answer)
LFM3-AA1 (LFM3 Abreviated Answer) is a reasoning-compressed, abliterated 1.7B-parameter language model built on top of Peymandc/LFM3-1.7B-Heretic-Uncensored (itself derived from LiquidAI/LFM3-1.7B).
Using pure-DPO preference optimization on self-generated oracle-verified reasoning traces (56 pairs, beta=0.1, 3 epochs), LFM3-AA1 cuts reasoning token usage by 43–44% on structured reasoning tasks (and 13–31% on GSM8K / MATH-500) while recovering +3% on GSM8K (88% -> 91%) and +6% on MATH-500 (60% -> 66%) over the abliterated base model, achieving 0 regressions, 0 token-cap failures on holdout reasoning, -31.9% tokens on multi-turn agentic tasks, and 0/2 refusals on abliteration spot-checks.
- GitHub Repository & Reproducible Scripts:
ronasimi/lfm3-aa1 - Hugging Face Repository:
madscience75/LFM3-AA1
Available Formats & SHA256 Checksums
| Artifact | Format | Size | SHA256 |
|---|---|---|---|
model.safetensors (download) | BF16 Safetensors | 3.46 GB | 01a2607387459570a16c869d95123c39faefe953aa05738c671ca4a40a83d8b2 |
LFM3-AA1-BF16.gguf (download) | BF16 GGUF | 3.47 GB (3.3 GiB) | 5af1664f5b79f465a9727194ead902baeaf4d000fdd9aa86c53530c440752340 |
LFM3-AA1-Q8_0.gguf (download) | Q8_0 GGUF | 1.85 GB (1.8 GiB) | cc2962c4c6ed6bfb7f11fef842d862a3d8928206b21d8265b3f1867bd3f78726 |
LFM3-AA1-IQ4_XS.gguf (download) | IQ4_XS GGUF (imatrix, 4.61 BPW) | 1.00 GB (949.43 MiB) | f70caafff6b7eff95536ae2913a9901fdcdc03cc72f1bd2a86758a2c162adbaf |
All model files (config.json, tokenizer.json, chat_template.jinja, modeling files, and GGUFs) are hosted in the madscience75/LFM3-AA1 file tree.
Benchmark Comparisons
1. Standard Math Benchmarks (Kaggle 2×T4, BF16, do_sample=False, max_new_tokens=2048)
Evaluated with aa1_std_bench.py on the first 100 problems of GSM8K (openai/gsm8k, test) and MATH-500 (HuggingFaceH4/MATH-500, test).
| Model | GSM8K Pass | GSM8K Caps | GSM8K Mean / Med rtok | MATH-500 Pass | MATH-500 Caps | MATH-500 Mean / Med rtok |
|---|---|---|---|---|---|---|
LiquidAI/LFM3-1.7B (Stock) | 92/100 (92.0%) | 4 | 603.4 / 392.5 | 69/100 (69.0%) | 24 | 889.9 / 594.5 |
Peymandc/LFM3-1.7B-Heretic-Uncensored (Base) | 88/100 (88.0%) | 8 | 711.2 / 457.5 | 60/100 (60.0%) | 36 | 1064.2 / 771.0 |
LFM3-AA1 (Ours, BF16) | 91/100 (91.0%) | 2 | 493.3 / 345.0 | 66/100 (66.0%) | 29 | 926.3 / 535.0 |
Delta vs. Abliterated Base (Peymandc/LFM3-1.7B-Heretic-Uncensored):
- GSM8K: +3.0% accuracy (
88% -> 91%), -6 caps, -30.6% mean reasoning tokens (711.2 -> 493.3), -24.6% median reasoning tokens (457.5 -> 345.0). - MATH-500: +6.0% accuracy (
60% -> 66%), -7 caps, -13.0% mean reasoning tokens (1064.2 -> 926.3), -30.6% median reasoning tokens (771.0 -> 535.0).
Delta vs. Stock (LiquidAI/LFM3-1.7B):
- GSM8K: Within 1 point of stock (
91%vs92%) with fewer caps (2vs4) and -18.2% mean / -12.1% median reasoning tokens. - MATH-500: -10.0% median reasoning tokens (
594.5 -> 535.0) while retaining66%accuracy and uncensored behavior.
(Note: aa1_std_bench.py also included a 5-prompt tool_calling check, which scored 0/5 across all three models — Stock, Base, and LFM3-AA1 — because the harness looked for OpenAI-style {"arguments": ...} JSON rather than LFM3's native <|tool_call_start|>[...]<|tool_call_end|> syntax.)
2. Locked Holdout Suite (final_holdout_locked.json, 24 Oracle-Verified Tasks)
Evaluated across 4 task families (math_seq, schedule_time, state_ops, prefix_recovery) with max_new_tokens=4096.
| Model / Quant | Pass | Caps | Total Reasoning Tokens | Aggregate rtok Delta | Median rtok Delta |
|---|---|---|---|---|---|
Base Heretic-Uncensored (BF16) | 24/24 | 0 | 35,974 | — | — |
LFM3-AA1 (BF16.gguf) | 24/24 | 0 | 20,514 | -42.98% | -39.52% |
LFM3-AA1 (Q8_0.gguf) | 24/24 | 0 | 20,258 | -43.69% | -42.98% |
LFM3-AA1 (IQ4_XS.gguf, 4.61 BPW) | 22/24 | 0 | 25,402 | -29.39% | -24.96% |
(On IQ4_XS, 2 tasks — final-s2 and final-a3 — missed due to 4-bit quantization noise; BF16 and Q8_0 achieved 24/24.)
3. Dev Eval Suite (dev_eval_tasks.json, 24 Oracle-Verified Tasks)
| Model | Pass | Regressions | Caps | Passing Reasoning Tokens | Aggregate rtok Delta | Median rtok Delta |
|---|---|---|---|---|---|---|
Base Heretic-Uncensored (BF16) | 22/24 | — | 0 | 30,516 | — | — |
LFM3-AA1 (BF16) | 22/24 | 0 | 0 | 17,958 | -41.15% | -44.27% |
4. Paired Local Agentic Suite (Q8_0, 4096 Total Tokens / Run)
Evaluated locally via llama-server on 3 multi-step agentic tasks (clamp, schedule, follow_pointer).
Model (Q8_0) | Rubric Score | Full Pass | Total Tokens | Caps | Breakdown (clamp / schedule / follow_pointer) |
|---|---|---|---|---|---|
Base Heretic-Uncensored | 9/12 | 0/3 | 7,377 | 1 | 3/4 cap 4096 / 3/4 2443 tok / 3/4 838 tok |
LFM3-AA1 | 10/12 | 1/3 | 5,025 (-31.9%) | 0 | 4/4 915 tok / 3/4 3294 tok / 3/4 816 tok |
5. Abliteration Preservation Spot-Check (Q8_0)
Tested on 2 standard abliteration verification prompts (abliteration_spotcheck.json):
- Refusals:
0/2(refused: falseon both prompts).
Exact Reproducible Recipe
1. Base Model & Environment
- Base Model:
Peymandc/LFM3-1.7B-Heretic-Uncensored - Pinned Revision:
72c1fa3b225c4663f9de0a682d6909cc14599125 - Base
model.safetensorsSHA256:833e0f1994c6809a728f6698735a00fc8643e974c64284b7bd7853d1dfb9b29b - Special Token IDs:
THINK_END = 124902,EOS_ID = 124900
2. Synthetic Task Splits & Rollout Collection (generate_tasks.py, aa1_phase1_worker.py, build_dpo_pairs.py)
- Generated 3 non-overlapping oracle-verified splits across
math_seq,schedule_time,state_ops, andprefix_recovery:dev_train_tasks.json(120 tasks, SHA256:e12a9ed057ad8bfbef3ee0b0e6fddb6ae07d1611e2da2db3ca55980d6816de5b)dev_eval_tasks.json(24 tasks, SHA256:be0f53f04cdbe815510b4dfe715970672d941e4ea07d5b029a260318da4ff6ea)final_holdout_locked.json(24 tasks, SHA256:69cd59fc552c1b6308eea7a527ce7f1927031288c9c2e7d9d6d2b4212c3ed8b5)
- Collected 6 rollouts per training task (
720total rollouts across 3 Kaggle T4 workers;106/120tasks passing). - Constructed shortest-correct vs. longest-correct DPO preference pairs (
build_dpo_pairs.py). The winning training run (dpo_beta01_ep3) used the56preference pairs from the first 2 rollout shards.
3. Pure-DPO LoRA Training (aa1_phase2_trainer.py)
Trained on Kaggle (NvidiaTeslaT4, BF16) with PEFT LoRA:
- LoRA Config:
r=16,lora_alpha=32,lora_dropout=0.05,bias="none",task_type="CAUSAL_LM",target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "w1", "w2", "w3"] - DPO Hyperparameters:
pairs:56beta:0.1sft_weight:0.0(pure DPO; adding SFT weight degraded agenticscheduleperformance)epochs:3lr:5e-5(AdamW,weight_decay=0.01,clip_grad_norm_=1.0)grad_accum:8max_len:1536
- Merge:
model.merge_and_unload()in BF16.
4. GGUF Conversion & Quantization (llama.cpp)
Converted and quantized using llama.cpp (convert_hf_to_gguf.py commit b1b770d90d94cad9e9ea5b993bdbc383a522fb28, transformers==5.21.0):
# 1. Convert merged BF16 Hugging Face model to BF16 GGUF
python convert_hf_to_gguf.py merged_model --outfile LFM3-AA1-BF16.gguf --outtype bf16
# 2. Quantize to Q8_0
llama-quantize LFM3-AA1-BF16.gguf LFM3-AA1-Q8_0.gguf Q8_0
# 3. Generate importance matrix and quantize to IQ4_XS
llama-imatrix -m LFM3-AA1-BF16.gguf -f calibration.txt -o imatrix.dat --chunks 64
llama-quantize --imatrix imatrix.dat LFM3-AA1-BF16.gguf LFM3-AA1-IQ4_XS.gguf IQ4_XS
Usage (llama-server / llama.cpp)
llama-server \
-m LFM3-AA1-Q8_0.gguf \
--alias lfm-aa1 \
--ctx-size 32768 \
--jinja