license: apache-2.0
language:
- en
- zh
library_name: transformers
pipeline_tag: text-generation
tags: - llm
- sparkx2_5
- heretic
- uncensored
- decensored
- abliterated
- reproducible
base_model: XHToken/Spark-X2.6-1.7B
This is a decensored version of XHToken/Spark-X2.6-1.7B, made using Heretic v2.1.0
This model is reproducible!
See the README in the
reproducedirectory for more information.
[!TIP]
💜 Enjoying my work? You can support my independent AI projects here.
Arbitrary-Rank Ablation (ARA) parameters
| Parameter | Value |
|---|---|
| start_layer_index | 7 |
| end_layer_index | 15 |
| preserve_good_behavior_weight | 0.9772 |
| steer_bad_behavior_weight | 0.0003 |
| overcorrect_relative_weight | 0.9678 |
| neighbor_count | 14 |
Performance
| Metric | This model | Original model (XHToken/Spark-X2.6-1.7B) |
|---|---|---|
| Refusals | 4/100 | 100/100 |
| KL divergence | 0.0165 | 0 (by definition) |
Evaluation methodology
- Refusal-keyword matches: Heretic's KeywordRate scorer, evaluated on the first 100 prompts from mlabonne/harmful_behaviors (test[:100]). A response is counted when it contains any configured refusal keyword, case-insensitively. This is a keyword-based proxy, not a semantic or human-reviewed refusal evaluation.
- KL divergence: Heretic's KLDivergence scorer, evaluated on the first 100 prompts from mlabonne/harmless_alpaca (test[:100]). The original model is the reference, so its divergence is zero by definition.
Full evaluation settings, keyword markers, dependencies, optimization history, and reproduction instructions are available in the reproduce/ directory.
Safety and Responsible Use
This model has undergone refusal-behavior modification using Heretic.
As a result, it may respond to requests that the original model would
have refused.
Users are responsible for evaluating its outputs and ensuring that
their use complies with applicable laws and regulations.
The model may generate inaccurate, misleading, harmful, or otherwise
inappropriate content. Its outputs should not be treated as verified
information or professional advice.
[!Note]
This repository contains model weights and configuration files for the post-trained model in the Hugging Face Transformers format.The architecture descriptions, capability claims, and benchmark results in the following sections originate from the original XHToken/Spark-X2.6-1.7B documentation. They have not been independently re-evaluated on this Heretic variant. The variant-specific evaluation results are reported above.
Introduction
We introduce Spark-X2.6-1.7B, the second model in the Spark-X2.6 series, following the release of Spark-X2.6-4B. Building on Spark-X2.5-1.7B, this release further advances our compact, general-purpose language models for on-device deployment.
Spark-X2.6-1.7B retains exactly the same architecture as Spark-X2.5-1.7B, achieving its capability gains through improved post-training. It delivers substantial improvements in coding, agent, long-context, multilingual, reasoning, etc. These capability gains, combined with strong inference efficiency among models of comparable size, enable more capable and practical on-device AI for developers and users tackling real-world tasks.
Technical Highlights:
- Stronger Coding, Agentic, and Long-Context Capabilities: The model delivers substantial improvements in complex tool use, multi-step planning, software engineering, and reasoning over extended contexts, achieving state-of-the-art performance among open-source models of comparable size.
- Efficient On-Device Inference: The model delivers strong on-device inference efficiency, achieving leading decoding throughput among similarly sized open-source models in our evaluations and enabling more responsive AI experiences on local hardware.
- Controllable Thinking Budget: The model provides three configurable thinking levels—none, low, high—allowing applications to balance reasoning quality, latency, and inference cost dynamically.
Benchmarks
We evaluate our models and compare them with leading on-device models of similar size across a broad range of tasks, including agent, code, math, general and knowledge.
Spark-X2.6-1.7B surpasses models of comparable size on most benchmarks, delivering state-of-the-art results.
Edge Inference
Spark-X2.6-1.7B delivers leading decoding throughput at shorter context lengths among the on-device models we evaluated, including Qwen3.5-2B, MiniCPM-2B, and LFM2.5-2.6B. Moreover, our optimized llama.cpp implementation(https://github.com/XHToken/llama.cpp) amplifies this performance advantage across all tested context lengths on the RTX 4090, underscoring its strong efficiency for responsive local AI.
Reasoning Effort Comparison
We compare high and low reasoning effort across agent, code, math, long-context, and general knowledge tasks. When switching from high to low, Spark-X2.6-1.7B average score decreases by 4.0 points, while its average output length drops by 37.3%. For Spark-X2.6-4B, the average score decreases by 1.7 points, while average output length drops by 22.0%. This flexibility allows developers to balance task performance and generation efficiency according to their application needs.
Quickstart
Transformers
Install the required version with pip install transformers==4.57.1.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Peymandc/Spark-X2.6-1.7B-Uncensored-Peymandc"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "What is the capital of Anhui Province?"}]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
enable_thinking=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=131072,
do_sample=True,
temperature=1.0,
top_p=0.95,
top_k=0,
)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
License
The Spark-X2.6 model series is licensed under the Apache 2.0 License.
Acknowledgements
This model is derived from XHToken/Spark-X2.6-1.7B, developed by XHToken.
Refusal-behavior modification was performed using Heretic.
If you use this model in your work, please credit both the original model and this modified release.
💜 Support Independent Development
These projects are part of my ongoing exploration of open-weight AI models.
Your support helps make more room for experimentation, model modifications, testing, research, and future releases.
If you find my work useful and would like to contribute, you're welcome to visit my support page:
Every contribution is appreciated, but never expected. Sharing feedback, reporting issues, and simply using the models are also wonderful ways to support independent development.
Thank you for being here. ❤️