--- license: apache-2.0 language: - en tags: - llm - small-language-model - rag - knowledge-packs - llama-cpp - gguf - retrieval - tool-calling pipeline_tag: text-generation library_name: transformers --- # LSLM 1 — Logical Small Language Model **A small language model that does not memorize the world. It looks facts up.** LSLM 1 is a ~253M-parameter decoder-only transformer trained from scratch. Unlike a conventional LLM, it is deliberately *not* trained to store facts in its weights. Instead it reads facts from **swappable knowledge packs** on disk — small SQLite full-text indexes — and answers only from the passages it retrieves, citing each fact with a `[n]` source marker. Swap the pack, and the model's knowledge changes — the model itself stays the same. - **Parameters:** 252,968,960 (tied embeddings) - **Architecture:** decoder-only transformer, RMSNorm, RoPE, GQA (16 heads / 8 KV heads), SwiGLU - **Context:** 2048 (runs at 3072 in the app) - **Vocabulary:** 32,000 (custom SentencePiece BPE) - **License:** Apache 2.0 ## The idea A normal LLM stores the world in its weights, which is why it needs billions of parameters and still hallucinates. LSLM takes a **novel approach**: the model stays small and learns only **language, logic and tool use**, while the facts live outside it, in on-disk knowledge packs. On any factual question the model must search first, answer only from the retrieved passages, and cite the source. If the packs have nothing, it says so plainly instead of guessing. This is the first release of LSLM's own model. The earlier `LSLM-beta` was a fine-tuned Granite 4.2 3B; LSLM 1 replaces it with a model trained from scratch for this exact task. ## Why it matters - **Honesty by design.** The model is trained so the pack wins over memory. In tests, when a fact was *changed* in the pack, LSLM 1 reported the pack's value 90% of the time and almost never fell back to the memorized value. - **Small and fast.** ~253M parameters run at ~360 tokens/s in the app — about 4× faster than a 1.7B baseline — while beating a 600M model on the same task. - **Swappable knowledge.** Change the pack (a different language, a private corpus, a newer snapshot) and the same weights answer from it. No retraining. - **Runs anywhere.** GGUF weights work with llama.cpp, Ollama and LM Studio on macOS, Windows and Linux. ## Evaluation LSLM 1 was compared against three open models of its class and above on 298 questions across seven sets, in three modes: - **closed** — the model alone (no packs, no tools); - **env** — inside LSLM's environment (its prompt, the search tool and the packs); - **web** — env plus live web search. | model | closed | env | web | |---|---|---|---| | lfm3-1.7b (1.7B) | 48% | 94% | 97% | | **LSLM 1 (253M)** | **0%** | **70%** | **53%** | | baguettotron (321M) | 34% | 56% | 100% | | bag-600m (600M) | 38% | 1% | 0% | The headline result: **alone, LSLM 1 answers 0% correctly — it has almost no facts memorized. Inside its environment it reaches 70%, beating the 600M baseline (1%) and the 321M baseline (56%), and trailing only the 1.7B model.** That is exactly the point: the knowledge comes from the packs, not from the weights. Per-set results in the environment (correct answers): | set | LSLM 1 | |---|---| | facts from unseen articles | 92% | | pack value overrides memory | 90% | | made-up subject → "not found" | 87% | | well-known facts | 79% | | two packs disagree → report both | 6% | | arithmetic | 0% | Known weaknesses: arithmetic is near zero — the model does not yet read mathematical formulas from the packs and substitute values into them, which is planned as a core skill (reading + reasoning), not an external tool; and reporting *both* sides when two packs disagree is still weak (6%) — the next training iteration targets both. Web search reaches 53%. ## Quick start ```python from transformers import AutoModelForCausalLM, AutoTokenizer model = AutoModelForCausalLM.from_pretrained("NoMusic/LSLM-1") tokenizer = AutoTokenizer.from_pretrained("NoMusic/LSLM-1") ``` Or run the GGUF with llama.cpp / Ollama / LM Studio. The full application (local web UI, knowledge-pack search, installer for macOS/Windows/Linux) is on GitHub: https://github.com/andrewtab4-commits/LSLM ## Roadmap | version | model | state | |---|---|---| | LSLM beta | Granite 4.2 3B + adapter | works now | | **LSLM 1** | own ~253M model | **this release** | | LSLM 2 | own ~500M model | next | | LSLM 3 | own ~1B model | later — depends on funding and donations | | LSLM 4 | own ~3B model, many languages | long-term goal | ## Support LSLM is funded by one person out of pocket. Help fund LSLM 2 and LSLM 3 (they need rented GPUs): **[lslm.netlify.app](https://lslm.netlify.app)**. ## Training Trained from scratch on ~3.8B tokens (≈15 tokens/parameter) on a single H100, then fine-tuned on pack-conflict and web-search examples. Full training code is in the GitHub repository.