C-Tianyu/NanoJev

Model

NanoJev — A nano replica of Jev

9

3 commits

1 linked in READMEs

updated Sep 17, 2026

See the code
decision-model
nanojev
navigation
parallel-inference
probability-distributions
pytorch

README

NanoJev — A nano replica of Jev

A 0.6B parallel decision model that returns complete probability distributions over dynamic candidates.

Give NanoJev multiple states and questions in one request. It evaluates the candidate paths in one batched backbone forward pass and returns structured decisions with zero output-token decoding.

Source code · Dataset · Pipeline commands

Features

  • Qwen3-0.6B backbone with structured decision heads.
  • Multiple states and questions evaluated in one batched forward.
  • Choice: 2–255 dynamic candidates with a probability for each candidate.
  • Boolean: the probability that a proposition is true.
  • Score: 2–10 ordered levels, their complete distribution, and an expected score.
  • Full distributions for greedy selection or probability sampling.
  • Persistent serving: load a checkpoint once and reuse it across requests.

Measured in the running service: 6 states · 18 questions · 44 candidate paths · 1 backbone forward.

Maze, Snake, and calibrated-decision checkpoints

The game showcase uses two specialized checkpoints. Every variant below includes complete weights, configuration, tokenizer, and backbone configuration, plus its training summary.

Variant directoryUse
variants/local_atomic_seed17Local safety judgments used in the 50×50 maze showcase
variants/games_gold_seed17Dynamic action choices used in the 12×12 Snake showcase
variants/games_api_seed17Full-map game-question comparison
variants/events_ce_seed17Observed-event cross-entropy control
variants/events_brier_seed17Observed-event Brier control
variants/events_paired_seed17RLCD-inspired paired proper-reward experiment

Watch the game demos · Game data · Variant manifest

The recorded 50×50 maze run reaches its goal in 244 attempts. The selected 12×12 Snake run collects 27 food and survives 256 steps with greedy control. These are model decisions composed with the shared planning code described in the repository.

Download the exact model for either showcase:

from pathlib import Path
from huggingface_hub import snapshot_download

variant = "local_atomic_seed17"  # Use "games_gold_seed17" for Snake.
snapshot = snapshot_download(
    repo_id="C-Tianyu/NanoJev",
    allow_patterns=[f"variants/{variant}/*"],
)
checkpoint_dir = Path(snapshot) / "variants" / variant
print(checkpoint_dir)

Pass the printed directory to the matching evaluator's --checkpoint argument, or the persistent service's --checkpoint-dir. Full commands are in the game release guide.

Earlier navigation performance

Controller: T=1 probability sampling. The complete benchmark contains 20 test maps and 20 OOD maps.

System4×4 test6×6 OOD
trained NanoJev19/20 — 95%18/20 — 90%
Jev20/20 — 100%19/20 — 95%
Original Qwen3-0.6B7/20 — 35%3/20 — 15%

Original Qwen is pretrained without task-specific fine-tuning. Its action distribution is obtained from the native language-model head, conditioned on the offered A–D answer tokens.

Download the base release checkpoint

The base release checkpoint for the earlier navigation benchmark is stored at the repository root:

best.safetensors
config.json
tokenizer/
backbone_config/

Use snapshot_download to retrieve only the final checkpoint files:

from huggingface_hub import snapshot_download

checkpoint_dir = snapshot_download(
    repo_id="C-Tianyu/NanoJev",
    allow_patterns=[
        "best.safetensors",
        "config.json",
        "tokenizer/*",
        "backbone_config/*",
    ],
)
print(checkpoint_dir)

Use the printed snapshot directory directly as --checkpoint-dir.

Run inference

Clone the implementation and install its recorded Python dependencies in a compatible CUDA environment:

git clone https://github.com/TianyuCodings/NanoJev.git
cd NanoJev
python -m pip install -r requirements-toy.txt

Save this request as request.json:

{
  "states": [{
    "id": "living_room",
    "state": "The room is 29 degrees, the target is 24 degrees, and someone is home.",
    "questions": {
      "action": {
        "type": "choice",
        "instructions": "Choose the action that most directly lowers the room temperature.",
        "criteria": {
          "cool": "Turn on air conditioning",
          "light": "Turn on the lights",
          "wait": "Keep the current settings"
        }
      },
      "occupied": {
        "type": "boolean",
        "instructions": "Someone is home."
      },
      "heat": {
        "type": "score",
        "instructions": "Classify how far the room temperature exceeds the target.",
        "criteria": [
          "At or below the target",
          "Above the target by at most 3 degrees",
          "Above the target by more than 3 degrees"
        ]
      }
    }
  }]
}

Run all questions in one forward pass:

CUDA_VISIBLE_DEVICES=0 python scripts/predict_toy_decisions.py \
  --checkpoint-dir path/to/downloaded/snapshot \
  --input request.json \
  --output predictions.json \
  --batch-questions 0 --precision bf16 --temperature 1

Add more objects to states to evaluate multiple states together. The response contains the distributions, selected choices, expected scores, and execution counters.

For a persistent HTTP service:

CUDA_VISIBLE_DEVICES=0 python scripts/serve_decisions.py \
  --checkpoint-dir path/to/downloaded/snapshot \
  --web-root web --port 8765 --precision bf16

Open http://127.0.0.1:8765 or send requests to POST /api/evaluate.

Stage 1 initialization checkpoint

The stage1/ directory contains an initialization checkpoint for further training with the same model architecture. Download it separately:

from pathlib import Path
from huggingface_hub import snapshot_download

snapshot_dir = snapshot_download(
    repo_id="C-Tianyu/NanoJev",
    allow_patterns=[
        "stage1/best.safetensors",
        "stage1/config.json",
        "stage1/tokenizer/*",
        "stage1/backbone_config/*",
    ],
)
stage1_dir = Path(snapshot_dir) / "stage1"
print(stage1_dir)

Pass this directory to scripts/train_pipeline_decisions.py with --init-checkpoint path/to/stage1. The trainer loads that checkpoint's architecture and parameters and starts a new optimizer. Use the root checkpoint for the earlier navigation benchmark; select a game variant for the new showcases.

Download the data

from huggingface_hub import snapshot_download

data_dir = snapshot_download(
    repo_id="C-Tianyu/NanoJev-Data",
    repo_type="dataset",
)
print(data_dir)

The pipeline guide covers the JSONL target-distribution interface, data generation, training, evaluation, and serving.

Checkpoint details

ItemValue
BackboneQwen/Qwen3-0.6B
Backbone revisionc1899de289a04d12100db370d81485cdf75e47ca
Final weightsbest.safetensors
Final SHA256fff62d1412685c1714eaa386acb603f9690371fb3cc8ad03dc41319302597c28
Stage 1 weightsstage1/best.safetensors
Stage 1 SHA256231b5178098477d9f82ae2cf38786d9ab8e0a80a019f009e55b772a66882cec4

Contributors

C-Tianyu

3 commits

C-Tianyu/NanoJev

Model

NanoJev — A nano replica of Jev

9

3 commits

1 linked in READMEs

updated Sep 17, 2026

See the code
decision-model
nanojev
navigation
parallel-inference
probability-distributions
pytorch

README

NanoJev — A nano replica of Jev

A 0.6B parallel decision model that returns complete probability distributions over dynamic candidates.

Give NanoJev multiple states and questions in one request. It evaluates the candidate paths in one batched backbone forward pass and returns structured decisions with zero output-token decoding.

Source code · Dataset · Pipeline commands

Features

  • Qwen3-0.6B backbone with structured decision heads.
  • Multiple states and questions evaluated in one batched forward.
  • Choice: 2–255 dynamic candidates with a probability for each candidate.
  • Boolean: the probability that a proposition is true.
  • Score: 2–10 ordered levels, their complete distribution, and an expected score.
  • Full distributions for greedy selection or probability sampling.
  • Persistent serving: load a checkpoint once and reuse it across requests.

Measured in the running service: 6 states · 18 questions · 44 candidate paths · 1 backbone forward.

Maze, Snake, and calibrated-decision checkpoints

The game showcase uses two specialized checkpoints. Every variant below includes complete weights, configuration, tokenizer, and backbone configuration, plus its training summary.

Variant directoryUse
variants/local_atomic_seed17Local safety judgments used in the 50×50 maze showcase
variants/games_gold_seed17Dynamic action choices used in the 12×12 Snake showcase
variants/games_api_seed17Full-map game-question comparison
variants/events_ce_seed17Observed-event cross-entropy control
variants/events_brier_seed17Observed-event Brier control
variants/events_paired_seed17RLCD-inspired paired proper-reward experiment

Watch the game demos · Game data · Variant manifest

The recorded 50×50 maze run reaches its goal in 244 attempts. The selected 12×12 Snake run collects 27 food and survives 256 steps with greedy control. These are model decisions composed with the shared planning code described in the repository.

Download the exact model for either showcase:

from pathlib import Path
from huggingface_hub import snapshot_download

variant = "local_atomic_seed17"  # Use "games_gold_seed17" for Snake.
snapshot = snapshot_download(
    repo_id="C-Tianyu/NanoJev",
    allow_patterns=[f"variants/{variant}/*"],
)
checkpoint_dir = Path(snapshot) / "variants" / variant
print(checkpoint_dir)

Pass the printed directory to the matching evaluator's --checkpoint argument, or the persistent service's --checkpoint-dir. Full commands are in the game release guide.

Earlier navigation performance

Controller: T=1 probability sampling. The complete benchmark contains 20 test maps and 20 OOD maps.

System4×4 test6×6 OOD
trained NanoJev19/20 — 95%18/20 — 90%
Jev20/20 — 100%19/20 — 95%
Original Qwen3-0.6B7/20 — 35%3/20 — 15%

Original Qwen is pretrained without task-specific fine-tuning. Its action distribution is obtained from the native language-model head, conditioned on the offered A–D answer tokens.

Download the base release checkpoint

The base release checkpoint for the earlier navigation benchmark is stored at the repository root:

best.safetensors
config.json
tokenizer/
backbone_config/

Use snapshot_download to retrieve only the final checkpoint files:

from huggingface_hub import snapshot_download

checkpoint_dir = snapshot_download(
    repo_id="C-Tianyu/NanoJev",
    allow_patterns=[
        "best.safetensors",
        "config.json",
        "tokenizer/*",
        "backbone_config/*",
    ],
)
print(checkpoint_dir)

Use the printed snapshot directory directly as --checkpoint-dir.

Run inference

Clone the implementation and install its recorded Python dependencies in a compatible CUDA environment:

git clone https://github.com/TianyuCodings/NanoJev.git
cd NanoJev
python -m pip install -r requirements-toy.txt

Save this request as request.json:

{
  "states": [{
    "id": "living_room",
    "state": "The room is 29 degrees, the target is 24 degrees, and someone is home.",
    "questions": {
      "action": {
        "type": "choice",
        "instructions": "Choose the action that most directly lowers the room temperature.",
        "criteria": {
          "cool": "Turn on air conditioning",
          "light": "Turn on the lights",
          "wait": "Keep the current settings"
        }
      },
      "occupied": {
        "type": "boolean",
        "instructions": "Someone is home."
      },
      "heat": {
        "type": "score",
        "instructions": "Classify how far the room temperature exceeds the target.",
        "criteria": [
          "At or below the target",
          "Above the target by at most 3 degrees",
          "Above the target by more than 3 degrees"
        ]
      }
    }
  }]
}

Run all questions in one forward pass:

CUDA_VISIBLE_DEVICES=0 python scripts/predict_toy_decisions.py \
  --checkpoint-dir path/to/downloaded/snapshot \
  --input request.json \
  --output predictions.json \
  --batch-questions 0 --precision bf16 --temperature 1

Add more objects to states to evaluate multiple states together. The response contains the distributions, selected choices, expected scores, and execution counters.

For a persistent HTTP service:

CUDA_VISIBLE_DEVICES=0 python scripts/serve_decisions.py \
  --checkpoint-dir path/to/downloaded/snapshot \
  --web-root web --port 8765 --precision bf16

Open http://127.0.0.1:8765 or send requests to POST /api/evaluate.

Stage 1 initialization checkpoint

The stage1/ directory contains an initialization checkpoint for further training with the same model architecture. Download it separately:

from pathlib import Path
from huggingface_hub import snapshot_download

snapshot_dir = snapshot_download(
    repo_id="C-Tianyu/NanoJev",
    allow_patterns=[
        "stage1/best.safetensors",
        "stage1/config.json",
        "stage1/tokenizer/*",
        "stage1/backbone_config/*",
    ],
)
stage1_dir = Path(snapshot_dir) / "stage1"
print(stage1_dir)

Pass this directory to scripts/train_pipeline_decisions.py with --init-checkpoint path/to/stage1. The trainer loads that checkpoint's architecture and parameters and starts a new optimizer. Use the root checkpoint for the earlier navigation benchmark; select a game variant for the new showcases.

Download the data

from huggingface_hub import snapshot_download

data_dir = snapshot_download(
    repo_id="C-Tianyu/NanoJev-Data",
    repo_type="dataset",
)
print(data_dir)

The pipeline guide covers the JSONL target-distribution interface, data generation, training, evaluation, and serving.

Checkpoint details

ItemValue
BackboneQwen/Qwen3-0.6B
Backbone revisionc1899de289a04d12100db370d81485cdf75e47ca
Final weightsbest.safetensors
Final SHA256fff62d1412685c1714eaa386acb603f9690371fb3cc8ad03dc41319302597c28
Stage 1 weightsstage1/best.safetensors
Stage 1 SHA256231b5178098477d9f82ae2cf38786d9ab8e0a80a019f009e55b772a66882cec4

Contributors

C-Tianyu

3 commits