Skip to content

jev-decoder

Playful experiments using Jev's Choice as a decoder: next character, next BPE token, and grammar-constrained SQL generation.

Projectresearch

Overview

jev-decoder is a set of experiments that misuse Jev's Choice primitive as an autoregressive decoder. Since Choice returns probabilities over up to 255 options, the author offers ASCII characters, then a 255-entry BPE vocabulary trained on tiny Shakespeare, and samples the next symbol from the returned distribution, appending it to the state each step.

The character-level results are mostly gibberish, as the README shows. A more structured experiment generates SQL: a Lark grammar and the database schema determine which tokens are legal at each step, Jev picks one via Choice, and deterministic code executes the finished query against the Spider dataset. It is a curiosity project exploring the limits of the interface, not a practical tool.

What the decision model decides

TypeQuestionAnswers
ChoiceChoose the next ASCII character or token to continue the text—
ChoiceWhich grammar-allowed SQL token comes next?—

How it works

  1. Prepare data (tiny Shakespeare, tokenizer, Spider) with the scripts
  2. Build the allowed options for the next step from a vocabulary or grammar
  3. Ask Jev a Choice question and sample from the distribution
  4. Append and repeat; execute finished SQL

Strengths

  • Explores how far Choice can be pushed
  • Grammar constraint guarantees syntactically legal SQL options

Caveats

  • Text generation results are poor, as shown in the README
  • One API call per token is slow and costly
  • Experimental hobby code

Getting started

`uv run ./scripts/dwnld_shk.py` and `uv run ./scripts/train_tokenizer.py`, then run the experiment scripts; download Spider for sql_gen.py.

At a glance

Type
Project
Status
research
Language
Python
Runtime
Scripts (uv)
Has code
yes
Has tests
no

Use cases and integrations

How curated lists describe it

  • Uses Jev as an autoregressive decoder: Jev picks each next SQL token from a Choice over the options a Lark grammar allows, while deterministic code derives those options from the grammar and database schema and executes the finished query.

    cobanov/awesome-jev

Frequently asked questions

Can Jev generate text this way?

Technically, one Choice per token, but the README's samples show the output is not coherent.

What about SQL?

A grammar limits options to legal tokens at each step and Jev picks among them.

Is this practical?

No, it is an exploratory experiment.

Related projects

  • TypeAR★ 946

    TypeLLM: Jev-inspired type-safe decoding for existing autoregressive LLMs on SGLang, with schema-guaranteed typed outputs.

    ProjectbetaPython
  • llama.cpp-based C++ server that turns any LLM into a System One decision model, reading answers from next-token logits.

    ProjectbetaC++
  • Decision-forensics library that explains a Jev answer by ablating parts of the input and measuring how far the probability moves.

    ProjectbetaPython
  • Adapter that turns existing LLMs into Jev-style decision functions with option scores, optional calibration and review thresholds.

    ProjectprototypePython
  • Decision sidecar and Copilot CLI pre-turn hook that mimics Jev choice, noul and score using Azure Foundry Cohere Rerank.

    HookprototypePython
  • Toy chat that makes Jev talk by repeatedly choosing its next word from a tiny caveman vocabulary.

    ProjectprototypeTypeScript