niqun123123's picture
Full sync: LemonDecider 4B preview (2026-12-05 new_hf_model)
8edef7d verified
|
Raw History Blame Contribute Delete
7.12 kB
# LemonJev 4B — Decision Model
**Model ID:** `lemonjev-4b-decision-20261202-v1`
**Base model:** `Qwen/Qwen3.5-4B`
LemonJev answers typed decision questions about a text or structured-JSON state.
It returns calibrated choice probabilities, a yes/no probability (`noul`), or an
ordinal score, in a single forward pass — no generated answer text, no chat loop.
This directory is a complete, self-contained local inference package. Copy the
whole folder; no base-model download, adapter, or external code is required.
## Architecture
| Property | Value |
|---|---|
| Backbone | Qwen3.5-4B hybrid (linear + periodic full attention) |
| Decision head | Linear readout over the final hidden state, up to 255 options |
| Attention | Non-causal full attention on full-attention layers, SDPA |
| Readout position | Final non-padding token |
| Precision | BF16 weights; FP32 probability post-processing |
| Capacity | 262,144 tokens per question (template included); 1–255 options |
| Modalities | Text and structured JSON only; no images or video |
| Loader | `modeling_lemondecider.LemonDeciderForDecisionClassification`, `trust_remote_code=True` |
Each question is rendered with the bundled protocol and answered independently.
Inputs are never truncated: a request that exceeds the context limit raises an
error instead of silently dropping content.
## Request format
```json
{
"state": "订单已经收到,但商品损坏。客户希望退货并退款。",
"questions": {
"intent": {
"type": "choice",
"instructions": "客户的主要诉求是什么?",
"criteria": {"refund": "退货退款", "delivery": "查询物流", "account": "账户问题"}
},
"damaged": {"type": "noul", "instructions": "客户是否表示商品损坏?"},
"urgency": {"type": "score", "instructions": "评估处理紧急程度。", "criteria": ["低", "中", "高"]}
}
}
```
- `state`: string, list, or JSON object.
- `questions`: 1–256 named questions; every question sees the full state.
- `choice`: `criteria` is an object of 1–255 named options. Returns option
probabilities, the selected `choice`, and a `confidence` in `[0, 1]`.
- `noul`: returns `noul`, the probability of the affirmative answer. Optional
`criteria` may describe the `false` and `true` meanings.
- `score`: `criteria` is an ordered list of 2–255 descriptions. Returns the
zero-based expected level and its distribution (not necessarily an integer).
Rendering, chat template, and temperature are applied by the bundled runtime.
Do not add a chat template or divide probabilities by a temperature yourself.
## Quick start
```bash
# from this directory
python -m pip install -r requirements.txt
python verify.py
python model.py --device cuda:0 --input example.json
```
`--device auto` selects the first accelerator when available and falls back to
CPU. The CLI writes one JSON object to stdout.
Python:
```python
from model import DecisionModel
model = DecisionModel(".") # or DecisionModel("/path/to/package")
answer = model.predict(request) # request as shown above
print(answer["answers"]["intent"])
```
Use the bundled `example.json` as a starting point. See `QUICKSTART.md` for the
full walkthrough and troubleshooting.
## Package contents
| File | Purpose |
|---|---|
| `model-00001-of-00002.safetensors`, `model-00002-of-00002.safetensors` | BF16 weights |
| `model.safetensors.index.json` | Weight index |
| `config.json`, `configuration_lemondecider.py` | Model configuration and loader |
| `modeling_lemondecider.py` | Inference architecture |
| `decision_runtime.py` | Protocol rendering and probability post-processing |
| `model.py` | Python API and CLI |
| `serve.py` | Local GPU HTTP service (`/health`, `/v1/systemone`) |
| `DEPLOYMENT.md` | Local GPU deployment guide, correctness smoke tests and 256K resource measurements |
| `tokenizer.json`, `tokenizer_config.json`, `chat_template.jinja`, `processor_config.json` | Tokenizer and processor |
| `decision_config.json` | Protocol summary |
| `example.json` | Runnable three-type example |
| `SHA256SUMS`, `verify.py` | Integrity manifest and checker |
| `LICENSE`, `LICENSE.code`, `NOTICE` | Licenses and attribution |
Run `python verify.py` to check every file against `SHA256SUMS`.
## Evaluation
Decision Index **0.3**, full public suite (complete).
| Headline | Score |
|---|---:|
| Decision Index (public) | **74.16** |
| Raw index | 80.07 |
| Breadth skill | 74.02 |
| Area (weight) | Skill | Raw |
|---|---:|---:|
| Knowledge & Reasoning (25.8%) | 77.65 | 81.69 |
| Language Understanding (25.8%) | 68.77 | 76.94 |
| Retrieval & Classification (20.0%) | 72.33 | 78.28 |
| Tools & Automation (18.3%) | 81.61 | 83.72 |
| Arts & Human Taste (10.0%) | 69.09 | 80.83 |
### Comparison
| Model (Decision Index 0.3, full public suite) | Index | Raw | Knowledge | Language | Retrieval | Tools | Arts |
|---|---:|---:|---:|---:|---:|---:|---:|
| **This model** | **74.16** | **80.07** | **77.65** | 68.77 | 72.33 | **81.61** | **69.09** |
| LemonDecider 4B v3.1 | 63.78 | 72.09 | 46.39 | **70.04** | **73.14** | 72.99 | 57.01 |
| LemonDecider 4B v3 | 60.07 | 69.37 | 40.61 | 68.00 | 68.24 | 74.38 | 47.41 |
Areas are chance-corrected skill on the 0–100 scale. v3 and v3.1 are earlier
clean-data runs; the benchmark-track note above applies to this model.
Scope: 140,178 scoreable requests over 43 benchmarks; scores are chance-corrected
and coverage-adjusted (unsupported or unanswered requests count as wrong); the
index is the fixed-weight mean of the five areas, with gold benchmarks weighted
1.2 inside an area. This public index is 20% of the board Full score; Full score
(0.4.x) = 60% private same-skill + 40% private new-domain. Data note:
benchmark-track entry; training data includes public-evaluation-derived samples.
## Limitations
- Decision classification only: this is not a general-purpose chat model and
does not generate free-form answers.
- Text-only release; image and video inputs are rejected.
- One readout per question; questions are answered independently rather than
jointly.
- 262,144-token hard input limit per question; longer requests fail explicitly.
- The input gate is opened to the backbone's 256K position capacity without changing
weights. Final SFT used inputs no longer than 8,192 tokens. A synthetic 262,100-token
single-question forward passed on a 96 GiB PPU (156.3s; 95,795 MiB whole-GPU peak),
but quality and calibrated behavior beyond 8K remain unvalidated. Long requests require
substantial accelerator memory and compute; the reported evaluation scores are not
256K claims. See `DEPLOYMENT.md` for measured resource usage and deployment checks.
- Quality depends on the wording of `instructions` and option descriptions.
## License and attribution
Backbone: Qwen3.5, Copyright 2026 Alibaba Cloud, Apache License 2.0 (see
`LICENSE`). Decision protocol components: Copyright (c) 2026 Denis Yarats, MIT
License (see `LICENSE.code`). See `NOTICE` for the full attribution.
This package contains no training data or training logs.