freshcrate
Home > Uncategorized > geon-decoder

geon-decoder

GEON: Structure-first decoding via equivalence classes and field closure

Description

GEON: Structure-first decoding via equivalence classes and field closure

README

GEON: Structure-First Decoding

A structural decoding layer for language models. LLMs guess tokens.
GEON enforces structure.

Resolve structure first, then select tokens.


πŸ”₯ Demo (why this matters)


πŸš€ Run the benchmark

This runs a 10-task code generation benchmark comparing:

  • Baseline token decoding
  • GEON (structure-first decoding)
  • Reproduce the benchmark results locally:
python geon_eval_harness_v2.py

Baseline LLM:

next token ← p(token | context)

GEON:

structure β†’ valid options β†’ token selection


Input:

def is_prime(n):
    if n < 2:

Baseline LLM:

return True  ❌

GEON (Structure-First Decoding):

return False  βœ…

Input:

def add(a, b):
    return (a + b

Baseline LLM:

return (a + b  ❌

GEON (Structure-First Decoding):

return (a + b)  βœ…

DEMO OUTPUT

GEON Demo


Benchmark Snapshot

We evaluated a small Python code-generation harness on three tasks:

  • factorial
  • sum_list
  • max_element

Results

Method Syntax/load pass rate Semantic pass rate Canonical pattern rate
Baseline LLM 100.0% 3.3% 70.0%
GEON 100.0% 100.0% 100.0%

Interpretation

Both methods produced syntactically valid Python.

The difference appears at the structural and semantic level:

  • Baseline LLM often generates plausible but incorrect programs
  • GEON restricts generation to structurally admissible continuations

This improves not just syntax, but functional correctness.

Harness OUTPUT

GEON Demo

Benchmark (10-task harness)

We evaluated GEON against a baseline token-selection approach on 10 Python code generation tasks:

  • factorial
  • sum_list
  • max_element
  • count_vowels
  • reverse_string
  • is_even
  • is_sorted
  • count_positive
  • first_char
  • square_list

Results

Method Syntax/load pass rate Semantic pass rate Canonical pattern rate
Baseline LLM 100.0% 13.3% 90.0%
GEON 100.0% 100.0% 100.0%

Per-task semantic pass rates (%)

Task Baseline GEON
factorial 0.0 100.0
sum_list 0.0 100.0
max_element 0.0 100.0
count_vowels 0.0 100.0
reverse_string 33.3 100.0
is_even 66.7 100.0
is_sorted 0.0 100.0
count_positive 33.3 100.0
first_char 0.0 100.0
square_list 0.0 100.0

Interpretation

Both methods produce syntactically valid Python.

However:

  • The baseline often generates plausible but incorrect programs
  • GEON restricts generation to structurally admissible continuations

This leads to consistent semantic correctness across all tasks.

GEON enforces structure before token selection.

How GEON Works (intuition)

Standard decoding selects the next token based on probability: argmax p(token)

GEON changes this process:

  1. Tokens are mapped into equivalence classes (ECs)
  2. ECs are evaluated under structural constraints (S1 field)
  3. Only structurally admissible tokens are allowed
  4. Sampling happens within this reduced set

This enforces:

  • syntactic closure (e.g. parentheses must match)
  • logical consistency (e.g. conditional branches align)
  • structural validity before generation

Why This Matters

Most LLM errors are not due to lack of knowledge, but lack of structure:

  • incomplete code
  • invalid syntax
  • inconsistent logic

GEON addresses this at the decoding level.

Instead of correcting outputs after generation, it prevents invalid outputs from being produced.


Key Idea

GEON does not ask:

"what token is most likely?"

It asks:

"what tokens are structurally valid?"

Then selects among them.

Comparison

Property Standard LLM GEON
Syntax validity ❌ βœ…
Logical consistency ❌ βœ…
Structural guarantees ❌ βœ…

Why β€œGEON”?

The name GEON is inspired by the concept of geons introduced by John Archibald Wheeler.

Wheeler used β€œgeons” to describe structures that are defined not by material substance, but by the relationships and constraints that hold them together.

GEON applies a similar idea to generated sequences such as code and structured language:

  • meaning is not just in tokens
  • it emerges from structure and admissibility
  • validity is defined by constraints, not probability

In this sense, GEON treats sequence generation as a structural process rather than a purely probabilistic one.

Release History

VersionChangesUrgencyDate
main@2026-04-11Latest activity on main branchHigh4/11/2026
0.0.0No release found β€” using repo HEADHigh4/8/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

modal-clientSDK libraries for Modalmain@2026-04-21
ai-dataset-generatorπŸ€– Generate tailored AI training datasets quickly and easily, transforming your domain knowledge into essential training data for model fine-tuning.main@2026-04-21
antonMost advanced AI coworkerv2.0.2
awesome-opensource-aiCurated list of the best truly open-source AI projects, models, tools, and infrastructure.main@2026-04-20
ossatureAn open-source harness for spec-driven code generation.master@2026-04-18