Blackfrost-AI/Ablagent
소개
Evidence-first, architecture-aware DWM research runtime and DWMIP protocol — extending abliteration/refusal-direction research. Synthetic reference runtime + real CPU executor for small dense HF checkpoints + the Inkling-2-Mini-Derisked worked example.
기타 프로젝트측정된 스타 증가
- in 24h
- +7
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
Ablagent
Format-aware DWM research: BF16 · FP8/MXFP8 · NVFP4 · GGUF · IQ2_XXS
Full-precision editing · requantization research · selective Q8 promotion · NVFP4 deployment paths
Make the architecture explicit. Make the experiment inspectable.
A research protocol and synthetic runtime extending abliteration research into Domain Weight Modification.
From refusal-direction removal to architecture-aware, evidence-bound interventions.
BF16 → 2-bit IQ research · Quickstart · Worked example · Recipe library · Research lineage · Architecture research · DWMIP specification · Support matrix · Contribute
Research preview · alpha — The offline synthetic runtime and a real CPU executor for small dense HuggingFace checkpoints run today (see Run it on a real checkpoint). Serving, quantization, and behavior/capability verification are not implemented — real runs record them as skipped and end
not_eligible. Architecture coverage below is research guidance; executable support is the dense safetensors envelope.
Why Ablagent?
A tensor name is not an architecture. Matching dimensions do not establish compatible spaces. A saved weight edit is not evidence that an intervention worked.
Domain Weight Modification (DWM) research needs more than a transformation formula: it needs an explicit account of where an intervention acts, what it changes, and how its result is checked.
Ablagent began with false-refusal removal: the search for reliable, targeted ways to reduce unwanted refusals without blindly degrading the rest of the model. Abliteration and refusal-direction research are the foundation of this project, not a peripheral use case.
Domain Weight Modification (DWM) is how that research extends beyond refusals. The same intervention discipline can investigate other learned behaviors and internal directions, but only when the direction, coordinate space, writer, architecture, and evaluation are made explicit. DWM is the broader research framework; refusal removal remains its originating application and a central research focus.
Ablagent brings those questions into one inspectable workflow. Its DWM Interchange Protocol (DWMIP v0) connects graph and writer identities, banks, directions, experiment plans, interventions, trials, and evidence. The synthetic runtime makes that contract executable offline; the real executor applies the same contract to small dense checkpoints you name by URL.
Read the research lineage: from refusal removal to DWM →
What makes it different
- Architecture semantics before edits. Declare sites, spaces, axes, routes, and writers rather than guessing from names or shapes.
- Proposals are not permissions. The deterministic planner proposes bounded experiments; compilation requires an explicitly selected intervention.
- Artifacts you can replay. Canonical JSON, safe tensor storage, and digest-bound manifests let verification recompute the reference transformation and observations.
- Negative results stay in the record. Retain rejected trials, lineage, and missing-evidence states instead of presenting only successful candidates.
- Research without inherited model baggage. The runtime ships original synthetic banks, general architecture guidance, and publishable prompt-only benchmark corpora (443 eval / smoke-50 / cyber-10) with full upstream license scope — no private prompts, credentials, or operational endpoints. One published research artifact is included as a clearly scoped worked example, vendored byte-identical from its public Hugging Face release with a hash-bound provenance manifest, plus a hash-locked recipe library of finalized GPU-scale playbooks imported byte-identical from their public origins. An operator-controlled, release-only red-line corpus is intentionally absent.
Built for researchers formalizing experiments, engineers qualifying architecture adapters, and agent developers who need a narrow, verifiable integration boundary. The real executor edits small dense checkpoints end to end; it is not a turnkey editor for every architecture, and it never authorizes a release.
DWM beyond full precision
Your checkpoint's quantization is part of the DWM problem—not a footnote after the edit. Blackfrost's research spans BF16, FP8/MXFP8, NVFP4, GGUF/Q8_0 and 2-bit IQ2_XXS, including dense edits, scale/codec qualification, selective Q8 promotion, requantization and NVFP4 deployment paths.
| Path | Demonstrated in research | Critical boundary |
|---|---|---|
| BF16 | Capture and dense float edits; public recipe and qualified CPU path | Does not automatically transfer to quantized derivatives |
| FP8 / MXFP8 | Scale reconstruction and requantization round-trips | Round-trip ≠ validated FP8 intervention |
| NVFP4 | BF16→NVFP4 PTQ deployment; codec research; serialization recipe | Not native NVFP4 editing or proven retained behavior |
| GGUF / IQ2_XXS | IQ-surface editing, selective Q8 promotion, packing checks and serving | Directional retention and behavior remain checkpoint-specific |
| EXL3 | Native trellis-expert decode/edit/re-encode on one arm, with readback gates and serving (method notes) | Conversion result, not a release: no matched unedited baseline, no capability or red-line measurement; no CLI support |
The research goal is format-aware DWM; the current CLI is not a universal quantized-file editor. It executes the small dense float safetensors envelope described below. FP8, NVFP4, GGUF and IQ codecs are not directly implemented; unsupported inputs fail closed. Prior results identify how to approach these paths, not a guarantee of efficacy, capability preservation or compatibility with every quant variant.
Read the format research matrix and workflow →
What runs today
| Layer | Available now | Boundary |
|---|---|---|
| Real checkpoint pipeline | Drop an HF link: intake → baseline → capture → rank-one bake → HF-loadable export (CPU) | Small dense safetensors models; verification gates recorded as skipped, release stays not_eligible |
| Reference math | Dense rank-one CPU update | One site, one direction, one writer |
| Experiment planning | Deterministic bounded proposals | No autonomous executor or provider integration |
| Artifact verification | Replayed transformation, observations, and trial lineage | Structural consistency, not behavioral proof |
| Banks and policy | Synthetic capture and inert mock fixtures; fail-closed gates | No real safety holdout or release authorization |
| Architecture navigation | Explicit contracts and qualification guidance | Complex architectures are descriptive, not executable |
The reference operation is W′ = W − αd(dᵀW), with a normalized direction and an explicitly declared dense out × in writer. Its narrow scope is intentional: establish a testable contract rather than quietly treating every architecture as the same matrix.
See the complete support matrix for precise limitations and the verification record for locally measured checks.
From a proposal to inspectable evidence

- Declare the graph, spaces, writer, and immutable baseline.
- Propose bounded interventions using a direction bound to that baseline.
- Compile one selected intervention into a separate artifact.
- Verify the transformation, stored observations, and selected trial chain.
- Evaluate policy against verified evidence and the selected bank.
Here, evidence-bound means artifact identities and consistency checks—not independent attestation, scientific validity, or safety certification. Eligibility is never publication approval.
Quickstart
Python 3.11+ · CPU only · no GPU or model download required
The commands below use a macOS/Linux shell. Clone this repository and run from its root. Installation needs access to Python dependencies; the reference workflow then runs locally without API keys or a network service.
python3 -m venv .venv
.venv/bin/python -m pip install -e '.[dev]'
# Inspect the runtime's declared capabilities.
.venv/bin/ablagent capabilities
# Run an original synthetic experiment into a fresh directory.
.venv/bin/ablagent demo --run-dir .runs/reference
# Recompute and verify the saved artifact.
.venv/bin/ablagent verify .runs/reference/candidate.manifest.json
What you get: a graph, baseline tensors, a bound direction, a proposed plan, a compiled candidate, retained trials, and an evidence bundle—not a modified language model.
Now check the gate:
.venv/bin/ablagent gate .runs/reference/candidate.evidence.json \
--bank examples/banks/synthetic-release-mock.bank.json
Expected: blocked with exit status 2. The demo intentionally lacks the required evidence. This demonstrates the fail-closed path; it is not a failed installation. Contract errors return 1. There is no publish command.
Use a fresh run directory for each demo: existing artifacts are preserved rather than silently overwritten. Continue with the full quickstart to separate planning from compilation and inspect the artifact flow.
Run it on a real checkpoint
The same discipline runs against a real HuggingFace model. Install the optional real extra, then drop a link:
.venv/bin/python -m pip install -e '.[real]'
.venv/bin/ablagent run --pack derisk --executor real \
--model https://huggingface.co/HuggingFaceTB/SmolLM2-135M \
--alpha 1.0
What actually happens, on CPU:
- S0 intake pins the exact commit, hashes every file, and declares every 2-D float weight as a typed writer (tied weights handled, bf16/f16 widened and restored on export).
- S1 baseline generates greedy responses on the pack's synthetic corpus — evidence, not a gate.
- S2 capture hooks writer outputs and contrasts refusal-side vs helpful-side assistant prefills; directions are labeled correlational, never causal.
- S3 bake compiles
W′ = W − αd(dᵀW)through the same DWMIP contract as the synthetic path, re-verifies the manifest independently, and exports an HF-loadable copy with exactly one tensor changed — every other file byte-identical, original dtype restored.
What it honestly refuses to claim: quantization, serving, behavior verification,
capability floors, and the operator red-line holdout are recorded as skipped —
untested, not passed. The run ends not_eligible; the export is an
experimental artifact for further research, not a release. Choose the edit site
with --writer <tensor_name>; the default is the strongest captured contrast.
Envelope: CPU-only, dense_out_in safetensors checkpoints (llama/qwen/
mistral/gemma-style), ≤ ~900 MiB float32 editable surface (≈ a 200 M-parameter
model). Oversize shards are rejected before download; Conv1D families
(gpt2/gpt_neo/gptj) fail closed at intake because shape-only layout inference
could edit the wrong axis. Other non-dense architectures (MoE, SSM) are not
qualified in v0 — treat any run on them as unvalidated. float64 checkpoints are
narrowed to float32 for the edit and restored to float64 on export (precision
of the edit itself is float32). A local HF-format directory also works as
--model for offline runs and CI.
Worked example: a real DWM run, end to end
The synthetic runtime formalizes the discipline; the Inkling-2-Mini-Derisked worked example shows it applied to a real checkpoint. It is the same duplication kit published with Blackfrost-AI/Inkling-2-Mini-Derisked on Hugging Face, vendored byte-identical at a pinned revision:
- A hard architecture case. Inkling-2-Mini is a loop transformer — 24 physical layers, layers 6–17 executed in 3 passes, 48 logical layer-visits. The kit shows physical-vs-logical targeting, per-pass direction capture, and a loop-enabled edit.
- The full evidence chain. Capture scripts, direction batteries, unit directions, an α 2.5 edit receipt bound to the shipped weight shard's SHA-256, and a pinned serving recipe.
- Inspectable offline.
python scripts/verify_example_provenance.pyre-hashes all 15 vendored files againstPROVENANCE.json; the test suite runs the same checks. The 79 MB raw capture is fetch-only via an explicit, digest-verified helper. - Honest about its own record. Six inaccuracies in the original published runbook were verified against the shipped scripts and receipts, corrected on Hugging Face (revision
c352150a), and preserved as correction history in the example README — the scripts and receipt are the ground truth.
The kit is vendored research material for the GPU/torch pipeline that produced the artifact; it is not executed by the synthetic v0 runtime, and reported benchmark numbers are labeled as run-record claims, not re-measured here. Researchers and their agents can study, verify, and reproduce the process with the upstream checkpoint and a CUDA host.
Architecture research, without shortcuts
Different computation graphs require different intervention semantics. The research guide explains what an adapter must establish before claiming support.
| Architecture surface | Questions to resolve |
|---|---|
| Dense residual networks | Which residual site? Which writer? Before or after normalization? |
| Routed and latent MoE | Which expert, route, latent space, and shared consumer? |
| Recurrent and hybrid networks | Which state component and recurrent step? Which update equation? |
| Looped and shared weights | Which logical site shares a physical parameter? Who else is affected? |
| Multimodal connectors | Which modality and coordinate space? What cross-modal regression checks? |
| Quantized and fused formats | Which codec, packing layout, write operation, and backend? |
These are qualification requirements, not supported execution backends. Start with architecture navigation and the method overview. Unsupported execution must remain explicit—not inferred from a filename, dimension, or sibling recipe.
Find your path
| You want to… | Start here |
|---|---|
| Run and inspect an experiment | Quickstart |
| Study a complete real-model DWM run | Inkling-2-Mini worked example |
| Measure false-refusal behavior | benchmarks/ — 443 eval · smoke-50 · cyber-10, hash-pinned protocol + offline scorer |
| Reproduce a GPU-scale model line | Recipe library — Qwen 9B-class · Qwen3.6-35B-A3B · GLM-5.3 BF16/Flash |
| Build capture/serve environments (vLLM · SGLang) | Serving stacks & the fast capture path |
| Study the refusal-removal origins and DWM extension | Research lineage |
| Understand the research method | Methodology · Architecture navigation |
| Build against the protocol | DWMIP v0 · Support matrix |
| Integrate an agent | Agent integration · Agent boot contract |
| Understand banks and evidence | Bank policy · Measurement contracts |
| Review trust and reproducibility | Threat model · Determinism |
| Inspect verification results | Verification record |
Help build the next layer
The most valuable contributions make a claim more explicit and more testable:
- Architecture contracts that expose ambiguous spaces, shared consumers, or unsupported operations.
- Conformance fixtures and small counterexamples that catch invalid assumptions.
- Adapter qualification proposals with clearly stated execution and evidence requirements.
- Reproducibility, parsing, documentation, and verification improvements.
Serving qualification, real refusal-behavior evaluation, and adapters beyond the dense CPU envelope (MoE, SSM, loop, Conv1D families) are future extension areas, not promised capabilities or delivery dates. See CONTRIBUTING.md before adding an adapter or dataset. Please do not submit private model runs, operational endpoints, credentials, or restricted prompt banks.
Run the checks
.venv/bin/pytest
.venv/bin/ruff check src tests
.venv/bin/ruff format --check src tests
.venv/bin/python scripts/export_schemas.py --check
Tests cover reference algebra, identity and axis mismatches, tampered artifacts, evidence replay, retained plans and trials, bank restrictions, and the offline CLI workflow. Report vulnerabilities through SECURITY.md, not through public issue details.
Licensing
Code is Apache-2.0. The original presentation artwork is also Apache-2.0. Project-authored synthetic bank content is CC BY 4.0, with provenance in each pack's PROVENANCE.md. The benchmark corpora carry their own scope: AdvBench/StrongREJECT MIT and XSTest CC BY 4.0 with verbatim license texts and attribution in benchmarks/PROVENANCE.md; cyber-10 and benchmark tooling are Apache-2.0. These licenses do not grant rights to third-party model weights, datasets, annotations, or serving stacks. The vendored worked example has its own per-file license scope: activation-derived research artifacts carry no additional license grant from this repository. The recipe library is Apache-2.0 with its own NOTICE and third-party notices; upstream model weights are not included and remain under their own terms.
관련 프로젝트 살펴보기
불러오는 중…