Skip to content

About

An Open-Vocabulary Probabilistic Multimodal Decision Model

Topics

Resources

Stars

32 stars

Watchers

0 watching

Forks

Latest commit

 

History

25 Commits

Folders and files

Repository files navigation

LightDecision-1

An Open-Vocabulary Probabilistic Multimodal Decision Model

Paper Papers with Code: MMDM results Project Page Hugging Face · 4B Weights Hugging Face · 27B Weights Quick Start

Installation · Quick Start · Request format · Runtime controls


LightDecision-1 predicts probabilities over candidate choices supplied with each request. It supports text and image inputs, action selection, binary judgments, and rubric scoring without generating an answer token by token. This repository provides the inference runtime, Python interface, and HTTP service for both released models.

✨ Highlights

Open vocabulary, dynamic candidate sets: describe options in natural language and add candidates within memory limits. Reuse computation for the same state: share cached attention and recurrent states across option branches. Reorder the options, preserve the judgments: shared set blocks keep probabilities aligned with their options. Understand relationships between options: bidirectional attention lets candidates influence one another's relative scores.

📊 Highlighted Results

Multimodal decision benchmarks. LightDecision-1 4B and 27B are compared with Jev 1.14, Clef-Omni, Perplexity Decider-V1, Intern-Decision, and GPT-6 Luna Decisions on GameWorld, EmbodiedBench-ALFRED, EmbodiedBench-Habitat, and InfographicVQA.

LightDecision-1 is evaluated on games, embodied tasks, and visual question answering, as well as text decisions and tool calling.

🧠 Architecture

LightDecision-1 architecture. A Qwen3.5 multimodal backbone encodes the state and query once into a shared prefix cache. Each option is decoded as its own branch, two bidirectional set-attention blocks let the options interact, and a compatibility layer with softmax returns a probability for each option.

The state, image, and query are encoded once and cached. Each candidate option continues from that shared prefix in parallel. A set-attention head then compares the options jointly and returns one probability per option.

🎮 Games & Embodied Task Examples

Games and embodied tasks are driven by the same loop: observe, list candidate actions, and pick one. Each replay below plays automatically in a loop and shows the selected action at the top of the frame. Select a replay to open the full-quality video.

Animated replay: 2048
2048
Games · A number-merging puzzle · 0:58
Animated replay: Snake
Snake
Games · The classic Snake game · 0:20
Animated replay: Core Ball
Core Ball
Games · Timing with a rotating target · 0:19
Animated replay: Another Gentleman's Adventure
Another Gentleman's Adventure
Games · Side-scrolling platformer · 0:08
Animated replay: Organize two books
Organize two books
ALFRED · Move both books from the bed to the desk · 0:22
Animated replay: Pick up keys, switch on lamp
Pick up keys, switch on lamp
ALFRED · Pick up the keys and turn on the floor lamp · 0:12
Animated replay: Find cleaning supplies
Find cleaning supplies
Habitat · Find an item to clean a spill, place it on the left counter · 0:09
Animated replay: Find a red disc by appearance
Find a red disc by appearance
Habitat · Move a flat red round object to the right counter · 0:25

🛠️ Installation

Use Python 3.11 or later and a CUDA-enabled PyTorch installation with BF16 support. Install the appropriate PyTorch build for your CUDA environment first, then:

git clone https://github.com/LightDecision/lightdecision-1.git
cd lightdecision-1
python -m pip install -e ".[cuda,serve]"
lightdecision doctor

The released checkpoints require bfloat16 backbone loading, FP32 head computation, and fla-core==0.5.2. The runtime pins Transformers and Flash Linear Attention to the versions required by its cache and CUDA kernel interfaces; a missing or incompatible kernel installation raises a configuration error. Weight files occupy approximately 9.2 GB for 4B and 52.3 GB for 27B; GPU memory must also accommodate image processing, activations, and caches.

Both checkpoints have been checked with Python 3.12, PyTorch 2.11.0 (CUDA 12.9), Transformers 5.12.1, and fla-core==0.5.2, including text decisions, shared image inputs, candidate images, and HTTP requests.

🚀 Quick Start

Checkpoint loading

--model /path/to/checkpoint loads local files. The Python and HTTP interfaces load the complete checkpoint: vision-language backbone, decision head, tokenizer, processor, configuration, and temperature metadata. Configuration is resolved from the checkpoint manifest. Load the entire directory rather than its backbone/ subdirectory.

lightdecision validate-artifact shenjunhao/lightdecision-1-4b
lightdecision validate-artifact /path/to/checkpoint --verify-hashes

Full hash verification reads all weight files. --revision <commit>, --cache-dir, and --local-files-only are available for loading, serving, and checkpoint validation. An online Hub load resolves one immutable commit before downloading files.

The default device is cuda:0. Select another GPU with --device cuda:1 or CUDA_VISIBLE_DEVICES.

Run a decision

lightdecision infer \
  --model shenjunhao/lightdecision-1-4b \
  --request examples/decision.json

Use shenjunhao/lightdecision-1-27b to select the larger model. Hub checkpoints are downloaded automatically.

from lightdecision.runtime.engine import DecisionEngine

engine = DecisionEngine("shenjunhao/lightdecision-1-4b")
result = engine.predict({
    "model": "lightdecision-1",
    "state": "A robot needs to fill an empty mug at a sink.",
    "questions": {
        "action": {
            "type": "choice",
            "instructions": "Choose the next action.",
            "criteria": {
                "Move the mug under the tap": None,
                "Open a drawer": None,
            },
        }
    },
})
print(result["answers"]["action"]["choice"])
print(result["answers"]["action"]["probabilities"])

Batch inference

Use predict_decisions() for independent decisions with their own states and candidate sets. It accepts a list of Decision records and returns one probability list per decision, preserving decision and option order.

from lightdecision.models.decision.schema import Decision, Option

# Reuse the engine loaded above.
decisions = [
    Decision(
        id="robot",
        state="A robot holds an empty mug next to a sink.",
        question="Choose the next action to fill the mug.",
        options=(Option("tap", "Place the mug under the tap"),
                 Option("drawer", "Open a drawer")),
    ),
    Decision(
        id="support",
        state="A customer was charged twice for one order.",
        question="Choose the next customer-support action.",
        options=(Option("investigate", "Investigate the duplicate charge"),
                 Option("shipping", "Send a shipping update"),
                 Option("close", "Close the ticket")),
    ),
]

probabilities = engine.predict_decisions(decisions)
for decision, scores in zip(decisions, probabilities):
    print(decision.id, dict(zip((option.id for option in decision.options), scores)))

Text decisions are collated for batched model execution. Choose batches with similar input lengths and candidate counts to limit padding and memory use; branch_microbatch_size bounds the candidate branches processed together. For image decisions, pass an aligned list such as images=[["scene-a.jpg"], ["scene-b.jpg"]]. That path processes decisions individually and shares each decision's image prefix across its options.

For the JSON request format, use engine.predict_batch([request_a, request_b]) or the HTTP batch endpoint. A single predict() call can also answer multiple questions sharing one state.

Image inputs

lightdecision infer \
  --model shenjunhao/lightdecision-1-4b \
  --request examples/vision.json \
  --image /path/to/image.jpg

Repeat --image for multiple images. For a shared image prefix in a JSON request, supply an images array containing local file paths or image data URLs. Local paths refer to the machine running inference. For HTTP clients, prefer embedded PNG/JPEG bytes through named assets:

import base64
from pathlib import Path

request = {
    "model": "lightdecision-1",
    "assets": {
        "@scene": {
            "type": "image",
            "format": "jpg",
            "data_base64": base64.b64encode(Path("scene.jpg").read_bytes()).decode(),
        }
    },
    "state": {"observation": "@scene", "goal": "Find a clear walking path."},
    "questions": {
        "action": {
            "type": "choice",
            "instructions": "Choose a direction.",
            "criteria": {"Go left": None, "Go right": None, "Stay still": None},
        }
    },
}

References may occur in the state, instructions, or candidate descriptions. Repeated references retain their positions. Every declared asset must be used. data_base64 contains standard padded base64 without a data-URL prefix. Formats are png, jpg, or jpeg.

Multipart HTTP requests put the JSON request part first. An asset can use "part": "image_file" in place of data_base64, followed by a file part named image_file. Each file part must be referenced exactly once by an asset.

📋 Request format

{
  "model": "lightdecision-1",
  "state": "The situation to assess.",
  "questions": {
    "task_id": {
      "type": "choice",
      "instructions": "Choose the best candidate.",
      "criteria": {"Candidate A": "Description A", "Candidate B": null}
    }
  }
}

state, instructions, and candidate descriptions accept strings or structured JSON. Question IDs identify outputs and do not enter the model's decision text. Multiple questions may share one state. The model value must match the alias (lightdecision-1 by default) or the identifier returned by /v1/models.

Type Criteria Output
choice Map of candidate names to descriptions or null Selected choice, per-candidate probabilities, and confidence
noul Optional descriptions under false and true noul: probability of true
score Ordered array of rubric-level descriptions score: expected zero-based level index, probabilities, legend, and confidence

For example, three score levels produce a score between 0 and 2. confidence summarizes the returned distribution; it is not a separate prediction.

🌐 HTTP service

export LIGHTDECISION_API_KEY='your-service-key'
lightdecision serve \
  --model shenjunhao/lightdecision-1-4b \
  --host 127.0.0.1 --port 8080
curl http://127.0.0.1:8080/v1/systemone \
  -H "Authorization: Bearer $LIGHTDECISION_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @examples/decision.json

GET /health reports readiness; GET /v1/models lists the model identifier and service alias. POST /v1/systemone returns model, answers, and usage. Answers are keyed by question ID. usage.output_tokens is zero because the runtime computes candidate probabilities directly. The Python interface includes execution metadata; HTTP includes it only with --include-runtime-metrics.

Set LIGHTDECISION_API_KEY to require bearer authentication for /v1/models, /v1/systemone, and /v1/systemone/batch. If it is unset, the service runs without authentication. /health remains a readiness endpoint. The default bind address is 127.0.0.1; choose --host 0.0.0.0 when deploying behind your network gateway.

Each process loads one model on the selected GPU and serializes inference requests through that instance. Increasing web-worker count duplicates model memory. Use separate ports and --device values for multiple model instances.

Invalid model IDs, malformed questions, unused assets, or exceeded token budgets return validation errors.

Batch requests

POST /v1/systemone/batch accepts {"requests": [request_a, request_b]}. Each item uses the request format, including its own model, state, and questions. See examples/batch.json for a complete two-request batch.

curl http://127.0.0.1:8080/v1/systemone/batch \
  -H "Authorization: Bearer $LIGHTDECISION_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @examples/batch.json

The response contains model, an ordered results array, and aggregate usage. Each result contains the usual model, answers, and usage; question IDs are scoped to their request and may repeat across items. results[0] corresponds to requests[0].

Pure-text batches use batched model execution across requests. Batches containing images follow the existing image inference path one request at a time, including support for embedded image assets in states, questions, or candidates. Send image data URLs or base64 assets in JSON. The batch endpoint accepts JSON; multipart uploads use /v1/systemone.

The HTTP batch limit defaults to 8 requests and is configurable with --max-batch-size. Token limits apply to each item. All items are parsed and checked before model execution; invalid or oversized batches return 422 without partial results. With --include-runtime-metrics, batch metadata reports batched_text or sequential_multimodal. Separate HTTP calls continue to execute serially through each engine instance.

⚙️ Runtime controls

  • --branch-microbatch-size: bounds the number of candidate branches executed together; default 8.
  • --max-batch-size: maximum independent requests per HTTP batch; default 8 (HTTP service only).
  • --max-request-tokens: bounds logical request tokens; default 65,536, also subject to the checkpoint's limits.
  • --execution-mode: auto, shared_prefix, or expanded.
  • --include-runtime-metrics: adds timing and execution counters to HTTP responses.

auto selects shared-prefix or expanded execution according to the backend and request. Shared-prefix execution reuses state/question computation and forks request-local caches for candidate continuations. Images referenced only in the prefix share their visual encoding; images in candidate descriptions use complete visual branches with one branch resident at a time.

Candidates are scored as a complete set. Their count is determined by the request and available memory; token limits are checked explicitly and inputs are never silently truncated. Reducing the branch microbatch size lowers branch activation memory while retaining every candidate. Image resolution and the complete option-set interaction also contribute to memory use.

🧪 Inference tests

python -m pip install -e ".[serve,test]"
pytest -q

The tests exercise request parsing, image assets, probability outputs, checkpoint loading, prefix-cache isolation, and HTTP serving without downloading model weights.

📄 License

MIT. Model weights and runtime dependencies retain their respective licenses.

📚 Citation

If you use LightDecision-1 in your work, please cite:

@article{lightdecision1team2026lightdecision1,
  title = {{LightDecision-1}: An Open-Vocabulary Probabilistic Multimodal Decision Model},
  author = {{LightDecision-1 Team} and Shen, Junhao and Gao, Mingqi and Xu, Zishan
            and Du, Enjun and Chen, Zirong and Li, Xinye and Huang, Jinyang
            and Zhang, Zhanqiu and Guo, Yiwen and Cheng, Hong},
  journal = {arXiv preprint arXiv:2611.37375},
  year = {2026}
}

About

An Open-Vocabulary Probabilistic Multimodal Decision Model

Topics

Resources

Stars

32 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages