license: apache-2.0
base_model: OpenUncensored/Inkling-2-Mini-Uncensored
base_model_relation: finetune
pipeline_tag: image-text-to-text
library_name: transformers
language:
- en
datasets: - HuggingFaceFW/fineweb-edu
- jxie/coco_captions
tags: - inkling2
- mixture-of-experts
- multimodal
- external-memory
- custom_code
- uncensored
Inkling-2-Mini-Uncensored-V18
Inkling-2-Mini-Uncensored-V18 is a text-and-image model with a persistent event store. It can save a photograph, reopen the same memory bank in a later session, and use the archived image to answer a question. This release contains the merged fourth-epoch memory weights and the Python code for the grounded V18 architecture.
V18 在原有的圖文模型上加入持久事件庫。使用者可以按檔案編號或目錄引用取回歷史原圖,並檢查模型實際讀入了哪張圖。這次發布的是四輪記憶微調後的完整模型。
Model and training
The backbone comes from OpenUncensored's directional-ablation fine-tune of Thinking Machines' Inkling-2-Mini. V18 keeps its language and vision weights frozen and trains 2,758,150 memory parameters in 14 FP32 tensors. The reader injects retrieved evidence into the recurrent language-model loop. The default is three passes. Uncensored backbone · Original Inkling-2-Mini
Each epoch used 4,096 text episodes derived from FineWeb-Edu and 4,096 image episodes derived from COCO images and captions. Tasks included looking up archived content, following a directory entry, identifying a crop within a historical image, and handling a request whose source was unavailable at the query revision. FineWeb-Edu · COCO captions
| Stage | Real prompt length | Effective batch | Optimizer updates |
|---|---|---|---|
| Epoch 1 | Original mixed text and image episodes | 8 | 1,024 |
| Epochs 2–4 | 8,226–32,097 tokens before the answer | 16 | 1,536 |
The grounded architecture was introduced at cumulative update 1,600. Training continued from that checkpoint with its memory weights and AdamW state, and finished at 2,560 updates. The merge includes the original backbone shards and a separately indexed trained memory shard, model-v18-memory.safetensors.
Load the model
The tested environment used Python 3.12, PyTorch 2.10.0+cu130, torchvision 0.25.0+cu130 and Transformers 5.24.0.dev0 on a 96 GB RTX PRO 6000 Blackwell. The checkpoint uses the upstream Inkling processor, vision tower and expert weight conversion. The example loads the backbone in BF16. Tested Transformers revision
import torch
from huggingface_hub import snapshot_download
from transformers import AutoModelForImageTextToText, AutoProcessor
path = snapshot_download("LTM-Lab/Inkling-2-Mini-Uncensored-V18")
processor = AutoProcessor.from_pretrained(path, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
path, trust_remote_code=True, dtype=torch.bfloat16, device_map={"": "cuda"}
).eval()
Ask about an archived photograph
Place a photograph at photo.jpg. The example writes its original bytes, closes the store, then reopens it and queries the same bank. The archive number identifies the image. The bank directory holds the events between sessions.
from pathlib import Path
def open_bank():
return model.open_memory(processor, "./v18-bank", bank_id="photos")
bank = open_bank()
with bank.store:
bank.remember(
occurrence_id="photo-import-42",
text="Archive 42.",
images=[Path("photo.jpg").read_bytes()],
)
bank = open_bank()
question = "What does the photograph in file 42 show?"
messages = [{"role": "user", "content": [{"type": "text", "text": question}]}]
with bank.store, torch.inference_mode():
try:
inputs, ctx = bank.prepare_generation(
messages, text=question, require_source="image"
)
output = model.generate(
**inputs, memory_context=ctx, do_sample=False, max_new_tokens=2048
)
prompt = inputs["input_ids"][0]
reply = processor.tokenizer.parse_response(output[0, len(prompt):], prefix=prompt)
print(reply.get("content"))
print(ctx.grounding)
except LookupError as err:
if getattr(err, "status", None) != "insufficient_evidence":
raise
print(err.status, err.reason, err.grounding)
For named image requests, prepare_generation resolves the reference at the selected bank revision and prepares the target for the native vision path. ctx.grounding records the source and whether the native image features were consumed. A missing source can raise insufficient_evidence before generation. This is an architecture decision. To measure the model's own response to missing evidence, use require_source="off". To measure the compressed reader on a resolved image, use require_source="image", visual_read="slots".
Fourth-epoch validation
The following results are from 128 teacher-forced validation episodes. The event denominator counts required retrieval hops, so a two-hop question contributes two opportunities. Region selection is measured on the 16 crop-localization questions.
| Metric | Result |
|---|---|
| Correct evidence ranked first on an active retrieval hop | 68 / 144 (47.2%) |
| Correct region selected on a crop-localization question | 6 / 16 (37.5%) |
| Answer negative log-likelihood per supervised token | 1.4944 |
The merged checkpoint was reloaded and tested on an 8,679-token prompt. In a separate check of the loading example above, the store was reopened and the model was asked about an archived clock-tower photograph. It generated “A tall brick clock tower with a white top.” in 14 new tokens. The runtime recorded native_visual_consumed=True for the requested event. Fourth-epoch free-generation accuracy over a test set remains unmeasured.
License
Apache License 2.0. Backbone credit goes to Thinking Machines and OpenUncensored. LTM-Lab publishes the V18 grounded memory architecture and its trained memory weights. License