Text Generation
PEFT
Safetensors
English
tinker
tinker-cookbook
lora
dpo
inkling
gutenberg
creative-writing
anti-slop
Instructions to use nbeerbower/Inkling-Gutenberg-DPO-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use nbeerbower/Inkling-Gutenberg-DPO-LoRA with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("thinkingmachines/Inkling") model = PeftModel.from_pretrained(base_model, "nbeerbower/Inkling-Gutenberg-DPO-LoRA") - Notebooks
- Google Colab
- Kaggle
Add files using upload-large-folder tool
Browse files- README.md +88 -0
- adapter_config.json +31 -0
- adapter_model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: thinkingmachines/Inkling
|
| 3 |
+
library_name: peft
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
datasets:
|
| 9 |
+
- schneewolflabs/Alembic-DPO
|
| 10 |
+
tags:
|
| 11 |
+
- tinker
|
| 12 |
+
- tinker-cookbook
|
| 13 |
+
- peft
|
| 14 |
+
- lora
|
| 15 |
+
- dpo
|
| 16 |
+
- inkling
|
| 17 |
+
- gutenberg
|
| 18 |
+
- creative-writing
|
| 19 |
+
- anti-slop
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# Inkling-Gutenberg-DPO-LoRA
|
| 23 |
+
|
| 24 |
+
A rank-32 LoRA for [Thinking Machines Inkling](https://huggingface.co/thinkingmachines/Inkling), trained to prefer authentic literary prose over synthetic creative-writing slop.
|
| 25 |
+
|
| 26 |
+
The adapter is the preference-tuned component of the nbeerbower Gutenberg series. It preserves Inkling as the general-purpose base while applying a focused literary-fiction bias: stronger narrative texture and interiority, more controlled pacing, and an active dispreference for formulaic AI phrasing.
|
| 27 |
+
|
| 28 |
+
## Training
|
| 29 |
+
|
| 30 |
+
Training used Direct Preference Optimization through [Tinker](https://thinkingmachines.ai/tinker) and `tinker-cookbook`.
|
| 31 |
+
|
| 32 |
+
| Setting | Value |
|
| 33 |
+
|---|---:|
|
| 34 |
+
| Base model | `thinkingmachines/Inkling` |
|
| 35 |
+
| Dataset | `schneewolflabs/Alembic-DPO`, `scored` configuration |
|
| 36 |
+
| Selection | English Gutenberg, `keep`, `quality >= 50` |
|
| 37 |
+
| Train / validation pairs | 3,719 / 128 |
|
| 38 |
+
| Objective | DPO |
|
| 39 |
+
| LoRA rank / alpha | 32 / 32 |
|
| 40 |
+
| DPO beta | 0.1 |
|
| 41 |
+
| Learning rate | `1e-5`, linear decay |
|
| 42 |
+
| Effective pair batch | 32 |
|
| 43 |
+
| Maximum sequence length | 4,096 |
|
| 44 |
+
| Epochs | 1 (116 optimizer steps) |
|
| 45 |
+
| Renderer | Inkling `tml_v0`, thinking effort 0.9 |
|
| 46 |
+
|
| 47 |
+
The selected data pairs public-domain Gutenberg prose (`chosen`) with synthetic prose (`rejected`). Alembic's deterministic quality scoring was used for selection; its raw LLM-judge preference vote was not used because reconstructed Gutenberg prompts can reward prompt adherence over fidelity to the source literature.
|
| 48 |
+
|
| 49 |
+
## Training result
|
| 50 |
+
|
| 51 |
+
| Metric | Start | Final |
|
| 52 |
+
|---|---:|---:|
|
| 53 |
+
| Held-out NLL | 1.7854 | 1.6891 |
|
| 54 |
+
| Preference accuracy | ~50% | 100% |
|
| 55 |
+
| DPO loss | ~1.8 | 0.0050 |
|
| 56 |
+
| Reward margin | near 0 | +21.03 |
|
| 57 |
+
|
| 58 |
+
The preference signal converged rapidly, as expected for a capable base model and a high-contrast dataset. The single decaying-learning-rate epoch was retained; no additional epochs were run.
|
| 59 |
+
|
| 60 |
+
## Format and use
|
| 61 |
+
|
| 62 |
+
This repository contains a standard PEFT LoRA adapter. Load it together with the unmodified `thinkingmachines/Inkling` base model using a PEFT-compatible runtime.
|
| 63 |
+
|
| 64 |
+
```python
|
| 65 |
+
from transformers import AutoModelForCausalLM
|
| 66 |
+
from peft import PeftModel
|
| 67 |
+
|
| 68 |
+
base = AutoModelForCausalLM.from_pretrained(
|
| 69 |
+
"thinkingmachines/Inkling",
|
| 70 |
+
torch_dtype="auto",
|
| 71 |
+
device_map="auto",
|
| 72 |
+
trust_remote_code=True,
|
| 73 |
+
)
|
| 74 |
+
model = PeftModel.from_pretrained(base, "nbeerbower/Inkling-Gutenberg-DPO-LoRA")
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
Inkling is a 975B-total / 41B-active MoE. This adapter includes expert-layer LoRA tensors and is consequently large. MoE expert LoRA serving remains experimental in some runtimes; a merged model is the most portable deployment format.
|
| 78 |
+
|
| 79 |
+
## Intended behavior
|
| 80 |
+
|
| 81 |
+
The tune is intended for literary fiction, period prose, novel continuation, dialogue, and creative-writing tasks where generic AI phrasing is undesirable. It is a stylistic preference adapter, not a factual-knowledge or safety tune.
|
| 82 |
+
|
| 83 |
+
The model may reproduce public-domain literary styles, favor longer source-like continuations, or use period diction when prompted toward historical settings. Evaluate modern-register writing and general instruction following for your application.
|
| 84 |
+
|
| 85 |
+
## License
|
| 86 |
+
|
| 87 |
+
Apache 2.0, matching the Inkling base model. Alembic-DPO is CC-BY-4.0 and derives its literary text from public-domain Project Gutenberg sources; consult the dataset card for complete provenance.
|
| 88 |
+
|
adapter_config.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"peft_type": "LORA",
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": "thinkingmachines/Inkling",
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"fan_in_fan_out": false,
|
| 7 |
+
"inference_mode": true,
|
| 8 |
+
"init_lora_weights": true,
|
| 9 |
+
"lora_alpha": 32,
|
| 10 |
+
"lora_dropout": 0.0,
|
| 11 |
+
"modules_to_save": null,
|
| 12 |
+
"r": 32,
|
| 13 |
+
"rank_pattern": {},
|
| 14 |
+
"alpha_pattern": {},
|
| 15 |
+
"target_modules": [
|
| 16 |
+
"down_proj",
|
| 17 |
+
"gate_proj",
|
| 18 |
+
"gate_up_proj",
|
| 19 |
+
"lm_head",
|
| 20 |
+
"up_proj",
|
| 21 |
+
"w1",
|
| 22 |
+
"w2",
|
| 23 |
+
"w3",
|
| 24 |
+
"wk_dv",
|
| 25 |
+
"wo_ud",
|
| 26 |
+
"wq_du",
|
| 27 |
+
"wr_du",
|
| 28 |
+
"wv_dv"
|
| 29 |
+
],
|
| 30 |
+
"task_type": "CAUSAL_LM"
|
| 31 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ab2c372a9f3c21171481b38d3a47ad2f3dd8c97c17adf83d5a290c7878f27500
|
| 3 |
+
size 58786519496
|