Skip to content

feat(MODEL-XOR): juspay/xor MoE decision model with ForwardMoeHidden - #3319

Closed
mudler-agent wants to merge 2 commits into
mainfrom
row/MODEL-XOR
Closed

mudler-agent wants to merge 2 commits into
mainfrom
row/MODEL-XOR

Conversation

@mudler-agent

Copy link
Copy Markdown
Collaborator

MODEL-XOR: juspay/xor MoE decision model

xor (juspay/xor) is a 35B MoE System 1 decision model from Qwen3.6-35B-A3B (~3B activated). Text-only Phase 1 path.

Key new infrastructure

  • ForwardMoeHidden: new single-sequence hidden-state extraction for the MoE backbone, mirroring ForwardDenseHidden (dense) but calling RunLayer (MoE) instead of RunDenseLayer. Returns [T, H] f32 post-final-norm hidden states with NO lm_head.
  • Forward+reverse option-order evaluation: runs the decision forward twice (original and reversed option order), then calibrates by averaging probabilities.

Architecture

  • Decision pipeline: build prompt → forward MoE backbone (ForwardMoeHidden) → extract last-token hidden → apply lm_head for candidate logit readout → forward+reverse → calibrate
  • Arch name: "XorModel"
  • Reuses Qwen3.5 MoE weights (LoadQwen3_5Moe) and config (ParseQwen3_5Config, MakeQwen3_5KVCache)

New files

  • include/vllm/model_executor/models/xor.h — head params, declarations
  • include/vllm/model_executor/models/xor_inference.h — XorDecisionResult + XorInference()
  • src/vllm/model_executor/models/xor_registry.cpp — factory, load, prepare, forward, inference, registration
  • tests/vllm/models/test_xor.cpp — 10 tests, 17 assertions (all pass)

Modified

  • include/vllm/model_executor/models/qwen3_5.h — declare ForwardMoeHidden
  • src/vllm/model_executor/models/qwen3_5.cpp — implement ForwardMoeHidden
  • CMakeLists.txt — add xor_registry.cpp
  • tests/CMakeLists.txt — add test_xor
  • src/capi/vllm_c.cpp — allowlist XorModel + XorInference dispatch in vllm_decide
  • src/vllm/entrypoints/openai/server_main.cpp — XorModel decision dispatch block

Spec

.agents/specs/xor.md

FOLLOWING_AGENTS_PROTOCOL
Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:glm5.2 [nib]

…-DECIDE specs

Add five SystemOne-class decision model specs to .agents/specs/:

- MODEL-CLM: frozen Qwen3-8B encoder + dual projection heads
  (state head + action head), scaled-cosine scoring, /v1/systemone
- MODEL-TEV1: autoregressive decision model (Qwen3.5-4B SFT),
  generates option letter via /v1/chat/completions (not /v1/systemone)
- MODEL-XOR: 35B MoE (Qwen3.6-A3B) + multimodal (up to 8 images),
  forward+reverse option-order eval, SGLang oracle
- MODEL-JEV: structured generation for DiffusionGemma (vLLM PR #57250),
  canvas seeding, read-only requests, pinned positions, logprobs
- MODEL-GLINER25-DECIDE: DeBERTa-v3-large + classification head
  (Linear→ReLU→Linear), reuses existing DeBERTa v2 encoder

Each spec follows the kev.md template structure. No implementation
code — specs only, per AGENTS.md §115 (spec before code).
…MoeHidden + forward+reverse calibration)

xor (juspay/xor) is a 35B MoE System 1 decision model from Qwen3.6-35B-A3B
(~3B activated). Text-only Phase 1 path.

Key new infrastructure:
- ForwardMoeHidden: new single-sequence hidden-state extraction for the MoE
  backbone, mirroring ForwardDenseHidden (dense) but calling RunLayer (MoE)
  instead of RunDenseLayer. Returns [T, H] f32 post-final-norm hidden states
  with NO lm_head.
- Forward+reverse option-order evaluation: runs the decision forward twice
  (original and reversed option order), then calibrates by averaging
  probabilities.

Decision pipeline: build prompt, forward MoE backbone (ForwardMoeHidden),
extract last-token hidden, apply lm_head for candidate logit readout,
run forward+reverse, calibrate.

Arch name: "XorModel". Reuses Qwen3.5 MoE weights (LoadQwen3_5Moe) and
config (ParseQwen3_5Config, MakeQwen3_5KVCache).

New files:
  include/vllm/model_executor/models/xor.h              — head params, declarations
  include/vllm/model_executor/models/xor_inference.h     — XorDecisionResult + XorInference()
  src/vllm/model_executor/models/xor_registry.cpp         — factory, load, prepare, forward, inference, registration
  tests/vllm/models/test_xor.cpp                          — 10 tests, 17 assertions (all pass)

Modified:
  include/vllm/model_executor/models/qwen3_5.h            — declare ForwardMoeHidden
  src/vllm/model_executor/models/qwen3_5.cpp             — implement ForwardMoeHidden
  CMakeLists.txt                                          — add xor_registry.cpp
  tests/CMakeLists.txt                                    — add test_xor
  src/capi/vllm_c.cpp                                     — allowlist XorModel + XorInference dispatch
  src/vllm/entrypoints/openai/server_main.cpp             — XorModel decision dispatch block

Spec: .agents/specs/xor.md
Issue: .agents/issues/MODEL-XOR/ISSUE-LOCAL-01M3APRTMQ4CCJRJAJZRAGC8E7.md

FOLLOWING_AGENTS_PROTOCOL
Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:glm5.2 [nib]
@mudler-agent

Copy link
Copy Markdown
Collaborator Author

Closing: the model implementation, tests, and docs from this PR were merged to main via #3324 (feat/parakeet-diarization). All model files are on main: clm_head.cpp, clm_registry.cpp, gliner25_decide_head.cpp, gliner25_decide_registry.cpp, xor_registry.cpp, tev1_registry.cpp, and all test files. E2E verified: CLM, GLiNER2.5-Decide, and Tev1-4B all load and serve correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants