加载中…
加载中…
LPCompact is a learned state selector for Qwen3.8-27B, available through
LatentPort's state.compact() operation.
It selects useful attention-memory entries directly from a running model's state. Recurrent state, convolution state and the logical continuation clock are preserved. The operation uses no text summary or historical token replay.
This repository contains one model, model.safetensors: a 393,473-parameter
selector. The same checkpoint is used with BF16 and GGUF weight quantizations.
The base model's weight quantization does not change the selector's architecture
or weights. LatentPort adapters supply the common BF16 attention-state layout.
The selector reads three attention value layers and assigns a utility score to each retained position. Its span policy preserves the first and last 512 positions and selects the remaining memory within the requested budget.
import latentport as lp
with lp.load_model(backend="bf16") as model:
state = model.prefill(history)
state = state.compact()
answer = model.session(state).ask("Continue the task.")
For GGUF, use backend="gguf" and supply model_path with the chosen
Qwen3.8-27B GGUF. Both formats load the same selector from this repository.
The default policy retains one eighth of attention KV positions, with a 1,024-position floor. A 4× setting is also available. Normal activation starts at 65,536 physical KV positions. At 128K, 8× selection reduces BF16 attention tensor storage from 8 GiB to 1 GiB. Base weights and fixed recurrent state retain their existing representation.
The returned value is an ordinary immutable LatentPort State, supporting fork, save/load, append and continued generation. The original snapshot remains valid.
The selector uses FP32 weights, a 3,072-feature input, a 128-unit hidden layer
with GELU, and one output score. config.json records its architecture, policy
and hashes. The safetensors artifact reproduces the frozen selector exactly.
Code: LatentPort.
Qwen/Qwen3.8-27B