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
|
@@ -37,41 +37,53 @@ why it is the recommended release of the pair.
|
|
| 37 |
|
| 38 |
### Track A — in-domain formal logic
|
| 39 |
|
| 40 |
-
|
| 41 |
All arms below were run through the same harness, prompts and decoding settings described under
|
| 42 |
[Evaluation protocol](#evaluation-protocol). Throughput rows are reported because in-domain score
|
| 43 |
alone is misleading for a 3B model: `ans/s` is defined throughout as `tok/s ÷ mean generation
|
| 44 |
length`, so it measures completed answers rather than raw decode rate.
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
| 49 |
-
|
|
| 50 |
-
|
|
| 51 |
-
|
|
| 52 |
-
|
|
| 53 |
-
|
|
| 54 |
-
|
|
| 55 |
-
|
|
| 56 |
-
|
|
| 57 |
-
|
|
| 58 |
-
| **
|
| 59 |
-
|
|
| 60 |
-
|
|
| 61 |
-
|
|
| 62 |
-
|
|
| 63 |
-
| **ans/s** | **28.1** | 27.7 | 15.6 | 23.2 | 10.9 | 12.0 |
|
| 64 |
|
| 65 |
\* **TwIL-LM3\*** is our latest version of TwIL-LM3. **The weights will be released soon** — the
|
| 66 |
files in this repository are the current TwIL-LM3 release, not this one. Lanes marked — are not
|
| 67 |
yet reported for it.
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
-
The three
|
| 74 |
-
|
| 75 |
|
| 76 |
**`macro gate`** is the headline metric and the one the training pipeline gates on. It is the
|
| 77 |
equal-weight mean of five objectives: the four bounded classification lanes (`entailment_label`,
|
|
@@ -92,13 +104,25 @@ earlier reports; the gate is the metric to read for overall in-domain capability
|
|
| 92 |
harsh — exact match on generative lanes is near zero for every arm — so it is useful for ranking
|
| 93 |
models against each other but not as an absolute capability measure.
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
The unreleased TwIL-LM3\* moves the gate to 0.5896 and strict-7 to 0.3290, roughly +0.17 and
|
| 104 |
+0.13 over the current release. The gains are concentrated in the two lanes where TwIL-LM3 is
|
|
@@ -112,7 +136,7 @@ generations averaging 564 tokens where every other arm except Llama runs past 69
|
|
| 112 |
models decode faster in raw tokens per second, 25230 and 22480 against 15880, but their length
|
| 113 |
more than cancels it.
|
| 114 |
|
| 115 |
-
###
|
| 116 |
|
| 117 |
| dataset | TwIL-LM3 | SmolLM3-3B base | Llama-3.2-3B | LFM2-2.6B | LFM2.5-8B-A1B | Qwen3-8B | gpt-oss-120b ‡ |
|
| 118 |
|---|---:|---:|---:|---:|---:|---:|---:|
|
|
@@ -127,7 +151,7 @@ more than cancels it.
|
|
| 127 |
| musr | 0.4957 | 0.4997 | 0.4932 | 0.4867 | 0.5703 | 0.6301 | **0.6852** |
|
| 128 |
| mmlu_redux | 0.6667 | 0.6633 | 0.6000 | 0.7133 | 0.8367 | 0.8500 | **0.9467** |
|
| 129 |
| ifeval | 0.6433 | 0.6767 | 0.7167 | 0.7300 | **0.8900** | 0.8400 | 0.7900 |
|
| 130 |
-
| rudas_ood | 0.0365 | 0.0209 | **0.0733** | 0.0017 | 0.0061 | 0.0468 | 0.0000
|
| 131 |
| bbh_logic | 0.6633 | 0.6667 | 0.5333 | 0.5713 | 0.7700 | 0.6367 | **0.9980** |
|
| 132 |
| math500 | 0.6900 | 0.7000 | 0.4233 | 0.7133 | 0.7800 | 0.6100 | **0.8433** |
|
| 133 |
| **macro (10 CoT datasets)** | 0.7339 | 0.7193 | 0.6997 | 0.7523 | 0.7884 | 0.8493 | **0.8689** |
|
|
@@ -137,7 +161,7 @@ more than cancels it.
|
|
| 137 |
| **ans/s** | **32.9** | 24.9 | 31.7 | ≈31.7 | ≈16.9 | 4.9 | 4.2 |
|
| 138 |
|
| 139 |
‡ MXFP4 weights, tensor-parallel 2 — quantized and multi-GPU, so not directly comparable to the
|
| 140 |
-
single-GPU BF16 rows.
|
| 141 |
truncation artefact rather than a measured score; excluding the row, its 13-dataset macro is
|
| 142 |
0.8708.
|
| 143 |
|
|
|
|
| 37 |
|
| 38 |
### Track A — in-domain formal logic
|
| 39 |
|
|
|
|
| 40 |
All arms below were run through the same harness, prompts and decoding settings described under
|
| 41 |
[Evaluation protocol](#evaluation-protocol). Throughput rows are reported because in-domain score
|
| 42 |
alone is misleading for a 3B model: `ans/s` is defined throughout as `tok/s ÷ mean generation
|
| 43 |
length`, so it measures completed answers rather than raw decode rate.
|
| 44 |
|
| 45 |
+
| lane / metric | TwIL-LM3 | TwIL-LM3* | SmolLM3-3B base | Llama-3.2-3B | LFM2-2.6B | LFM2.5-8B-A1B | Qwen3-8B | gpt-oss-120b ‡ |
|
| 46 |
+
|---|---:|---:|---:|---:|---:|---:|---:|---:|
|
| 47 |
+
| lean_formalize token_f1 | 0.5869 | **0.6456** | 0.4347 | 0.3690 | 0.1321 | 0.4655 | 0.4022 | 0.6306 |
|
| 48 |
+
| rule_induction derivation | 0.3192 | **0.9644** | 0.1029 | 0.0825 | 0.0615 | 0.1936 | 0.3680 | 0.6518 |
|
| 49 |
+
| entailment_label accuracy | 0.5750 | 0.6867 | 0.3750 | 0.3300 | 0.4700 | 0.5400 | 0.5800 | **0.7750** |
|
| 50 |
+
| mcq_answer accuracy | 0.1100 | **0.5200** | 0.0000 | 0.0000 | 0.0150 | 0.0750 | 0.0000 | 0.0700 |
|
| 51 |
+
| semantic_parse token_f1 | 0.4416 | **0.8762** | 0.4149 | 0.3102 | 0.3665 | 0.3778 | 0.4257 | 0.4331 |
|
| 52 |
+
| lean_critic accuracy | 0.6600 | 0.5200 | 0.6500 | 0.5300 | 0.5900 | 0.5500 | **0.7950** | 0.5550 |
|
| 53 |
+
| lm_corpus perplexity ↓ | 2.8972 | 3.1284 | 3.1818 | 2.8478 | 4.3815 | 4.9472 | **2.5440** | 912.23 § |
|
| 54 |
+
| math_corpus perplexity ↓ | 3.8229 | **3.5245** | 4.0685 | 4.7531 | 6.7472 | 8.3323 | 4.0083 | 1045.63 § |
|
| 55 |
+
| average, 6 lanes | 0.4488 | **0.7021** | 0.3296 | 0.2703 | 0.2725 | 0.3670 | 0.4285 | 0.5192 |
|
| 56 |
+
| **macro gate** | 0.4218 | **0.5896** | 0.3466 † | 0.2925 | 0.3473 | 0.3757 | 0.5336 | — |
|
| 57 |
+
| **strict-7** | 0.1971 | **0.3290** | 0.1493 | 0.1229 | 0.1579 | 0.1714 | 0.2093 | — |
|
| 58 |
+
| macro_primary | 0.4475 | 0.4958 | 0.4075 | 0.3450 | 0.4188 | 0.4213 | **0.5750** | — |
|
| 59 |
+
| tok/s | 15880 | 15840 | 15564 | 16160 | **25230** | 22480 | 9420 | 3374 |
|
| 60 |
+
| mean gen length | **564** | 572 | 999 | 696 | 2296 | 1830 | 2094 | 1005 |
|
| 61 |
+
| **ans/s** | **28.1** | 27.7 | 15.6 | 23.2 | 10.9 | 12.0 | 4.5 | 3.4 |
|
|
|
|
| 62 |
|
| 63 |
\* **TwIL-LM3\*** is our latest version of TwIL-LM3. **The weights will be released soon** — the
|
| 64 |
files in this repository are the current TwIL-LM3 release, not this one. Lanes marked — are not
|
| 65 |
yet reported for it.
|
| 66 |
|
| 67 |
+
‡ **gpt-oss-120b** runs MXFP4 weights at tensor-parallel 2 — quantized and multi-GPU, so its
|
| 68 |
+
throughput rows are not directly comparable to the single-GPU BF16 arms. Its `procedural` lane
|
| 69 |
+
and the loose-match scorings were not collected, so the three summary rows below the six-lane
|
| 70 |
+
average cannot be computed for it; that is what the — cells mean, not a zero.
|
| 71 |
+
|
| 72 |
+
§ The 120B's perplexities are three orders of magnitude off every other arm because its harmony
|
| 73 |
+
response format and tokenizer make the corpus lanes score a different quantity. The number is
|
| 74 |
+
reported for completeness but is not a comparable measurement.
|
| 75 |
+
|
| 76 |
+
† The base column here comes from the external-comparison run rather than the paired base-vs-TwIL
|
| 77 |
+
run, hence 0.3466 against the 0.3356 quoted in the summary at the top of this card — run-to-run
|
| 78 |
+
variation of the same checkpoint. The paired run is the correct basis for the improvement claim.
|
| 79 |
+
|
| 80 |
+
**`average, 6 lanes`** is the plain mean of the six objective rows above it, each at whatever
|
| 81 |
+
scoring that row reports. It is a coarser summary than the three that follow — it mixes token-F1
|
| 82 |
+
with accuracy — but it is the only summary row every arm here can be compared on, including the
|
| 83 |
+
120B.
|
| 84 |
|
| 85 |
+
The next three rows aggregate more carefully. None of them include the perplexity lanes or the
|
| 86 |
+
token-F1 scorings, which are not on a common 0–1 accuracy scale.
|
| 87 |
|
| 88 |
**`macro gate`** is the headline metric and the one the training pipeline gates on. It is the
|
| 89 |
equal-weight mean of five objectives: the four bounded classification lanes (`entailment_label`,
|
|
|
|
| 104 |
harsh — exact match on generative lanes is near zero for every arm — so it is useful for ranking
|
| 105 |
models against each other but not as an absolute capability measure.
|
| 106 |
|
| 107 |
+
TwIL-LM3 beats every arm up to and including LFM2.5-8B-A1B, and does so on all six objective
|
| 108 |
+
lanes and all four summary rows, not on average alone. Against the strongest of them it is
|
| 109 |
+
0.4218 to 0.3757 on the gate at roughly a third of the total parameters, with the margin coming
|
| 110 |
+
from the lanes the pipeline targets directly: `lean_formalize` token-F1 0.5869 against 0.4655,
|
| 111 |
+
`rule_induction` 0.3192 against 0.1936, `semantic_parse` 0.4416 against 0.3778.
|
| 112 |
+
|
| 113 |
+
It does not beat the two largest arms. Qwen3-8B leads it on the gate 0.5336 to 0.4218 and
|
| 114 |
+
gpt-oss-120b leads the six-lane average 0.5192 to 0.4488. That gap is worth reading carefully in
|
| 115 |
+
Qwen's case: almost all of it is loose-match credit. Qwen answers MCQ correctly but never in the
|
| 116 |
+
requested format — strict accuracy 0.0000 against TwIL-LM3's 0.1100, while its loose match is
|
| 117 |
+
0.745 — and the macro rows credit `max(exact_match, loose_match)`. On `strict-7`, which gives no
|
| 118 |
+
loose-match credit anywhere, the two are 0.2093 to 0.1971, a gap of 0.012 rather than 0.11. Qwen
|
| 119 |
+
also wins `lean_critic` outright at 0.7950 and has the lowest `lm_corpus` perplexity at 2.5440.
|
| 120 |
+
The 120B leads three lanes outright and is genuinely stronger at entailment (0.7750) and rule
|
| 121 |
+
induction (0.6518).
|
| 122 |
+
|
| 123 |
+
The size and speed context matters for both. Qwen3-8B is 2.6x the parameters and produces 4.5
|
| 124 |
+
answers/sec against TwIL-LM3's 28.1; the 120B is 40x the parameters and produces 3.4. TwIL-LM3
|
| 125 |
+
is the strongest arm here at its own scale and the most efficient arm at any scale.
|
| 126 |
|
| 127 |
The unreleased TwIL-LM3\* moves the gate to 0.5896 and strict-7 to 0.3290, roughly +0.17 and
|
| 128 |
+0.13 over the current release. The gains are concentrated in the two lanes where TwIL-LM3 is
|
|
|
|
| 136 |
models decode faster in raw tokens per second, 25230 and 22480 against 15880, but their length
|
| 137 |
more than cancels it.
|
| 138 |
|
| 139 |
+
### Track B — held-out benchmarks
|
| 140 |
|
| 141 |
| dataset | TwIL-LM3 | SmolLM3-3B base | Llama-3.2-3B | LFM2-2.6B | LFM2.5-8B-A1B | Qwen3-8B | gpt-oss-120b ‡ |
|
| 142 |
|---|---:|---:|---:|---:|---:|---:|---:|
|
|
|
|
| 151 |
| musr | 0.4957 | 0.4997 | 0.4932 | 0.4867 | 0.5703 | 0.6301 | **0.6852** |
|
| 152 |
| mmlu_redux | 0.6667 | 0.6633 | 0.6000 | 0.7133 | 0.8367 | 0.8500 | **0.9467** |
|
| 153 |
| ifeval | 0.6433 | 0.6767 | 0.7167 | 0.7300 | **0.8900** | 0.8400 | 0.7900 |
|
| 154 |
+
| rudas_ood | 0.0365 | 0.0209 | **0.0733** | 0.0017 | 0.0061 | 0.0468 | 0.0000 ¶ |
|
| 155 |
| bbh_logic | 0.6633 | 0.6667 | 0.5333 | 0.5713 | 0.7700 | 0.6367 | **0.9980** |
|
| 156 |
| math500 | 0.6900 | 0.7000 | 0.4233 | 0.7133 | 0.7800 | 0.6100 | **0.8433** |
|
| 157 |
| **macro (10 CoT datasets)** | 0.7339 | 0.7193 | 0.6997 | 0.7523 | 0.7884 | 0.8493 | **0.8689** |
|
|
|
|
| 161 |
| **ans/s** | **32.9** | 24.9 | 31.7 | ≈31.7 | ≈16.9 | 4.9 | 4.2 |
|
| 162 |
|
| 163 |
‡ MXFP4 weights, tensor-parallel 2 — quantized and multi-GPU, so not directly comparable to the
|
| 164 |
+
single-GPU BF16 rows. ¶ 74% of its `rudas_ood` generations hit the length cap, so that cell is a
|
| 165 |
truncation artefact rather than a measured score; excluding the row, its 13-dataset macro is
|
| 166 |
0.8708.
|
| 167 |
|