D-Edge-Decision

A "System One" typed-decision model: one forward pass, zero generated tokens.

A 3.93B full fine-tune of domyn/Domyn-Edge-SFT. It answers a typed decision (yes/no, multiple-choice, graded score) by reading the next-token distribution over single-token option codes (A, B, …): a native probability distribution, no generated tokens. One run, one epoch, no ablations.

JevBench (231 public items)

# System Composite Intelligence Speed Cost
1 Plumb-4B 76.57 84.77 92.61 60.30
2 H2O-Lightning-4B † 76.40 84.14 92.61 60.30
3 Imajev-4B 75.13 79.70 92.61 60.30
4 JevK5 v0.2.0 74.75 78.43 92.61 60.30
5 D-Edge-Decision (ours) 73.97 75.89 92.61 60.30
5 decider-4b v2 73.97 75.89 92.61 60.30
7 SemIf (Qwen3.5-4B) 72.72 72.09 92.61 60.30
8 local-jev Qwen3.5-4B 72.50 71.45 92.61 60.30
9 Jev 1.13.0 (API) 72.03 80.33 91.50 54.73
10 reflex 4B 71.84 69.55 92.61 60.30
Tier Correct Accuracy
easy 48/48 1.000
medium 70/72 0.972
hard 75/111 0.676
all 193/231 0.835

Ours: self-measured on one H200 (2026-11-26), code below; ties decider-4b v2 at #5. † self-reported. Speed/Cost: one value for every 4B model (H2O-Lightning-4B's board row); Jev: its own board row. Composite = harmonic mean of the three.

Reproduce the JevBench numbers (one GPU, ~1 min)
# pip install torch==2.15.0 transformers==5.22.1 einops==0.8.2 ; git clone https://github.com/fstandhartinger/jevbench
import inspect, itertools, json, string, sys
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

M = sys.argv[1] if len(sys.argv) > 1 else "deshwalmahesh/d-edge-decision"
JB = sys.argv[2] if len(sys.argv) > 2 else "jevbench/datasets/public"
tok = AutoTokenizer.from_pretrained(M, trust_remote_code=True)
tok.padding_side = "left"
model = AutoModelForCausalLM.from_pretrained(M, trust_remote_code=True, dtype=torch.bfloat16).cuda().eval()


def fp32(f):  # run f with autocast off
    def g(*a, **k):
        with torch.autocast("cuda", enabled=False):
            return f(*a, **k)
    return g


head = model.get_output_embeddings()  # fp32 LM head + fp32 RoPE angles
head.register_forward_hook(fp32(lambda m, i, o: torch.nn.functional.linear(i[0].float(), m.weight.float())))
for m in model.modules():
    if "inv_freq" in m._buffers:
        m.forward = fp32(m.forward)

PROMPT = ("Answer the question about the state with exactly one option code.\n\nState:\n{state}\n\nQuestion: {question}"
          "\n\nOptions:\n{options}\n\nReply with only the option code.")
chat = lambda u: tok.apply_chat_template([{"role": "user", "content": u}], tokenize=False, add_generation_prompt=True,
                                         enable_thinking=False)
tail, pre, codes = chat("x"), tok.encode(chat("x"), add_special_tokens=False), []
for c in list(string.ascii_uppercase) + ["".join(p) for p in itertools.product(string.ascii_uppercase, repeat=2)]:
    ids = tok.encode(tail + c, add_special_tokens=False)  # codes that are ONE token at the decision position
    if ids[:-1] == pre and ids[-1] not in [i for _, i in codes]:
        codes.append((c, ids[-1]))


def item(r):  # JevBench item -> (option texts, gold index)
    q, crit = r["question"], r["question"].get("criteria")
    if q["type"] == "noul":
        return ["yes", "no"], 0 if r["expected"] == "yes" else 1
    if q["type"] == "score":
        return [str(c) for c in (crit or r["labels"])], int(r["expected"])
    if isinstance(crit, dict):
        return [f"{k} — {v}" if v else str(k) for k, v in crit.items()], list(crit).index(r["expected"])
    keys = [str(k) for k in (crit or r["labels"])]
    return keys, keys.index(r["expected"])


rows = []
for tier in ("easy", "original", "hard"):
    for line in open(f"{JB}/{tier}.jsonl"):
        r = json.loads(line)
        if r.get("expected") is None or (r.get("provenance") or {}).get("exclude_reason"):
            continue
        opts, gold = item(r)
        st = r["state"] if isinstance(r["state"], str) else json.dumps(r["state"], ensure_ascii=False, sort_keys=True)
        lines = "\n".join(f"{codes[i][0]}: {t}" for i, t in enumerate(opts))
        rows.append((tier, chat(PROMPT.format(state=st, question=r["question"]["instructions"], options=lines)),
                     [codes[i][1] for i in range(len(opts))], gold))

pos = "position_ids" in inspect.signature(model.forward).parameters
hit = {t: [0, 0] for t in ("easy", "original", "hard")}
with torch.no_grad(), torch.autocast("cuda", dtype=torch.bfloat16):
    for b in range(0, len(rows), 8):  # batches of 8, left-padded
        batch = rows[b:b + 8]
        enc = tok([r[1] for r in batch], padding=True, return_tensors="pt").to("cuda")
        if pos:
            enc["position_ids"] = (enc["attention_mask"].cumsum(-1) - 1).clamp(min=0)
        logits = model(**enc, logits_to_keep=1, use_cache=False).logits[:, -1, :].float()
        for (tier, _, ids, gold), lg in zip(batch, logits):
            hit[tier][0] += int(lg[ids].argmax()) == gold
            hit[tier][1] += 1

n_ok, n = sum(h[0] for h in hit.values()), sum(h[1] for h in hit.values())
chance = sum(1 / len(r[2]) for r in rows) / n
I = 100 * (n_ok / n - chance) / (1 - chance)
print({t: f"{a}/{b}" for t, (a, b) in hit.items()}, f"all {n_ok}/{n} = {n_ok / n:.3f}")
print(f"Intelligence {I:.2f}  Composite {3 / (1 / I + 1 / 92.61 + 1 / 60.30):.2f}  (Speed 92.61, Cost 60.30: board 4B row)")

Inference — Transformers (HF)

Python 3.12, transformers==5.22.1, torch==2.15.0, einops. Load in fp16, no autocast:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "deshwalmahesh/d-edge-decision"
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id, trust_remote_code=True, dtype=torch.float16
).to("cuda").eval()

# fp32 LM head — the option logits sit ~30–36, where one fp16 step moves a prob by a point
model.get_output_embeddings().register_forward_hook(lambda m, i, o: o.float())

def decide(state, question, options):
    lines = "\n".join(f"{chr(65+i)}: {o}" for i, o in enumerate(options))
    user = (f"Answer the question about the state with exactly one option code.\n\n"
            f"State:\n{state}\n\nQuestion: {question}\n\nOptions:\n{lines}\n\n"
            f"Reply with only the option code.")
    text = tok.apply_chat_template([{"role": "user", "content": user}], tokenize=False,
                                   add_generation_prompt=True, enable_thinking=False)
    enc = tok(text, return_tensors="pt").to("cuda")
    with torch.no_grad():  # no autocast: the attention needs q/k/v in one dtype
        logits = model(**enc, logits_to_keep=1).logits[:, -1, :].float()
    codes = [tok.encode(" " + chr(65+i), add_special_tokens=False)[-1]
             for i in range(len(options))]
    probs = torch.softmax(logits[0, codes], -1).tolist()
    return dict(zip(options, probs))

print(decide("The customer was charged twice for one order.",
             "Which team should handle this?",
             ["billing", "shipping"]))
# -> {'billing': 0.98…, 'shipping': 0.01…}

Training

Full-parameter SFT on the train splits of tasksource/tasksource-jev-typed-decisions, caiovicentino1/eikos-decisions (core + long_context) and crh225/plumb-decisions; their validation/test splits and the 231 JevBench items are held out. Bidirectional attention in the global layers (chosen over causal by a short val-NLL pilot), soft cross-entropy + 1.0 × Brier over the options, fp32 LM head and RoPE, 16k-token sequences, 1 epoch, cosine LR 3.5e-6, checkpoint selected by val NLL.

Full end-to-end code: https://huggingface.co/deshwalmahesh/d-edge-decision/tree/main/e2e_code

bash tasks/jev_models/run_gpu.sh domyn/Domyn-Edge-SFT

License

Apache-2.0, inherited from the base model domyn/Domyn-Edge-SFT.

Disclaimer

This is a personal and independent experiment by the author. This experiment is not affiliated with, endorsed by, or related to any company or organization.

Downloads last month
2,689
Safetensors
Model size
4B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for deshwalmahesh/d-edge-decision

Finetuned
(7)
this model

Datasets used to train deshwalmahesh/d-edge-decision