Spark-X2.6-4B-AgentFast (Step 150)
Spark-X2.6-4B-AgentFast is a fine-tuned checkpoint of XHToken/Spark-X2.6-4B tuned specifically for autonomous tool calling, system operations, and prompt compliance without deliberation latency.
The Story Behind This Checkpoint (Post-Mortem & Mechanism)
Empirical "Happy Accident": Our original fine-tuning objective was to train the model on full multi-step Fable deliberation traces. However, due to a chat-template field mapping mismatch where
<thought>traces were not parsed into the template's expectedreasoning_contentkey, the training targets were prepared with empty reasoning channels (<|Bot|></think>).Over 150 steps of SFT, the model inadvertently learned an aggressive "early-exit" reflex: it slams the thinking channel shut at token position 0 and immediately emits tool calls and direct answers. Because the underlying transformer weights remained intact, it preserved its core instruction and math skills while running 30–40% faster. We are releasing this artifact as an interesting low-latency edge agent case study while actively preparing a corrected fine-tune that fully preserves reasoning traces.
Benchmark Results & Evaluation
Evaluated against the stock post-trained Spark-X2.6-4B instruct model across three official benchmark suites on Vulkan1 (Radeon PRO V320):
1. Berkeley Function Calling Leaderboard (BFCL v3 exec_simple)
Evaluated on 30 official test samples with strict Python AST syntax and argument verification:
- Exact Argument Accuracy: 83.3% (vs. 80.0% stock) — +3.3% higher precision
- Function Name Accuracy: 90.0% (vs. 93.3% stock)
- Tool Invocation Rate: 93.3% (vs. 93.3% stock)
- Average Latency per Call: 3.11s (vs. 5.13s stock) — 39.4% faster (2.02 seconds saved per invocation)
2. Instruction-Following Evaluation (Official Google IFEval)
Evaluated with Google Research's canonical test suite:
- Prompt-Level Strict Accuracy: 65.0% (vs. 15.0% stock) — +50.0% gain (+333% relative)
- Prompt-Level Loose Accuracy: 70.0% (vs. 15.0% stock) — +55.0% gain (+367% relative)
- Instruction-Level Strict Accuracy: 60.0% (vs. 36.7% stock)
3. Symbolic Reasoning & Math (Gaokao Math 2026 Objective)
Evaluated on 15 objective multiple-choice questions from the 2026 Gaokao Math exam to verify reasoning retention:
- Multiple-Choice Accuracy: 40.0% (6/15) vs. 46.7% (7/15) — Retains core symbolic and mathematical foundation with only a 1-question delta.
- Average Latency per Problem: 6.18s (vs. 9.78s stock) — 36.8% faster turnaround without 400-token monologue overhead.
Key Behavioral Enhancements
- Zero Deliberation Latency: Stock Spark-X2.6-4B defaults to extensive internal thinking channels (often consuming 350–450 tokens in stream-of-consciousness monologues before answering), even when setting
reasoning_effort=low. AgentFast immediately closes the thought channel (</think>) and emits direct tool calls (<tool_call>) and structured responses in 2–4 seconds (~61 tokens/sec on Vulkan). - Autonomous Tool Invocations: Emits structured XML (
<arg_key>) and JSON argument payloads ready for live executor pipelines without hesitations or conversational preambles.
Quickstart & Inference
1. Using llama.cpp (CLI & Server)
Quantized GGUF files are available at JamieBradfield/Spark-X2.6-4B-AgentFast-GGUF.
CLI One-Liner (Vulkan / ROCm / CUDA / CPU):
llama-cli \
-m Spark-X2.6-Fable-Step150-IQ3_M.gguf \
-p "<|start▁of▁sentence|><|User|>List 3 core rules of memory management.<|end▁of▁sentence|><|start▁of▁sentence|><|Bot|>" \
-n 512 \
-ngl 99 \
-c 4096 \
--temp 0.2 \
--single-turn
Serve as OpenAI-Compatible API:
llama-server \
-m Spark-X2.6-Fable-Step150-IQ3_M.gguf \
--port 8080 \
-ngl 99 \
-c 4096
2. Using Transformers (Python)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "JamieBradfield/Spark-X2.6-4B-AgentFast"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto"
)
messages = [{"role": "user", "content": "List 3 core rules of memory management."}]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.2)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
Files & Formats
- Hugging Face BF16 Trunk: Standalone
model.safetensorswith embeddedSpark2_5architecture files. - Quantized GGUF:
Spark-X2.6-Fable-Step150-IQ3_M.gguf(1.94 GB, fits in ~2.1 GB VRAM at 1024 context).
Disclaimer & No Warranty of Update
Notice: This model is shared as an experimental research release provided "as-is", without warranties of any kind, express or implied. There is no commitment or warranty of future updates, maintenance, or downstream bug fixes.
- Downloads last month
- 397