Ronin48LLC's picture
Upload README.md with huggingface_hub
7dd14b2 verified
|
Raw History Blame Contribute Delete
4.14 kB
---
license: apache-2.0
base_model: nokeepai/Inkling-2-Mini-Unbound
base_model_relation: finetune
tags:
- lora
- moe
- inkling
- text-generation
- thinking
---
# Lamarck-Inkling-2-Mini-Unbound
A cybersecurity continued-pretraining LoRA fine-tune of
[Inkling-2-Mini-Unbound](https://huggingface.co/nokeepai/Inkling-2-Mini-Unbound)
(the Unbound variant of Thinking Machines' Inkling-2-Mini), in the Lamarck series.
## Model details
| | |
|---|---|
| Base model | `nokeepai/Inkling-2-Mini-Unbound` (v2) |
| Architecture | `Inkling2LoopForConditionalGeneration` — 26.4B-parameter mixture-of-experts |
| Experts | 128 routed experts, top-8, per layer; looped core (3 weight-tied passes) |
| Attention | Hybrid sliding-window + full attention, short-convolution, relative position bias |
| Adapter | LoRA on attention projections (r=32) + fused expert projections (r=8) |
| Trainable params | ~215M (0.8% of base) |
| Base precision | BF16 |
| Distributed as | Q4_K_M GGUF (local serving) |
| Context | up to 512K tokens serving; model supports up to 1M |
| Vocabulary | 201,024 (tiktoken) |
| Behavior | Thinking model — emits reasoning before the final answer |
## Usage
Supported by recent `llama.cpp` builds (`inkling2_loop` architecture):
```bash
llama-server -m Lamarck-Inkling-2-Mini-Unbound-Q4_K_M.gguf \
-ngl 99 -c 32768 -fa on -ctk q8_0 -ctv q8_0 \
--host 127.0.0.1 --port 8081
```
Exposes an OpenAI-compatible API (`/v1/chat/completions`) and the Anthropic Messages
API (`/v1/messages`). Allow generous `max_tokens` so the reasoning trace can complete
before the answer.
## Training method
Cybersecurity continued-pretraining via parameter-efficient LoRA (attention r=32 +
fused-expert r=8) on a security text corpus, with validation-aware early stopping and
best-checkpoint selection by held-out evaluation. The adapter is merged into the base
weights for distribution as a single self-contained model.
## Metrics
Cybersecurity continued-pretraining evaluation, base vs. this adapter (ckpt-300,
validation-aware early stop). Perplexity — lower is better.
| Metric | Base | Fine-tuned |
|---|---|---|
| Held-out security perplexity | 6.15 | **4.90** |
| OOD CyberMetric perplexity | 16.73 | **15.76** |
| OOD MMLU-security perplexity | 8.03 | **7.50** |
| OOD SecQA-v2 perplexity | 4.79 | **4.14** |
| OOD math-control perplexity | 6.49 | **6.47** |
| MMLU-security accuracy | 0.170 | 0.155 |
| SecQA-v2 accuracy | 0.20 | **0.27** |
| GSM8K accuracy | 0.84 | **0.90** |
The adapter lowers held-out and out-of-domain security perplexity substantially while
the math-control perplexity stays flat — no catastrophic forgetting. GSM8K accuracy is
preserved/improved, and SecQA-v2 accuracy rises.
Note: Inkling-2-Mini is a thinking model, so the multiple-choice accuracy figures are
sensitive to answer extraction from the reasoning trace and are reported as measured;
perplexity is the parsing-independent, sensitive measure here. These are research
measurements, not a safety certification.
## Files
- `Lamarck-Inkling-2-Mini-Unbound-Q4_K_M.gguf` — merged standalone model (base + adapter), ready for llama.cpp.
- `adapter/` — the raw LoRA adapter (attention r=32 + fused-expert r=8).
- `inkling_lora_min.py` — loader for the fused-expert adapter.
### Applying the adapter yourself
The expert portion uses a fused grouped-GEMM LoRA (not standard per-Linear peft), so
loading the raw adapter requires `inkling_lora_min.py`:
```python
import inkling_lora_min as ink
from transformers import Inkling2LoopForConditionalGeneration
from peft import PeftModel
model = Inkling2LoopForConditionalGeneration.from_pretrained(
"nokeepai/Inkling-2-Mini-Unbound", dtype="bfloat16", device_map="cuda")
ink.attach_fused_expert_lora(model, r=8, alpha=16)
model = PeftModel.from_pretrained(model, "adapter")
```
The merged GGUF needs none of this — it is self-contained.
## License
Apache-2.0, inherited from the base model.
## Provenance
Part of the Lamarck series. Fine-tune of the Unbound variant of Inkling-2-Mini;
the base model's own abliteration and self-distillation are upstream (nokeep).