Text Generation
Transformers
Safetensors
GGUF
English
smollm3
formal-logic
reasoning
lora
model-merging
wise-ft
reinforcement-learning
grpo
twil-lm
conversational
Instructions to use webAI-Official/TwIL-LM3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use webAI-Official/TwIL-LM3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="webAI-Official/TwIL-LM3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("webAI-Official/TwIL-LM3") model = AutoModelForCausalLM.from_pretrained("webAI-Official/TwIL-LM3", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use webAI-Official/TwIL-LM3 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf webAI-Official/TwIL-LM3:Q4_K_M # Run inference directly in the terminal: llama cli -hf webAI-Official/TwIL-LM3:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf webAI-Official/TwIL-LM3:Q4_K_M # Run inference directly in the terminal: llama cli -hf webAI-Official/TwIL-LM3:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf webAI-Official/TwIL-LM3:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf webAI-Official/TwIL-LM3:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf webAI-Official/TwIL-LM3:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf webAI-Official/TwIL-LM3:Q4_K_M
Use Docker
docker model run hf.co/webAI-Official/TwIL-LM3:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use webAI-Official/TwIL-LM3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "webAI-Official/TwIL-LM3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "webAI-Official/TwIL-LM3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/webAI-Official/TwIL-LM3:Q4_K_M
- SGLang
How to use webAI-Official/TwIL-LM3 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "webAI-Official/TwIL-LM3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "webAI-Official/TwIL-LM3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "webAI-Official/TwIL-LM3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "webAI-Official/TwIL-LM3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use webAI-Official/TwIL-LM3 with Ollama:
ollama run hf.co/webAI-Official/TwIL-LM3:Q4_K_M
- Unsloth Studio
How to use webAI-Official/TwIL-LM3 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for webAI-Official/TwIL-LM3 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for webAI-Official/TwIL-LM3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for webAI-Official/TwIL-LM3 to start chatting
- Pi
How to use webAI-Official/TwIL-LM3 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf webAI-Official/TwIL-LM3:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "webAI-Official/TwIL-LM3:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use webAI-Official/TwIL-LM3 with Docker Model Runner:
docker model run hf.co/webAI-Official/TwIL-LM3:Q4_K_M
- Lemonade
How to use webAI-Official/TwIL-LM3 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull webAI-Official/TwIL-LM3:Q4_K_M
Run and chat with the model
lemonade run user.TwIL-LM3-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use webAI-Official/TwIL-LM3 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf webAI-Official/TwIL-LM3:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default webAI-Official/TwIL-LM3:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use webAI-Official/TwIL-LM3 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf webAI-Official/TwIL-LM3:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "webAI-Official/TwIL-LM3:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Update TwIL-LM3: weights, tokenizer and model card
Browse files
README.md
CHANGED
|
@@ -28,9 +28,10 @@ GRPO reinforcement learning.
|
|
| 28 |
|
| 29 |
It improves in-domain formal-logic performance by **+26% relative** over its base model
|
| 30 |
(macro gate 0.336 → 0.422) **and improves held-out benchmark performance at the same time**
|
| 31 |
-
(+0.022 core average).
|
|
|
|
| 32 |
|
| 33 |
-
|
| 34 |
|
| 35 |
## Results
|
| 36 |
|
|
@@ -63,6 +64,8 @@ delimiter-aware answer extractors rather than read from harness metrics.
|
|
| 63 |
| core average | 0.790 | **0.812** | **+0.022** |
|
| 64 |
| suite average (14 datasets) | 0.661 | **0.669** | **+0.008** |
|
| 65 |
|
|
|
|
|
|
|
| 66 |
|
| 67 |
Per-dataset, largest moves in each direction:
|
| 68 |
|
|
@@ -90,40 +93,55 @@ length`, so it measures completed answers rather than raw decode rate.
|
|
| 90 |
|
| 91 |
#### Track A — in-domain formal logic
|
| 92 |
|
| 93 |
-
| lane / metric | TwIL-LM3 | SmolLM3-3B base | Llama-3.2-3B | LFM2-2.6B | LFM2.5-8B-A1B |
|
| 94 |
-
|---|---:|---:|---:|---:|---:|
|
| 95 |
-
| lean_formalize token_f1 | **0.
|
| 96 |
-
| rule_induction derivation | **0.
|
| 97 |
-
| entailment_label accuracy | **0.
|
| 98 |
-
| mcq_answer accuracy | **0.
|
| 99 |
-
| semantic_parse token_f1 | **0.
|
| 100 |
-
| lean_critic accuracy | **0.6600** | 0.6500 | 0.5300 | 0.5900 | 0.5500 |
|
| 101 |
-
| lean_formalize exact_match | 0.0050 | 0.0050 | 0.0000 | 0.0000 | 0.0000 |
|
| 102 |
-
| fol_translation exact_match | 0.0000 | 0.0050 | 0.0000 | 0.0000 | 0.0000 |
|
| 103 |
-
| semantic_parse exact_match | 0.0000 | 0.0050 | 0.0000 | 0.0000 | 0.0000 |
|
| 104 |
-
| procedural accuracy | 0.0300 | 0.0050 | 0.0000 | 0.0300 | **0.0350** |
|
| 105 |
-
| procedural loose_match | 0.1100 | 0.1050 | 0.1050 | 0.1150 | **0.1400** |
|
| 106 |
-
| mcq_answer loose_match | 0.4450 | 0.5000 | 0.4150 | 0.5000 | 0.4550 |
|
| 107 |
-
| lm_corpus perplexity ↓ | 2.8972 | 3.1818 | **2.8478** | 4.3815 | 4.9472 |
|
| 108 |
-
| math_corpus perplexity ↓ | **3.
|
| 109 |
-
| **macro gate** | **0.
|
| 110 |
-
| **strict-7** | **0.
|
| 111 |
-
|
|
| 112 |
-
|
|
| 113 |
-
|
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
`strict-7` is the mean of seven lanes scored under strict metrics only (`fol_translation`,
|
| 117 |
`entailment_label`, `mcq_answer`, `semantic_parse` and `lean_formalize` exact match,
|
| 118 |
`lean_critic` and `procedural` accuracy), with no loose-match credit anywhere.
|
| 119 |
|
| 120 |
-
TwIL-LM3 leads both headline metrics
|
| 121 |
-
`lean_formalize` token-F1 0.5869 against 0.4655 for the nearest arm,
|
| 122 |
-
against 0.1936, and strict MCQ accuracy 0.1100, the only non-trivial
|
| 123 |
-
closest competitor on the macro gate is LFM2.5-8B-A1B at 0.3757, roughly
|
| 124 |
-
gives up: `procedural` under both scorings, loose MCQ where the base and
|
| 125 |
-
against its 0.4450, `lm_corpus` perplexity where Llama-3.2-3B is
|
| 126 |
-
exact-match rows that sit at or near zero for every arm.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
|
| 128 |
It is also the most efficient arm in the table by a wide margin — 28.1 answers/sec, from
|
| 129 |
generations averaging 564 tokens where every other arm except Llama runs past 690. The Liquid
|
|
@@ -163,7 +181,9 @@ Lengths marked ≈ are derived from stored generations using each model's charac
|
|
| 163 |
ratio rather than re-tokenized directly; the method reproduces the three directly measured
|
| 164 |
lengths to within 3.5%.
|
| 165 |
|
| 166 |
-
|
|
|
|
|
|
|
| 167 |
on the 10-dataset macro), which is the point of the WiSE-FT stage — in-domain gains without
|
| 168 |
transfer collapse. Second, it produces the shortest generations of any arm here at 482 tokens
|
| 169 |
and consequently the most answers per second at 32.9, roughly eight times the 120B's rate.
|
|
@@ -260,7 +280,10 @@ release is the balanced point of that trade; the other was not published.
|
|
| 260 |
|
| 261 |
**Truncation.** At a 2048-token budget, 4.4% of Track A generations hit the cap — better than
|
| 262 |
the base's 17.4%, but still above the 2% threshold our protocol requires to mark a comparison
|
| 263 |
-
`rankable`.
|
|
|
|
|
|
|
|
|
|
| 264 |
|
| 265 |
**Scope.** Tuned for formal logic. The Track B suite does not cover code generation or tool use
|
| 266 |
(HumanEval, LiveCodeBench and BFCL were not run for this model or its base), so this release
|
|
|
|
| 28 |
|
| 29 |
It improves in-domain formal-logic performance by **+26% relative** over its base model
|
| 30 |
(macro gate 0.336 → 0.422) **and improves held-out benchmark performance at the same time**
|
| 31 |
+
(+0.022 core average). It is the only arm in this project that gains on both tracks, which is
|
| 32 |
+
why it is the recommended release of the pair.
|
| 33 |
|
| 34 |
+

|
| 35 |
|
| 36 |
## Results
|
| 37 |
|
|
|
|
| 64 |
| core average | 0.790 | **0.812** | **+0.022** |
|
| 65 |
| suite average (14 datasets) | 0.661 | **0.669** | **+0.008** |
|
| 66 |
|
| 67 |
+
This model **passes the per-capability floor**: no core or held-out transfer metric drops by
|
| 68 |
+
more than the 0.02 tolerance against its base.
|
| 69 |
|
| 70 |
Per-dataset, largest moves in each direction:
|
| 71 |
|
|
|
|
| 93 |
|
| 94 |
#### Track A — in-domain formal logic
|
| 95 |
|
| 96 |
+
| lane / metric | TwIL-LM3 | TwIL-LM3* | SmolLM3-3B base | Llama-3.2-3B | LFM2-2.6B | LFM2.5-8B-A1B |
|
| 97 |
+
|---|---:|---:|---:|---:|---:|---:|
|
| 98 |
+
| lean_formalize token_f1 | 0.5869 | **0.6456** | 0.4347 | 0.3690 | 0.1321 | 0.4655 |
|
| 99 |
+
| rule_induction derivation | 0.3192 | **0.9644** | 0.1029 | 0.0825 | 0.0615 | 0.1936 |
|
| 100 |
+
| entailment_label accuracy | 0.5750 | **0.6867** | 0.3750 | 0.3300 | 0.4700 | 0.5400 |
|
| 101 |
+
| mcq_answer accuracy | 0.1100 | **0.5200** | 0.0000 | 0.0000 | 0.0150 | 0.0750 |
|
| 102 |
+
| semantic_parse token_f1 | 0.4416 | **0.8762** | 0.4149 | 0.3102 | 0.3665 | 0.3778 |
|
| 103 |
+
| lean_critic accuracy | **0.6600** | 0.5200 | 0.6500 | 0.5300 | 0.5900 | 0.5500 |
|
| 104 |
+
| lean_formalize exact_match | 0.0050 | — | 0.0050 | 0.0000 | 0.0000 | 0.0000 |
|
| 105 |
+
| fol_translation exact_match | 0.0000 | — | 0.0050 | 0.0000 | 0.0000 | 0.0000 |
|
| 106 |
+
| semantic_parse exact_match | 0.0000 | — | 0.0050 | 0.0000 | 0.0000 | 0.0000 |
|
| 107 |
+
| procedural accuracy | 0.0300 | — | 0.0050 | 0.0000 | 0.0300 | **0.0350** |
|
| 108 |
+
| procedural loose_match | 0.1100 | — | 0.1050 | 0.1050 | 0.1150 | **0.1400** |
|
| 109 |
+
| mcq_answer loose_match | 0.4450 | — | 0.5000 | 0.4150 | 0.5000 | 0.4550 |
|
| 110 |
+
| lm_corpus perplexity ↓ | 2.8972 | 3.1284 | 3.1818 | **2.8478** | 4.3815 | 4.9472 |
|
| 111 |
+
| math_corpus perplexity ↓ | 3.8229 | **3.5245** | 4.0685 | 4.7531 | 6.7472 | 8.3323 |
|
| 112 |
+
| **macro gate** | 0.4218 | **0.5896** | 0.3466 † | 0.2925 | 0.3473 | 0.3757 |
|
| 113 |
+
| **strict-7** | 0.1971 | **0.3290** | 0.1493 | 0.1229 | 0.1579 | 0.1714 |
|
| 114 |
+
| macro_primary | 0.4475 | **0.4958** | 0.4075 | 0.3450 | 0.4188 | 0.4213 |
|
| 115 |
+
| tok/s | 15880 | — | 15564 | 16160 | 25000 | 22000 |
|
| 116 |
+
| mean gen length | **564** | — | 999 | 696 | 2296 | 1830 |
|
| 117 |
+
| **ans/s** | **28.1** | — | 15.6 | 23.2 | 10.9 | 12.0 |
|
| 118 |
+
|
| 119 |
+
\* **TwIL-LM3\*** is our latest version of TwIL-LM3. **The weights will be released soon** — the
|
| 120 |
+
files in this repository are the current TwIL-LM3 release, not this one. Lanes marked — are not
|
| 121 |
+
yet reported for it.
|
| 122 |
+
|
| 123 |
+
† The base column here comes from the external-comparison run rather than the paired run used
|
| 124 |
+
for the Δ table above, hence 0.3466 against 0.3356 — run-to-run variation of the same
|
| 125 |
+
checkpoint. The paired run is the correct basis for the improvement claim.
|
| 126 |
|
| 127 |
`strict-7` is the mean of seven lanes scored under strict metrics only (`fol_translation`,
|
| 128 |
`entailment_label`, `mcq_answer`, `semantic_parse` and `lean_formalize` exact match,
|
| 129 |
`lean_critic` and `procedural` accuracy), with no loose-match credit anywhere.
|
| 130 |
|
| 131 |
+
Among the released models, TwIL-LM3 leads both headline metrics and wins every lane the pipeline
|
| 132 |
+
targets directly: `lean_formalize` token-F1 0.5869 against 0.4655 for the nearest arm,
|
| 133 |
+
`rule_induction` 0.3192 against 0.1936, and strict MCQ accuracy 0.1100, the only non-trivial
|
| 134 |
+
value in that row. Its closest competitor on the macro gate is LFM2.5-8B-A1B at 0.3757, roughly
|
| 135 |
+
2.8x its size. What it gives up: `procedural` under both scorings, loose MCQ where the base and
|
| 136 |
+
LFM2-2.6B reach 0.5000 against its 0.4450, `lm_corpus` perplexity where Llama-3.2-3B is
|
| 137 |
+
marginally lower, and the three exact-match rows that sit at or near zero for every arm.
|
| 138 |
+
|
| 139 |
+
The unreleased TwIL-LM3\* moves the gate to 0.5896 and strict-7 to 0.3290, roughly +0.17 and
|
| 140 |
+
+0.13 over the current release. The gains are concentrated in the two lanes where TwIL-LM3 is
|
| 141 |
+
weakest in absolute terms rather than relative ones — `rule_induction` 0.3192 → 0.9644 and
|
| 142 |
+
`semantic_parse` token-F1 0.4416 → 0.8762 — plus strict MCQ accuracy 0.1100 → 0.5200. It gives
|
| 143 |
+
back `lean_critic` (0.6600 → 0.5200) and a little `lm_corpus` perplexity, so it is not uniformly
|
| 144 |
+
better.
|
| 145 |
|
| 146 |
It is also the most efficient arm in the table by a wide margin — 28.1 answers/sec, from
|
| 147 |
generations averaging 564 tokens where every other arm except Llama runs past 690. The Liquid
|
|
|
|
| 181 |
ratio rather than re-tokenized directly; the method reproduces the three directly measured
|
| 182 |
lengths to within 3.5%.
|
| 183 |
|
| 184 |
+
The honest summary of this table is that TwIL-LM3 does not lead it. Larger models score higher,
|
| 185 |
+
in order of size, and the 120B leads nine of fourteen rows. Two things are worth extracting
|
| 186 |
+
anyway. First, TwIL-LM3 improves on its own base while sitting mid-table (0.7339 against 0.7193
|
| 187 |
on the 10-dataset macro), which is the point of the WiSE-FT stage — in-domain gains without
|
| 188 |
transfer collapse. Second, it produces the shortest generations of any arm here at 482 tokens
|
| 189 |
and consequently the most answers per second at 32.9, roughly eight times the 120B's rate.
|
|
|
|
| 280 |
|
| 281 |
**Truncation.** At a 2048-token budget, 4.4% of Track A generations hit the cap — better than
|
| 282 |
the base's 17.4%, but still above the 2% threshold our protocol requires to mark a comparison
|
| 283 |
+
`rankable`. The Track A macro gate should therefore be read as indicative rather than exact.
|
| 284 |
+
Because a truncated response scores zero regardless of reasoning quality, both numbers are
|
| 285 |
+
pessimistic, and the base substantially more so — meaning the true Track A gap is probably
|
| 286 |
+
narrower than +0.086.
|
| 287 |
|
| 288 |
**Scope.** Tuned for formal logic. The Track B suite does not cover code generation or tool use
|
| 289 |
(HumanEval, LiveCodeBench and BFCL were not run for this model or its base), so this release
|