Neuro-Symbolic Code Generation via S-Expression Intermediate Representation and Deterministic Harness Engineering

Fuente: Zenodo
Saved in:
Bibliographic Details
Main Author: Jin, Ruoqi
Format: Recurso digital
Published: Zenodo 2026
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866901603019128832
author Jin, Ruoqi
author_facet Jin, Ruoqi
contents <p>Current AI-assisted code generation follows an autoregressive token-prediction paradigm where large language models (LLMs) freely generate source code, resulting in frequent compilation failures due to type errors, undefined references, and hallucinated APIs. We present Neural Codegen, a neuro-symbolic architecture that constrains LLMs to output S-expressions (a minimal, homoiconic DSL), validates the output against a typed intermediate representation (IR) defined as Rust enum whitelists, and deterministically assembles guaranteed-compilable Rust code via pre-verified template composition. We call this the "GPU mode" of code generation: the LLM selects from a finite instruction set rather than creating in an unbounded code space. In benchmarks against Claude 4.6 Opus generating Rust directly, the pipeline achieves a 75% Pass@1 compilation rate versus 62% for raw LLM generation. We further describe the intent-reality-delta (IRD) closed loop implemented in the Jarvis system, where both architectural specification and physical codebase are represented as S-expressions and compared by a pure deterministic algorithm. We position this work within the emerging discipline of harness engineering, arguing that the moat in agentic software development is the harness, not the model.</p>
format Recurso digital
id zenodo_https___doi_org_10_5281_zenodo_19372158
institution Zenodo
language
publishDate 2026
publisher Zenodo
record_format zenodo
spellingShingle Neuro-Symbolic Code Generation via S-Expression Intermediate Representation and Deterministic Harness Engineering
Jin, Ruoqi
<p>Current AI-assisted code generation follows an autoregressive token-prediction paradigm where large language models (LLMs) freely generate source code, resulting in frequent compilation failures due to type errors, undefined references, and hallucinated APIs. We present Neural Codegen, a neuro-symbolic architecture that constrains LLMs to output S-expressions (a minimal, homoiconic DSL), validates the output against a typed intermediate representation (IR) defined as Rust enum whitelists, and deterministically assembles guaranteed-compilable Rust code via pre-verified template composition. We call this the "GPU mode" of code generation: the LLM selects from a finite instruction set rather than creating in an unbounded code space. In benchmarks against Claude 4.6 Opus generating Rust directly, the pipeline achieves a 75% Pass@1 compilation rate versus 62% for raw LLM generation. We further describe the intent-reality-delta (IRD) closed loop implemented in the Jarvis system, where both architectural specification and physical codebase are represented as S-expressions and compared by a pure deterministic algorithm. We position this work within the emerging discipline of harness engineering, arguing that the moat in agentic software development is the harness, not the model.</p>
title Neuro-Symbolic Code Generation via S-Expression Intermediate Representation and Deterministic Harness Engineering
url https://doi.org/10.5281/zenodo.19372158